opx_infinityadmin
Server
Last updated on
The admin contract on the server — staff check, roster and recent staff actions.
local admin = OPX.Api.Get('admin')From server code inside opx_infinity. Every member returns a Result, never yields and changes nothing: every change is a command.
IsStaff
Whether the ACL grants the player command.opx.admin.
admin.IsStaff(playerId)Parameters
- playerId:
number0(the console) is always staff.
Returns
Result—{ staff: boolean };staffis false when the ACL cannot be read.
local res = admin.IsStaff(source)
if res.ok and res.value.staff then print('staff') endRoster
One row per connected player.
admin.Roster()Returns
Result—{ rows }, each row:id:numbername:string— character name, else accountuser:string?— account, when a character is loadedcitizenId:string?state:'loading' | 'gate' | 'down' | 'up'bucket:number
RecentActions
The latest staff actions from the in-memory ring, newest last.
admin.RecentActions(count)Parameters
- count?:
number- 1–200. Default 15.
Returns
Result—{ entries }, each entry:seq,atMs:numberevent:string— e.g.admin.player.killok:booleanactor:number— 0 = consoleactorName,target,targetName,detail