AddUserGroup?

This may sound dumb, and it may look dumb because you can just code your own (In a way), but the question is: Why not?

There’s a Player.IsUserGroup(), Player.SetUserGroup(), what about along the lines of SERVER.AddUserGroup?
I’m talking about in the default garrysmod/settings/users.txt

A user group is simply a variable, you don’t create groups, but simply just set the player’s to whatever.

I know about player.SetUserGroup(), you seem to have misread my question? I’m asking to be able to create groups directly from Lua.

I just told you, there is no set list of groups, you don’t add or delete them.

You can add or delete them, just look in the users.txt and you’ll see it’s possible.

/facepalm

That just sets them on the player with that steamid on join. You can find the code somewhere, but it doesn’t actually add them.

It’s just a networked variable.

http://luabin.overvprojects.nl/?path=/lua/includes/extensions/player_auth.lua

Yea that’s the file I mentioned.

Look, I’m just asking if a function can be created so that groups in settings/users.txt may be created through Lua. Theres some (badly) coded addons, that might require you to create a new group in settings/users.txt, but if it’s not there the addon will break. If there were a function to create a group, it won’t break the addon, and the installer won’t have to go through the trouble. I think this may come in handy one day. Yes, if you’re good at coding you can make groups yourself through NWStrings, PData, glon, etc to fetch and create, but this seems like it could make it much easier.

If you had clicked the link DarKSunrise posted you would have seen that the usergroup is nothing more than a networked string and as such it doesn’t matter if you set it to something not listed in that file as it simply doesn’t depend on it.

[editline]13th February 2011[/editline]

These “badly coded addons” is an illusion of yours, usergroups don’t depend on wheter they’re “defined” in some stupid file, they’re just strings.
I don’t know many more ways to say this so I hope you get it this time:tinfoil:

itt: op can’t read

Yeah, I can. Sure, I read the link, and I know it doesn’t matter, I’m just – screw it. You guys are fucking retarded.


(User was banned for this post ("Flaming" - Grea$eMonkey))

:irony:

Look, you can set a usergroup to anything.

[lua]ply:SetUserGroup( “disseminate’s hoes” )[/lua]

is PERFECTLY valid.

As is, in users.txt


"disseminate's hoes"
{
(stuff)
}

Please post questions in the Questions subforum. There’s a link in the rules sticky which you should have read anyway.

-snip- Was it that hard guys? <.<

That hard to what?

Beating it into his brain, I’m guessing.

its a ulx command aswell

[editline]18th February 2011[/editline]

/--------------------------------------------------------
Default teams. If you make a team above the citizen team, people will spawn with that team!
--------------------------------------------------------
/
TEAM_CITIZEN = AddExtraTeam(“Citizen”, Color(20, 150, 20, 255), {
“models/player/Group01/Female_01.mdl”,
“models/player/Group01/Female_02.mdl”,
“models/player/Group01/Female_03.mdl”,
“models/player/Group01/Female_04.mdl”,
“models/player/Group01/Female_06.mdl”,
“models/player/Group01/Female_07.mdl”,
“models/player/group01/male_01.mdl”,
“models/player/Group01/Male_02.mdl”,
“models/player/Group01/male_03.mdl”,
“models/player/Group01/Male_04.mdl”,
“models/player/Group01/Male_05.mdl”,
“models/player/Group01/Male_06.mdl”,
“models/player/Group01/Male_07.mdl”,
“models/player/Group01/Male_08.mdl”,
“models/player/Group01/Male_09.mdl”},
[[The Citizen is the most basic level of society you can hold
besides being a hobo.
You have no specific role in city life.]], {}, “citizen”, 0, 45, 0, false, false)

TEAM_POLICE = AddExtraTeam(“Civil Protection”, Color(25, 25, 170, 255), “models/player/police.mdl”, [[The protector of every citizen that lives in the city .
You have the power to arrest criminals and protect innocents.
Hit them with your arrest baton to put them in jail
Bash them with a stunstick and they might learn better than to disobey
the law.
The Battering Ram can break down the door of a criminal with a warrant
for his/her arrest.
The Battering Ram can also unfreeze frozen props(if enabled).
Type /wanted <name> to alert the public to this criminal
OR go to tab and warrant someone by clicking the warrant button]], {“arrest_stick”, “unarrest_stick”, “weapon_glock2”, “stunstick”, “door_ram”, “weaponchecker”}, “cp”, 4, 65, 0, true, true)

TEAM_GANG = AddExtraTeam(“Gangster”, Color(75, 75, 75, 255), {
“models/player/Group03/Female_01.mdl”,
“models/player/Group03/Female_02.mdl”,
“models/player/Group03/Female_03.mdl”,
“models/player/Group03/Female_04.mdl”,
“models/player/Group03/Female_06.mdl”,
“models/player/Group03/Female_07.mdl”,
“models/player/group03/male_01.mdl”,
“models/player/Group03/Male_02.mdl”,
“models/player/Group03/male_03.mdl”,
“models/player/Group03/Male_04.mdl”,
“models/player/Group03/Male_05.mdl”,
“models/player/Group03/Male_06.mdl”,
“models/player/Group03/Male_07.mdl”,
“models/player/Group03/Male_08.mdl”,
“models/player/Group03/Male_09.mdl”}, [[The lowest person of crime.
A gangster generally works for the Mobboss who runs the crime family.
The Mobboss sets your agenda and you follow it or you might be punished.]], {}, “gangster”, 3, 45, 0, false, false)

TEAM_MOB = AddExtraTeam(“Mob boss”, Color(25, 25, 25, 255), “models/player/gman_high.mdl”, [[The Mobboss is the boss of the criminals in the city.
With his power he coordinates the gangsters and forms an efficent crime
organization.
He has the ability to break into houses by using a lockpick.
The Mobboss also can unarrest you.]], {“lockpick”, “unarrest_stick”}, “mobboss”, 1, 60, 0, false, false)

TEAM_GUN = AddExtraTeam(“Gun Dealer”, Color(255, 140, 0, 255), “models/player/monk.mdl”, [[A gun dealer is the only person who can sell guns to other
people.
However, make sure you aren’t caught selling guns that are illegal to
the public.
/Buyshipment <name> to Buy a weapon shipment
/Buygunlab to Buy a gunlab that spawns P228 pistols]], {}, “gundealer”, 2, 45, 0, false, false)

TEAM_MEDIC = AddExtraTeam(“Medic”, Color(47, 79, 79, 255), “models/player/kleiner.mdl”, [[With your medical knowledge, you heal players to proper
health.
Without a medic, people can not be healed.
Left click with the Medical Kit to heal other players.
Right click with the Medical Kit to heal yourself.]], {“med_kit”}, “medic”, 3, 45, 0, false, false)

TEAM_COOK = AddExtraTeam(“Cook”, Color(238, 99, 99, 255), “models/player/mossman.mdl”, [[As a cook, it is your responsibility to feed the other members
of your city.
You can spawn a microwave and sell the food you make:
/Buymicrowave]], {}, “cook”, 2, 45, 0, 0, false)

TEAM_CHIEF = AddExtraTeam(“Civil Protection Chief”, Color(20, 20, 255, 255), “models/player/combine_soldier_prisonguard.mdl”, [[The Chief is the leader of the Civil Protection unit.
Coordinate the police forces to bring law to the city
Hit them with arrest baton to put them in jail
Bash them with a stunstick and they might learn better than to
disobey the law.
The Battering Ram can break down the door of a criminal with a
warrant for his/her arrest.
Type /wanted <name> to alert the public to this criminal
Type /jailpos to set the Jail Position]], {“arrest_stick”, “unarrest_stick”, “weapon_deagle2”, “stunstick”, “door_ram”, “weaponchecker”}, “chief”, 1, 75, 0, false, true, TEAM_POLICE)

TEAM_MAYOR = AddExtraTeam(“Mayor”, Color(150, 20, 20, 255), “models/player/breen.mdl”, [[The Mayor of the city creates laws to serve the greater good
of the people.
If you are the mayor you may create and accept warrants.
Type /wanted <name> to warrant a player
Type /jailpos to set the Jail Position
Type /lockdown initiate a lockdown of the city.
Everyone must be inside during a lockdown.
The cops patrol the area
/unlockdown to end a lockdown]], {}, “mayor”, 1, 85, 0, true, false/, {TEAM_CHIEF, TEAM_POLICE}/)
/*

HOW TO MAKE AN EXTRA CLASS!!!

You can make extra classes here. Set everything up here and the rest will be done for you! no more editing 100 files without knowing what you’re doing!!!
Ok here’s how:

To make an extra class do this:
AddExtraTeam( “<NAME OF THE CLASS>”, Color(<red>, <Green>, <blue>, 255), “<Player model>” , [[<the description(it can have enters)>]], { “<first extra weapon>”,"<second extra weapon>", etc…}, “<chat command to become it(WITHOUT THE /!)>”, <maximum amount of this team> <the salary he gets>, 0/1/2 = public /admin only / superadmin only, <1/0/true/false Do you have to vote to become it>, true/false DOES THIS TEAM HAVE A GUN LICENSE?, TEAM: Which team you need to be to become this team)

The real example is here: it’s the Hobo: */

–VAR without /!!! The name the color(what you see in tab) the player model The description
TEAM_HOBO = AddExtraTeam(“Hobo”, Color(80, 45, 0, 255), “models/player/corpse1.mdl”, [[The lowest member of society. All people see you laugh.
You have no home.
Beg for your food and money
Sing for everyone who passes to get money
Make your own wooden home somewhere in a corner or
outside someone else’s door]], {“weapon_bugbait”}, “hobo”, 5, 0, 0, false)
//No extra weapons say /hobo to become hobo Maximum hobo’s = 5 his salary = 0 because hobo’s don’t earn money. 0 = everyone can become hobo , false = you don’t have to vote to become hobo
// MAKE SURE THAT THERE IS NO / IN THE TEAM NAME OR IN THE TEAM COMMAND:
// TEAM_/DUDE IS WROOOOOONG !!!
// HAVING “/dude” IN THE COMMAND FIELD IS WROOOOOOOONG!!!
//ADD TEAMS UNDER THIS LINE:

TEAM_SWAT = AddExtraTeam(“S.W.A.T”, Color(51,102,102,255), “models/player/riot.mdl”, [[S.W.A.T Tactical Forces Unit. Very dangerious but very sweet job. Cleans the streets from high terror attacks. ]], {“weapon_mp52”, “weapon_fiveseven2”, “arrest_stick”, “door_ram”, “stunstick”, “unarrest_stick”, “weaponchecker”}, “swat”, 3, 75, 0, true)

TEAM_SWATCHIEF = AddExtraTeam(“S.W.A.T Chief”, Color(51,102,51,255), “models/player/urban.mdl”, [[S.W.A.T Tactical Forces Unit. Even sweeter and even more dangerious! Cleans the streets from high terror attacks. Oh yeah, you’re in charge! ]], {“arrest_stick”, “door_ram”, “stunstick”, “unarrest_stick”, “weapon_deagle2”, “weapon_m42”, “weapon_pumpshotgun2”, “weaponchecker”}, “swatchief”, 1, 85, 0, true)

TEAM_HITMAN = AddExtraTeam(“Hitman”, Color(153,0,255,255), “models/player/leet.mdl”, [[A Hitman, kills targeted people for money.
You are not a murderer, you get hired. You’re supposed
to be stealthy. This is not a RUN 'N GUN job.
]], {“lockpick”, “ls_sniper”, “weapon_p2282”}, “hitman”, 2, 50, 0, false)

TEAM_ARMY = AddExtraTeam(“Soldier”, Color(102,153,0,255), “models/player/dod_american.mdl”, [[Fights for freedom.
Cleans city streets from the highest terror attacks.
If any civilians are shot, demotion is imminent.
]], {“arrest_stick”, “door_ram”, “lockpick”, “med_kit”, “stunstick”, “unarrest_stick”, “weapon_deagle2”, “weapon_m42”, “weapon_mp52”, “weapon_pumpshotgun2”, “weapon_checker”}, “army”, 4, 75, 0, true)

TEAM_LARD = AddExtraTeam(“Fat Ass”, Color(255,0,102,255), “models/player/monk.mdl”, [[You’re a Fat Ass, you eat!
Go give cooks’ some money!
]], {“lockpick”}, “lard”, 5, 45, 0, false)

TEAM_TERRORIST = AddExtraTeam(“Terrorist”, Color(204,153,0,255), “models/player/phoenix.mdl”, [[Allah will be proud!
You are Terrorist, destroy the American Goverment!
You do not kill civilians!
]], {“door_ram”, “lockpick”, “stunstick”, “unarrest_stick”, “weapon_ak472”, “weapon_fiveseven2”}, “terrorist”, 4, 50, 0, true)

TEAM_SALESMAN = AddExtraTeam(“Salesman”, Color(51,204,255,255), “models/player/hostage/hostage_03.mdl”, [[Sell anything from props to cars, to houses!
Annoy the FUCK out of people by knocking on their doors to
buy your items.
]], {}, “salesman”, 4, 55, 0, false)

TEAM_ZOMBIE = AddExtraTeam(“Zombie”, Color(255,0,0,255), “models/player/classic.mdl”, [[Kill everyone.
Be a faggot.
]], {“bite”}, “zombie”, 10, 0, 0, true)

TEAM_NINJA = AddExtraTeam(“ninja”, Color(50, 50, 50, 180), “models/player/arctic.mdl”, [[Be a ninja, invade houses that don’t have roofs]], {“ninja_knife”, “grapplehook”, “talk”}, “ninja”, 1, 150, 0, true)
//
TEAM_MUTANT = AddExtraTeam(“Mutant”, Color(0, 0, 0, 255), “models/player/charple01.mdl”, [[A zombie obviously infected you.]], {“mutant_claw”}, “mutant”, 1, 80, 1, false)
//
TEAM_SWAT_SNIPER = AddExtraTeam(“Swat Sniper”, Color(51,53,23,255),“models/player/riot.mdl”, [[Be a sniper and help your team, but follow your leaders orders]], {“ls_sniper”,“weapon_glock2”, “talk”}, “sniper”, 1, 150, 0, true)
//
TEAM_SWAT_LEADER = AddExtraTeam(“Swat Leader”, Color(13,78,23,255),“models/player/swat.mdl”, [[Lead the S.W.A.T. Team and stop the terrorists, give your men the orders]], {“weapon_deagle2”, “weapon_pumpshotgun2”, “door_ram”, “stunstick”, “unarrest_stick”, “arrest_stick”, “taser”, “cse_eq_flashbang”, “cse_eq_hegrenade”,“talk”}, “leader”, 1, 200, 0, true)
//
TEAM_SAS = AddExtraTeam(“sas”, Color(34,34,83,255),“models/player/gasmask.mdl”, [[be a secret group and make plans…dont let them find you]], {“weapon_glock2”, “weapon_mp52”, “door_ram”, “stunsti ck”, “unarrest_stick”, “arrest_stick”, “taser”, “talk”}, “sas”, 3, 100, 0, true)
//
TEAM_SASLEADER = AddExtraTeam(“sasLeader”, Color(60,23,75,255),“models/player/gasmask.mdl”, [[Lead the secret group, make sure you dont get caught and make the plans]], {“weapon_deagle2”, “weapon_pumpshotgun2”, “door_ram” , “stunstick”, “unarrest_stick”, “talk”, “arrest_stick”, “taser”}, “sasleader”, 3, 100, 0, true)
//
TEAM_ASSASSIN = AddExtraTeam(“assassin”, Color(60,23,75,255),“models/player/Phoenix.mdl”, [[assassinate some people, make sure your not caught!!!]], {“assassins_Knife”, “talk”}, “assassin”, 2, 150, 1, false)
//
TEAM_PROSTITUTE = AddExtraTeam(“prostitute”, Color(255,100,100,255),“models/player/alyx.mdl”, [], {“taser”, “talk”}, “prostitute”, 2, 100, 1, false)

/*

HOW TO MAKE A DOOR GROUP

AddDoorGroup(“NAME OF THE GROUP HERE, you see this when looking at a door”, Team1, Team2, team3, team4, etc.)

WARNING: THE DOOR GROUPS HAVE TO BE UNDER THE TEAMS IN SHARED.LUA. IF THEY ARE NOT, IT MIGHT MUCK UP!

The default door groups, can also be used as examples:
*/
AddDoorGroup(“cops and mayor only”, TEAM_CHIEF, TEAM_POLICE, TEAM_MAYOR)
AddDoorGroup(“gundealer only”, TEAM_GUN)

/*

HOW TO MAKE An agenda

AddAgenda(Title of the agenda, Manager (who edits it), Listeners (the ones who just see and follow the agenda))

WARNING: THE AGENDAS HAVE TO BE UNDER THE TEAMS IN SHARED.LUA. IF THEY ARE NOT, IT MIGHT MUCK UP!

The default agenda’s, can also be used as examples:
*/
AddAgenda(“Gangster’s agenda”, TEAM_MOB, {TEAM_GANG})
AddAgenda(“Police agenda”, TEAM_MAYOR, {TEAM_CHIEF, TEAM_POLICE})

You just posted something completely irrelevant, is the word usergroup even in there?