Player.IsAdmin

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:IsAdmin( )
Description:
Returns true if the player is a member of the group "admin" or "superadmin"
Returns: Boolean
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.IsAdmin]Player.IsAdmin [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSimple function to check whether the player is an admin on a server
Used onNewerServer.png
Code
 
function checkAdmin(ply)
 
     if ply:IsAdmin() then
          ply:ChatPrint("You are an Admin on the server")
     else
          ply:ChatPrint("You are not an admin on this server!")
     end
 
end
concommand.Add("info_admin", checkAdmin)
 
OutputYou are an Admin on the server!

Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox