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 .. ")")
endThis 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_chanceflag_sanction_loverflag_untrusted_plusflag_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.
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