Garry's Mod Wiki


boolean Player:IsAdmin()


Returns whether the player is an admin or not


1 boolean
True if the player is an admin


Every time a player spawns, print in the console whether they are an admin.<!-- Untested yet, will test in a few minutes -->

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



Render Time: 30ms

Session 0
DB GetPage 3
Generate Html 5
SaveChanges 8
Render Body 0
Render Sidebar 11