Player/SetUserGroup

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Added source code reference)
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|Realm=Server
 
|Realm=Server
 
|IsClass=Yes
 
|IsClass=Yes
 +
|File=lua/includes/extensions/player_auth.lua
 +
|Line=49-L55
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 10: Line 12:
 
}}
 
}}
 
{{Example
 
{{Example
|Description=Will make the user superadmin
+
|Description=Make the player superadmin and print their group.
 
|Code=Entity(1):SetUserGroup("superadmin")
 
|Code=Entity(1):SetUserGroup("superadmin")
 
print(Entity(1):GetUserGroup())
 
print(Entity(1):GetUserGroup())
 +
|OutputFixedWidth=Fixed width
 
|Output=superadmin
 
|Output=superadmin
 
}}
 
}}

Latest revision as of 06:23, 21 February 2018

 Player:SetUserGroup( )

Contents

Description

Sets the usergroup of the player.

Arguments

string groupName

The user group of the player.

Examples

Example

Make the player superadmin and print their group.

Entity(1):SetUserGroup("superadmin")
print(Entity(1):GetUserGroup())

Output:

superadmin
Personal tools
Navigation