Player Groups

From GMod Wiki

Jump to: navigation, search

Users.txt

This text file is used to determine who is an admin and super admin. Garry's Mod's default users.txt file is located in garrysmod\garrysmod <or your Garry's Mod root folder>\settings\users.txt. Your non-edited file should look like this:

"Users"
{
	//
	// This is your users file
	//
	// You can use this file to add people as admins on your server
	// Add them to the relevant section
	//
	// If you're a Lua coder you can add your own sections and use them
	// in your script by doing pl:IsUserGroup( "admin" ) etc
	//
 
	"superadmin"
	{
		//"garry"			"STEAM_0:1:7099"
	}
 
	"admin"
	{
		//"garry"			"STEAM_0:1:7099"
	}
 
}

Anything after double forward slashes (//) count as comments and do not affect how the file will be read. They are kept for reference and examples only and are not run. If you are editing the file, you should ignore these comments.

It's very simply set up; you have the name of the group, followed by a { on a new line, then the name of the player with their Steam ID on the next line. Garry has set himself in each category, but again, it starts with two double slashes before it, which means it's commented out, and Garry's Mod will not read it. To set yourself in either or both groups, change it to look like this:

"Users"
{
	//
	// This is your users file
	//
	// You can use this file to add people as admins on your server
	// Add them to the relevant section
	//
	// If you're a Lua coder you can add your own sections and use them
	// in your script by doing pl:IsUserGroup( "admin" ) etc
	//
 
	"superadmin"
	{
		"Jiggles"			"STEAM_0:1:7671671"
	}
 
	"admin"
	{
		"Jiggles"			"STEAM_0:1:7671671"
	}
 
}

Of course, you can change Jiggles to your in-game name and your SteamID.

If you wish, you may also add non-standard groups. Any group added to users.txt can be detected using Player.IsUserGroup()

Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox