Player.IsUserGroup

From GMod Wiki

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



Example

DescriptionChecks if the player is an admin
Used onNewerShared.png
Code
 
local player = players.GetAll()[1] //Get the first player!
if player:IsUserGroup("admin") then
 print("The Player is an admin!")
else
 print("The Player is not an admin!")
end
 
OutputThe Player is an admin! if the first player is an admin. The Player is not an admin! otherwise.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox