Garry's Mod Wiki

Player:IsAdmin

  boolean Player:IsAdmin()

Description

Returns whether the player is an admin or not. It will also return true if the player is Player:IsSuperAdmin by default.

Internally this is determined by Player:IsUserGroup.

Returns

1 boolean
True if the player is an admin or a super admin.

Example

Every time a player spawns, print in the console whether they are an admin.

hook.Add( "PlayerSpawn", "PrintIfAdmin", function( ply ) if ( ply:IsAdmin() ) then print( "It's true, " .. ply:Nick() .. " is an admin" ) else print( "It's false, " .. ply:Nick() .. " is not an admin" ) end end )
Output:
It's true, Alice is an admin. It's false, Bob is not an admin.