[ANY][REQ] Restrict Commands by Target
Hi, I've noticed that some plugins people write have two versions of the same command, one that can only be used on one's self, and another that can be used on anyone. This allows you to give say donators access to use the command on themselves, but only proper admins the ability to use the command on anyone.
What I'd like to have is a plugin that allows me to separate the usage of a single command depending on the flag. For example, sm_noclip. Ideally Donators could just use it on themselves, and admin can toggle it on anyone. If donators have a "d" flag and admin have the "a" flag, then if a Donator (name of "Joe") typed sm_noclip Joe, it would toggle on Joe, but if he tried sm_noclip Henry (a regular player), it would not toggle henry, it would either return saying you can't toggle on others, or it would toggle on Joe. But the admin "Bob" could do sm_noclip Henry (and Henry would toggle), or sm_noclip Bob, and Bob would toggle. Restricting who it could be used on would be based off the @ targeting groups here: https://wiki.alliedmods.net/Admin_Co...#How_to_Target Does this seem possible? It'd be a lot nicer to have this than the have to modify a bunch of different plugins. |
Re: [ANY][REQ] Restrict Commands by Target
It's possible, and to some point built into sourcemod's adminmenu custom by having the server execute commands rather than the client.
Unfortunately you can't easily use targeting, since there is no way to override command access (you can't give access to donators to use sm_noclip, but then prevent them from using @all), at least not without doing some weird stuff like setting immunity levels. Also, its not guaranteed all plugins will even use proccesstargetstring. If you want it to work for non-armins, you 'll need something written that allows donators and the like to access it. And you'll probably have to pay someone to make it for you, unless there is a public version of the like out there :3 |
Re: [ANY][REQ] Restrict Commands by Target
So I could make a custom admin menu to execute the commands, but still if someone knew the actual command, they could use it on anyone because there's no restriction to using a command through menu only.
That's what I was thinking, that the current structure would not really facilitate having that type of control. I'm not so desperate for it that i'd be willing to pay, but if someone wants to take a shot at it, that would be appreciated. (maybe even work it into sourcemod in general) |
Re: [ANY][REQ] Restrict Commands by Target
|
Re: [ANY][REQ] Restrict Commands by Target
Quote:
For that guy's bug report, I was thinking similar, except the @ targets would just be used for the logic, not a restriction. In that if you restrict someone to only @blue, then a person could not use the command on anyone on the red team, even if they themselves are on red. (i would also add a @team which restricts use to only people on whatever side you are on.) |
Re: [ANY][REQ] Restrict Commands by Target
this can be done with simple plugin. Example of how its going to work:
*. you put to cfg what command should be override, for what flags *. plugin is getting this KV from KV file *. while player types cmd, then plugin is checking his admin flags. If flag he has is restricked, then cmd is called with FakeClientCommand() including his name. Otherwise it's not doing anything. |
| All times are GMT -4. The time now is 04:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.