View Single Post
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-23-2020 , 18:53   Re: Command Restrictions
Reply With Quote #18

You install the plugin like any other. The .inc file is there so you can compile the .sma file. Please do some research on how to compile plugins because this is something very basic that you must know in order to even add a plugin.

After you add the plugin, the only file you need to worry about is CommandRestrictions.ini. This is where you can customize commands usage. There is an explanation on how to use it in the first post in this thread, as well as the file itself.

You can make a command available for a specific user based on his name, SteamID, IP address, admin flags, team etc. All of these "methods" are documented in the file in a very organized manner.

Imagine the file like this - you add a command in it, and below it you can add a set of restrictions for that command's usage. The plugin will check those restrictions 1 by 1 and will decide whether or not the player who issued the command will have access to it.

For example, if you want to make the "amx_map" command available only for the player named "oldies", you would write the following in the file:

Code:
[amx_map]
block all
allow name "oldies"
Here you added 2 rules for the command.
1. Block access to the command for everyone.
2. Allow access to the command for the player named "oldies".

The plugin reads these rules from top to bottom, meaning that first it will read the "block all" rule which tells it to deny access to this command for everyone. Next, it will read the second rule "allow name oldies", meaning that if the player who used the command is named "oldies", it will decide to grant access to that player.

Of course, you can have as many rules as you want. You can even limit the commands only for specific maps, time periods, etc. All the details are in the file.

What you need to have in mind is what is a command and what isn't. From your previous post, "amx_cvar" is the command, not the values after it, so you can only apply the rules for the whole command, not parts of it.

Try to set things up and post what you've done if you're having difficulties.
__________________

Last edited by OciXCrom; 04-23-2020 at 18:57.
OciXCrom is offline
Send a message via Skype™ to OciXCrom