Raised This Month: $12 Target: $400
 3% 

Command Restrictions


Post New Thread Reply   
 
Thread Tools Display Modes
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 03-18-2020 , 19:00   Re: Command Restrictions
Reply With Quote #11

Hmm, wonder if I can use this and integrate it into discord. Great plugin
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
lantimilan
Senior Member
Join Date: May 2016
Old 03-20-2020 , 03:25   Re: Command Restrictions
Reply With Quote #12

Best Plugin thanks OciXCrom ;)
lantimilan is offline
Send a message via MSN to lantimilan
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-22-2020 , 09:31   Re: Command Restrictions
Reply With Quote #13


  • Added an option to make commands available only during specific maps, e.g. "de_dust2" or "de_*" for map prefixes.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-26-2020 , 08:04   Re: Command Restrictions
Reply With Quote #14

@HamletEagle - could you please review?


  • Changed the way the plugin reads restrictions from the configuration file.
    • Instead of stopping the checks at the first "block" <status>, the plugin will keep reading until it reaches the last restriction for the command. This means restrictions are read 1 by 1, from top to bottom, meaning that those that are below have priority over the ones above them. For example, if you have a "block" condition in the first line and "allow" on the second - the "allow" condition will grant access to the command if the condition is true.
      Code:
      [amx_my_command]
      block all
      allow name "OciXCrom" // if this condition is true, the player will get access to the command
  • Added 2 new <status> types - "pass" and "stop".
    • Since conditions are read 1 by 1, if you use "pass" or "stop", the plugin will stop reading all remaining conditions if the given "pass" or "stop" condition is true. This means that the player will directly get access (pass) or be denied access (stop) from the command, ignoring all following conditions.
      Code:
      [amx_my_command]
      pass name "OciXCrom" // if this condition is true, the player will get access to the command and all conditions down below will be ignored
      block all
      allow team "ct"
      allow map "de_*"
      stop time "23:00-5:00" // if this condition is true, the player will be denied access to the command and all conditions down below will be ignored
      allow flags "mno"
  • Added a new restriction "anyflag" that allows you to target players who have AT LEAST ONE of the given flags, unlike "flags" that requires ALL of the given flags.
  • Added a new restriction "score" that allows you to target players who have reached a certain amount of score in the scoreboard (TAB).
  • Added support for OciXCrom's Rank System - you can now make commands available for players who have reached a certain level or amount of XP in the rank system. For that purpose, 2 new restriction types have been added - "level" and "xp". If you aren't using my rank system, you won't be able to use these restrictions. If you are using it, they will automatically become available for you to use in the configuration file.
  • Added support for CSStats. You can now make commands available for players who have reached a certain position in top15, etc. For that purpose, the following restriction types have been added:
    • rank - targets players based on their rank in CSStats (only available in Counter-Strike)
    • kills - targets players based on their number of kills in CSStats (only available in Counter-Strike)
    • deaths - targets players based on their number of deaths in CSStats (only available in Counter-Strike)
    • headshots - targets players based on their number of headshots in CSStats (only available in Counter-Strike)
  • Using the plugin in a game different than Counter-Strike no longer requires editing the .sma file. It's now automatic.
  • The styling of the configuration file has been completely changed in order to make it easier to read. I recommend updating it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
oldies
Junior Member
Join Date: Apr 2020
Old 04-23-2020 , 14:39   Re: Command Restrictions
Reply With Quote #15

Hi, i am directed here from Custom permissions for admins or mods Post

what i want to do is to Allow admins or mod to have access some commands like
Code:
//restart
amx_cvar sv_restartround 10

//Freeze Time
amx_cvar mp_freezetime 0

//Map Change
amx_map de_dust

//Map Time Limit
amx_cvar mp_timelimit 25

//Round Limit
amx_cvar mp_roundtime 2.5 

Etc.
i see example no 6 is fine for me but i do not want to give time, it should have no time limit, how code should be? if i delete allow time section would it enough?
[*]Example #6 - allowing usage of "votemap" commands only during the night
  • [amx_votemap, amx_votemapmenu]
  • block all "" "You can vote for a map only during the night."
  • allow time "23:00 - 5:00"
[/list]
oldies is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-23-2020 , 15:49   Re: Command Restrictions
Reply With Quote #16

The file is full of examples. Nobody said you should leave them there or that you must use the timelimit feature. Please read the documentation in the file itself to understand how it works. There's no reason for me to copy/paste it here.

I don't know what an "admin" or "mod" is, neither does the plugin. Please use one of the methods available to define those users.

PS: those are cvars, not commands. The command is "amx_cvar". The plugin doesn't have an option to check for command arguments.
__________________

Last edited by OciXCrom; 04-23-2020 at 15:50.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
oldies
Junior Member
Join Date: Apr 2020
Old 04-23-2020 , 18:16   Re: Command Restrictions
Reply With Quote #17

Quote:
Originally Posted by OciXCrom View Post
The file is full of examples. Nobody said you should leave them there or that you must use the timelimit feature. Please read the documentation in the file itself to understand how it works. There's no reason for me to copy/paste it here.

I don't know what an "admin" or "mod" is, neither does the plugin. Please use one of the methods available to define those users.

PS: those are cvars, not commands. The command is "amx_cvar". The plugin doesn't have an option to check for command arguments.
examples in the file are limited, i could not find the one which suits to me, i am not a programmer, i am just an ordinary guy, it would be nice if you give the code example i asked. and there is no instructions in the plugin, what i am going to do with crx_command_restrictions.sma and cromchat.inc files ? and if i use mp_freezetime with amx_cvar like "amx_cvar mp_freezetime 0" is not this a command?

I am lost, let me startover;
i want to give some permissions to a user, user will be limited with the permissions given to him, those permissions are; he can restart round, he can change map, he can start voting (for map only if possible), he can change map time limit, he can change round time, etc etc. but he should do this without a time schedule, he can do these any time he wants. if possible with custom flag like "8", so if the guy has flag "8" can do these all, can you or someone help me?
i liked this plugin only i need how to use it?

Last edited by oldies; 04-23-2020 at 18:21.
oldies is offline
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
oldies
Junior Member
Join Date: Apr 2020
Old 04-23-2020 , 21:05   Re: Command Restrictions
Reply With Quote #19

Quote:
Originally Posted by OciXCrom View Post
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.
Thank you very much for details, i will try and let you know about it , the thing i do not know is the compiling but i will figure it out.
oldies is offline
oldies
Junior Member
Join Date: Apr 2020
Old 04-23-2020 , 21:34   Re: Command Restrictions
Reply With Quote #20

Quote:
Originally Posted by oldies View Post
Thank you very much for details, i will try and let you know about it , the thing i do not know is the compiling but i will figure it out.
when i try to compile it with compile.exe, i receive an error;

oldies 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 13:06.


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