Scripts / Docs /TML Admin Panel

API

Everything here is server side unless noted. Exports are stable within a major version.

Exports

BuildBanCard(banId, displayName, reason, bannedAt, unbanAt) -> string

Returns the Adaptive Card JSON (schema 1.0) used on the ban screen.

Param Type Notes
banId number Row id of the ban
displayName string? Name stored with the ban
reason string? Shown on the card
bannedAt string? YYYY-MM-DD HH:MM:SS
unbanAt string? Same format. nil = permanent
local card = exports.tml_adminpanel:BuildBanCard(12, 'Name', 'Cheating', '2026-09-25 12:00:00', nil)
deferrals.presentCard(card)

BuildBanText(banId, displayName, reason, bannedAt, unbanAt) -> string

Same arguments. Returns the plain-text version of the ban screen.

GetBanScreen(banId, displayName, reason, bannedAt, unbanAt) -> table

Returns { mode = 'card', card = <json>, text = <string> } or { mode = 'text', text = <string> }, following Config.BanScreenMode.

captureScreenshot(targetId, opts) -> table?, string?

Captures a player's screen and stores it in the evidence gallery. Needs screenshot-basic and the upload key.

Param Type Notes
targetId number Server id of a connected player
opts.adminId string? Recorded as the actor. Default 0
opts.adminName string? Default System
opts.reason string? Stored with the capture
opts.pinned boolean? Pinned captures never expire

Returns the saved row (id, url, targetCharId, targetName, metadata), or nil and an error message.

Server events

Triggered by the panel for your own scripts to listen to. They are not net events, so clients cannot fire them.

tml_adminpanel:actionLogged

(adminSource, action, targetName, details, targetId). Fired for every staff action the panel writes to its own action log (kick, ban, warn, money, groups, teleports, vehicles, screenshots...). adminSource is the staff member's server id, action the log's action name (for example ban, money_cash, toggle_noclip), targetId the target's account or character id when there is one. TML Monitor listens to this to show panel actions on its dashboard.

AddEventHandler('tml_adminpanel:actionLogged', function(adminSource, action, targetName, details)
  print(('%s used %s on %s: %s'):format(GetPlayerName(adminSource), action, targetName or '-', details or ''))
end)

tml_adminpanel:characterRenamed

(charId, firstName, lastName, source). Fired after a staff member renames a character. source is the player's server id when they are online, otherwise nil. Use it to refresh names in other resources.

tml_adminpanel:selfVehicleSpawned

(source, vehicleEntity, plate). Fired after staff spawn a vehicle for themselves with the Admin Tools tab. Use it to hand out vehicle keys.

AddEventHandler('tml_adminpanel:selfVehicleSpawned', function(source, vehicle, plate)
  exports['my_keys']:GiveKeys(source, plate)
end)

Bridge

Adapters expose a fixed set of functions (see bridge/README.md). Other resources should not call them; use your framework's own API instead.

Esc

↑↓ to move Enter to open

Keyboard shortcutsEsc
Ctrl K or /
Search pages, scripts and docs
G then H
Go to Home
G then S
Go to Store
G then P
Go to Previews
G then D
Go to Docs
G then I
Go to Install helper
G then F
Go to FAQ
C
Open the cart (store pages)
?
Show this list