Garry's Mod Wiki

Revision Difference

Player:IsUserGroup#529153

<function name="IsUserGroup" parent="Player" type="classfunc"> <description>Returns true/false if the player is in specified group or not.</description> <realm>Shared</realm> <file line="24-L32">lua/includes/extensions/player_auth.lua</file> <file line="28-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>