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).
Syntax
Section titled “Syntax”SetPlayerAdmin(pid, admin)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
admin |
boolean | true promotes, false demotes (true without) |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”local admins = { henry = true, hans = true }function OnPlayerConnect(pid) if admins[GetPlayerName(pid):lower()] then SetPlayerAdmin(pid, true) endendSee also
Section titled “See also”IsPlayerAdmin · the Accounts, admins, bans and the audit group of the index
