Garry's Mod Wiki

Player:IsAdmin

boolean Player:IsAdmin()

Description

Returns whether the player is an admin or not.

Returns

1 boolean
True if the player is an 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.

Page Links


Special Pages


Wikis

?

Render Time: 29ms

DB GetPage 5
Generate Html 2
SaveChanges (1) 8
Render Body 0
Render Sidebar 11