Garry's Mod Wiki

Garry's Mod Wiki

  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.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...