Garry's Mod Wiki

Revision Difference

Player:SetUserGroup#546697

<function name="SetUserGroup" parent="Player" type="classfunc"> <description>Sets the usergroup of the player. Same as Player:SetNWString('UserGroup',string groupName).</description> <realm>Server</realm> <file line="49-L55">lua/includes/extensions/player_auth.lua</file> <args> <arg name="groupName" type="string">The user group of the player.</arg> </args> </function> <example> <description>Make the player superadmin and print their group.</description> <code> Entity( 1 ):SetUserGroup( "superadmin" ) print( Entity( 1 ):GetUserGroup() ) Player( 1 ):SetUserGroup( "superadmin" ) print( Player( 1 ):GetUserGroup() ) </code> <output> ``` superadmin ``` </output> </example>