General > Developers Corner

Adduser Command

(1/2) > >>

Wrath:
Hi, before I begin, I'd like to apologize if this is in the wrong section or has already been asked. I have used to search feature to look for a similar thread, but I was unable to find anything.

Anyway, I was looking for a command that would add a user to a specific group. For example, I want a command called 'ulx addadmin' and this command could be used to change a user to the Admin user group. Of course, I know ULX already has a 'ulx adduser' command, but this is a bit different. I have looked at the code, but I wasn't sure what to change to suit my needs. Thanks for anyone who is able to help!

Megiddo:
What's the underlying reason? Are you looking to restrict people to only being able to promote users to certain groups? If so, you can just restrict them using the permission system.

Wrath:

--- Quote from: Megiddo on November 28, 2014, 11:35:55 AM ---What's the underlying reason? Are you looking to restrict people to only being able to promote users to certain groups? If so, you can just restrict them using the permission system.

--- End quote ---
Oh, I was unaware of that. Thanks!

Wrath:
It's been a while since I've owned a Gmod server. Please refresh my memory on how to restrict this command? Thanks. xD

Bite That Apple:

--- Quote from: Wrath on December 05, 2014, 07:20:27 PM ---It's been a while since I've owned a Gmod server. Please refresh my memory on how to restrict this command? Thanks. xD

--- End quote ---

Well, from what I understand he's saying you can restrict certain groups from being allowed to promoted in ulx adduser, but as far as I know that's not possible. Though I'm going to check again, but I've never seen anything like that before. I know some commands can be restricted when you click on them, and another box opens on the right, but I'll get back to you if he doesn't first.

Edit:
Actually, after further inquiry, I found that you can restrict (whitelist)  adduser. So this is how you do it, !menu -> Groups, so in there you then select a group that you want to be able to give adduser to w/e they want another player to do. Then you click "Restrict Group" and add the name of a group you want that selected group to be able to addusers to. So because I may have not explained it correctly, I'll say an example.

Lets say I have five groups (from least power to most power): Regular -> Senior -> Moderator -> Administrator -> Super Administrator
So lets say you want Moderators to be able to adduser to Senior, but not to be able to add users to Admin or Super admin usergroup, you then select Moderator group, click under "Manage Permissions", then find "Cmds - User Management", then turn on ulx adduser for the Moderator usergroup. Now that its on, click (or highlight) the actual command, and a new box will appear on the right, saying "Restrict Group", turn that on, and type the name "Senior" (when I say name, I also mean the actual group name, not the team name), then click "Add". Then we repeat, and do the same thing for "Regular", so when you're done, you should see in the "Whitelist String Value", two names, one being; "Senior", and the other being "Regular", if you see that, then you can hit "Apply Restrictions".

If you've done that all correctly, Moderator should only be able to add any user who is not above their rank, to any rank below theirs.

Navigation

[0] Message Index

[#] Next page

Go to full version