Raised This Month: $ Target: $400
 0% 

[ANY][REQ] Restrict Commands by Target


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The_Hairy_Baboon
Junior Member
Join Date: Oct 2011
Old 05-08-2014 , 12:32   [ANY][REQ] Restrict Commands by Target
Reply With Quote #1

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.

Last edited by The_Hairy_Baboon; 05-08-2014 at 13:17.
The_Hairy_Baboon is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-08-2014 , 13:52   Re: [ANY][REQ] Restrict Commands by Target
Reply With Quote #2

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
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 05-08-2014 at 13:57.
friagram is offline
The_Hairy_Baboon
Junior Member
Join Date: Oct 2011
Old 05-08-2014 , 16:50   Re: [ANY][REQ] Restrict Commands by Target
Reply With Quote #3

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)
The_Hairy_Baboon is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-08-2014 , 20:03   Re: [ANY][REQ] Restrict Commands by Target
Reply With Quote #4

I discussed something similar here:

https://forums.alliedmods.net/showthread.php?t=240040
__________________
ddhoward is offline
The_Hairy_Baboon
Junior Member
Join Date: Oct 2011
Old 05-08-2014 , 20:46   Re: [ANY][REQ] Restrict Commands by Target
Reply With Quote #5

Quote:
Originally Posted by ddhoward View Post
I discussed something similar here:

https://forums.alliedmods.net/showthread.php?t=240040
it was your command cooldowns that made me think of that.

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.)
The_Hairy_Baboon is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 05-09-2014 , 08:38   Re: [ANY][REQ] Restrict Commands by Target
Reply With Quote #6

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.

Last edited by LambdaLambda; 05-09-2014 at 08:39.
LambdaLambda is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode