SetPlayerAdmin
Makes the player an admin for the session - or takes it back.
The [accounts] admins list in server.toml is the persistent way; this one lasts until the disconnect or a reload (the
listed admins keep theirs).
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”-- the first player on an empty server runs itfunction OnPlayerSpawn(pid) if GetPlayerCount() == 1 then SetPlayerAdmin(pid, true) endendSee also
Section titled “See also”IsPlayerAdmin · GetAdminNames · the Accounts, admins, bans and the audit group of the index
