Garry's Mod Wiki

Revision Difference

Player:IsUserGroup#552093

<function name="IsUserGroup" parent="Player" type="classfunc"> <description>Returns true/false if the player is in specified group or not. See <page>Player:GetUserGroup</page> for a way to get player's usergroup.</description> <realm>Shared</realm> <file line="28-L38">lua/includes/extensions/player_auth.lua</file> <file line="32-L38">lua/includes/extensions/player_auth.lua</file> <args> <arg name="groupname" type="string">Group to check the player for.</arg> </args> <rets> <ret name="" type="boolean">isInUserGroup</ret> </rets> </function> <example> <description>Prints in the players console "yes, I'm awesome!" if he's in the superadmin group.</description> <code> if ( Entity( 1 ):IsUserGroup( "superadmin" ) ) then print( "Yes, I'm awesome!" ) end </code> <output>"Yes, I'm awesome!" in console.</output> </example>