Skip to content

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).

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

boolean - false when not connected

-- the first player on an empty server runs it
function OnPlayerSpawn(pid)
if GetPlayerCount() == 1 then SetPlayerAdmin(pid, true) end
end

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