For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exports & Events

Madonn'Admin exposes client-side and server-side exports, as well as a server-side HTTP API and custom log events for integration with other resources.


πŸ–₯️ Client-side Exports

GetStaffRank

Returns the staff rank ID of the local player.

local rank = exports['MS_MadonnAdmin']:GetStaffRank()
-- Returns: number
-- -1 = Super Admin
--  0 = Not a staff member
--  1+ = Staff rank (lower number = higher authority)

Example

local rank = exports['MS_MadonnAdmin']:GetStaffRank()
if rank ~= 0 and rank ~= nil then
    print("This player is a staff member (rank " .. rank .. ")")
end

This export is used by other MadonneStudio resources (e.g. MS_Delete_Gun with MADONNADMIN = "auto") to detect whether the local player has staff access.


IsPlayerTrusted

Returns whether the local player is considered trusted by the Madonn'Admin trust system.

A player is considered untrusted if they have any of the following flags active:

  • flag_last_chance

  • flag_sanction_lover

  • flag_untrusted_plus

  • flag_untrusted

Example


🌐 Server-side Exports

GetStaffLevelServerSide

Returns the staff rank ID of a given player by their server ID.

Example


GetStaffStatus

Returns whether a given player is currently in active moderation mode (i.e. they have activated their staff mode in-game).

Example


πŸ“‘ Custom Log Event

Madonn'Admin exposes a custom log event that allows any resource to push entries into the Madonn'Admin log system, including Discord webhook delivery and automatic screenshots.

Parameter
Type
Description

type

number

Log type. Use 8 for custom logs

playerA

number

Server ID of the primary player

detail

string

Detail text of the log

playerB

number | nil

Server ID of a second player (e.g. the attacker), or nil

text

string | nil

Custom action label to display in the embed

colorEmbed

number

Discord embed color in hex (e.g. 0xFF0000)

screenshot

boolean

If true, automatically captures a screenshot of playerB (or playerA) and attaches it to the Discord embed

webhookAddress

string

Discord webhook URL to send the log to

Example


πŸ”” Custom Notification Handler

When NotificationSystem is set to "custom" in config/cfg_main.lua, edit client/custom/cl_functions.lua to implement your own notification:


πŸ“‹ Custom Log Handler

To add your own persistent log logic, edit the provided custom log files:

Client-side β€” client/custom/cl_logs.lua:

Server-side β€” server/custom/sv_logs.lua:

Last updated