Skip to content

SetPlayerAdmin

Makes the player an admin for the session - or takes it back.

Admins are the mode’s to decide: the server keeps no list and no accounts. Promote in OnPlayerConnect from a list in the script or a row of the mode’s database, or after the mode’s own login. The flag lasts until the disconnect or a reload (OnPlayerConnect runs again after a reload, so a mode that promotes there keeps its admins).

SetPlayerAdmin(pid, admin)
Parameter Type
pid number the player
admin boolean true promotes, false demotes (true without)

boolean - false when not connected

local admins = { henry = true, hans = true }
function OnPlayerConnect(pid)
if admins[GetPlayerName(pid):lower()] then SetPlayerAdmin(pid, true) end
end

IsPlayerAdmin · the Accounts, admins, bans and the audit group of the index