Restrict Commands [rc]
This plugin allows admin to restrict client commands from being used by players in their server. Using the in-game menu, you can restrict client commands for everyone server-wide and enable admin immunity if you want admin to be immuned from server-wide client command restrictions. There is also an admin console command to restrict client commands from use by players on an individual and permanent basis. Likewise, there is an admin console command to unrestrict an individual player from using a client command they have been individually restricted from using. The client commands which may be restricted are listed here in the form of <command>
- <description of command>:
- +attack - Fire
- +attack2 - Weapon special function (knife stab, silencer on/off, burst fire, zoom on sniper rifles)
- +reload - Reloads weapon
- +use - Uses an item (get hostages, defuse bomb, press buttons, etc.)
- buyequip - Brings up the buy equipment menu window
- chooseteam - Brings up the window to change teams
- cl_autobuy - Auto buys weapons set to auto buy
- cl_setautobuy - Sets weapons to auto buy and auto buys them
- coverme - Sends the "Cover Me!" radio message
- drop - Drops your current weapon
- enemydown - Sends the "Enemy Down!" radio message
- enemyspot - Sends the "Enemy Spotted!" radio message
- fallback - Sends the "Team, fall back!" radio message
- followme - Sends the "Follow Me!" radio message
- getinpos - Sends the "Get in position and wait for my go!" radio message
- getout - Sends the "Get out of there it's gonna blow!" radio message
- go - Sends the "Go! Go! Go!" radio message
- holdpos - Sends the "Hold this position!" radio message
- impulse 100 - Toggles flashlight on/off
- impulse 201 - Spray logo
- inposition - Sends the "I'm in position!" radio message
- lastinv - Last used weapon (switches to your last carried item in your inventory)
- needbackup - Sends the "Need Backup!" radio message
- negative - Sends the "Negative" radio message
- nightvision - Toggles nightvision on/off
- radio1 - Brings up the "Standard Radio Messages" menu
- radio2 - Brings up the "Group Radio Messages" menu
- radio3 - Brings up the "Report Radio Messages" menu
- regroup - Sends the "Regroup Team!" radio message
- report - Sends the "Report in team!" radio message
- reportingin - Sends the "Reporting In!" radio message
- roger - Sends the "Roger" and "Affirmitive" radio messages
- say - Chat message (mm1, public chat)
- say_team - Team message (mm2, team chat only)
- sectorclear - Sends the "Sector clear." radio message
- sticktog - Sends the "Stick together team!" radio message
- stormfront - Sends the "Team, storm the front!" radio message
- takepoint - Sends the "You take the point!" radio message
- takingfire - Sends the "Taking fire! Need assistance!" radio message
- weapon_knife - Used to switch to the knife (note: by dropping all weapons a person automatically switches to their knife no matter what)
- weapon_c4 - Used to switch to the C4 (bomb) (note: by dropping all other weapons and/or the bomb a player can then pick up the bomb from the ground in order to carry it no matter what)
By default, none of these client commands are restricted from any player to use. To restrict a command from use by every player server-wide, simply open console and type amx_rcmenu
or type /rcmenu
in chat. Those admin commands will bring up the Restrict Commands Configuration Menu. From there you will be able to turn restrictions ON or back OFF for any of the client commands listed above. There is also an admin immunity option on the menu which may be turned ON in order to allow admin to execute client commands which have been restricted server-wide. In addition, there is a help page you can access and view in-game which describes what each command does (exactly as listed above). To access this help page type /rchelp
in console or chat.
If you wish to restrict a client command on an individual basis for only one player, type amx_rcplayer <name or #userid> <command>
. To unrestrict a player from using a client command, type amx_unrcplayer <name or #userid> <command>
. For these admin commands to work, the <command> must valid and in the correct format. To view valid commands in the correct format, type amx_rccommands
in console (i. e. instead of typing amx_rcplayer Player +attack you must type amx_rcplayer Player attack and instead of typing amx_rcplayer Player impulse 201(or spray) you must type amx_rcplayer Player impulse201).
When using amx_rcplayer <name or #userid> <command>
, players are permanently restricted by STEAM ID from use of the client command they were restricted from using in the server until an admin unrestricts them by using amx_unrcplayer <name or #userid> <command>
. All information is stored in the vault. This may be used, for example, in the following way:
Originally Posted by Once upon a time...
Once upon a time there was a guy named Joe. This guy named Joe came in and sprayed a bad logo that you find offensive and otherwise inapropriate. You open console and type the following
amx_rcplayer Joe impulse201
Now Joe will never be able to spray his logo in your server on that STEAM ID ever again. You avoided needing to warn, kick, or ban Joe, and yet still are able to keep your server in order and enforce your server's rules. Everyone lives happily ever after in the world of CS. Yay!
To view current client commands a player is restricted from using, open console and type amx_rcinfo <name or #userid>
. This will list what client commands a player has been restricted from using in console.
Modules RequiredAdmin Commands
- <name or #userid> <command> - Restricts a player from using a client command permanently by STEAM ID
- <name or #userid> <command> - Unrestricts a player from using a client command they have been individually restricted from using
- Displays the list of valid client commands in the correct format to be used with amx_rcplayer and amx_unrcplayer
- <name or #userid> - Shows what commands a player has been restricted from using
- Brings up the Restrict Commands Configuration Menu
- Brings up the Restrict Commands Configuration Menu (just type /rcmenu in chat)
- Shows The Command Description Help Page (just type /rchelp in chat)
- Shows The Command Description Help Page
There are three ways of changing these CVARS
- Using the in-game menu
- Editing restrictcommands.cfg in the configs folder
- Executing <cvar> <cvar value> into the server command console (same as rcon <cvar> <cvar value> but doing it this third way will not save over through a map change).
It is recommended that you use the in-game menu because it is the easiest and most user-friendly.
Default for all CVARS is 0.
- 0: Admin Immunity for server-wide client command restrictions is turned off.
- 1: Admin with flag a, ADMIN_IMMUNITY, do have immunity from server-wide client command restrictions and can execute client commands even if they are restricted server-wide for other players.
Where <command> is you will see the actual name of the command. The following is true for all restrictcommand_<command> CVARS.
Restricting the command "<command>"
- 0: The client command "<command>" is not restricted server-wide.
- 1: The client command "<command>" is restricted server-wide.
Thanks to VEN for his help here
and devicenull for this post
he made about impulses.
- Curryking - German Translation
- Doombringer - Swedish Translation
- *<3* - Danish Translation
- dzek - Polish Translation
- P34nut - Dutch Translation
- Martin1 - Spanish Translation (awaiting final translation)
- commonbullet - Brazilian Portuguese Translation
- lubb - Bulgarian Translation (awaiting final translation)
Outside Credit: I used amxx_atac_cfg.sma version 1.1.06 written by f117bomb & T(+)rget as an outline for restrictcommandscfg.sma and give full credit to f117bomb & T(+)rget who wrote amxx_atac_cfg.sma version 1.1.06 for the code I used as an example when writing restrictcommandscfg.sma.
[ATAC] Plugin URL = http://forums.alliedmods.net/showthread.php?p=157579
The idea came from my desire to have complete control over what goes on in my server and further enforce fair server rules where deemed necessary to do so. I am happy to see this plugin grow and with the extensive testing I've done in CS 1.6 using AMX Mod X 1.71, with many people in the server, I am happy to say that version 1.9 works at 100% proficiency with no problems whatsoever. A big thanks to all my friends who stayed in the server for hours testing and retesting the plugin until they were blue in the face; thanx for bearing with me as I perfected version 1.9 for its public release.
- Changed instances of #define macros for strings to new const string variables. Changed instances of format to formatex. Changed instances of cvar natives to pcvar natives. These minor coding changes increase the speed of the plugin significantly and I recommend that people using a lower version update to this version to benefit from this increase in performance.
- Added nVault native nvault_remove in order to remove the key upon use of amx_unrcplayer. This will save space used in the vault to only that which is necessary. This update requires the use of AMX Mod X 1.75 or above.
- Added nVault natives in order to make the individual restriction of client commands from players' use permanent via STEAM ID. Did extensive testing and a few "touch ups" on a line or two of code for the sake of consistency. Rewrote the commands descriptions page to be a bit easier to read for users.
- Added commands amx_rcplayer, amx_unrcplayer, amx_rcinfo, and amx_rccommands.
- Shortened code by using additional stock functions. Combined remaining cvars into the array. Recoded a few things to be a bit more concise. Cut coding size by 50 lines.
- Arranged all cvars related to clcmd's into an array. Reduced all pcvar stock lines down to only one line. Cut coding size by 60 lines.
- Arranged all clcmd's into an array. Reduced all clcmd hook functions down to only one function. Cut coding size in half.
- Removed an unnecessary file by reorganizing the coding. Mostly polishing up of 1.3.
- Added flag FCVAR_SERVER to CVAR restrictcommands_version and restrictcommandscfg_version.
- Added commands impulse 100 (flashlight) and impulse 201 (spray) to the list.
- Cleaned up the code to make it more concise.