Raised This Month: $193 Target: $400
 48% 

Restrict Commands [rc] - v2.1 - 2006-07-24


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   Freecode (7)
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-14-2006 , 15:59   Restrict Commands [rc] - v2.1 - 2006-07-24
Reply With Quote #1

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:

Quote:
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.

Installation

File Locations:
  • .\configs\restrictcommands.cfg
  • .\data\lang\restrictcommands.txt
  • .\data\lang\restrictcommandscfg.txt
  • .\plugins\restrictcommands.amxx
  • .\plugins\restrictcommandscfg.amxx
Modules Required
  • engine
  • nVault
Admin Commands

amx_rcplayer - <name or #userid> <command> - Restricts a player from using a client command permanently by STEAM ID
amx_unrcplayer - <name or #userid> <command> - Unrestricts a player from using a client command they have been individually restricted from using
amx_rccommands - Displays the list of valid client commands in the correct format to be used with amx_rcplayer and amx_unrcplayer
amx_rcinfo - <name or #userid> - Shows what commands a player has been restricted from using
amx_rcmenu - Brings up the Restrict Commands Configuration Menu
say /rcmenu - Brings up the Restrict Commands Configuration Menu (just type /rcmenu in chat)
say /rchelp - Shows The Command Description Help Page (just type /rchelp in chat)
/rchelp - Shows The Command Description Help Page

Plugin CVARS

Note:
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.

restrictcommand_immunity <0|1>
Admin Immunity
  • 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.

restrictcommand_<command> <0|1>
Restricting the command "<command>"
  • 0: The client command "<command>" is not restricted server-wide.
  • 1: The client command "<command>" is restricted server-wide.

Credits/Thanks
Thanks to VEN for his help here and devicenull for this post he made about impulses.

Translations:
  • 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.

Plugin History

[2006-07-24] v2.1
  • 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.
[2006-07-01] v2.0
  • 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.
[2006-06-20] v1.9
  • 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.
[2006-05-31] v1.8
  • Added commands amx_rcplayer, amx_unrcplayer, amx_rcinfo, and amx_rccommands.
[2006-05-24] v1.7
  • 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.
[2006-05-23] v1.6
  • 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.
[2006-05-22] v1.5
  • Arranged all clcmd's into an array. Reduced all clcmd hook functions down to only one function. Cut coding size in half.
[2006-05-10] v1.4
  • Removed an unnecessary file by reorganizing the coding. Mostly polishing up of 1.3.
[2006-04-20] v1.3
  • Added flag FCVAR_SERVER to CVAR restrictcommands_version and restrictcommandscfg_version.
[2006-04-18] v1.2
  • Added commands impulse 100 (flashlight) and impulse 201 (spray) to the list.
[2006-04-17] v1.1
  • Cleaned up the code to make it more concise.
[2006-04-14] v1.0
  • Initial release.
Attached Files
File Type: sma Get Plugin or Get Source (restrictcommands.sma - 3479 views - 14.1 KB)
File Type: sma Get Plugin or Get Source (restrictcommandscfg.sma - 2893 views - 24.5 KB)
File Type: zip restrictcommands.zip (42.0 KB, 2636 views)

Last edited by SubStream; 06-10-2007 at 12:10. Reason: Updating translations
SubStream is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-14-2006 , 16:02   eeeee
Reply With Quote #2

Ahhhhhh stop releasing code that is so redundant within the plugin.

You have good ideas but your code can be simplified so much.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-14-2006 , 16:06  
Reply With Quote #3

Edit: There clearly is no redundant code within the plugin anymore. Just thought I'd update that fact for everyone.
SubStream is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-14-2006 , 16:11  
Reply With Quote #4

-EDITED-
Deviance is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-14-2006 , 16:15  
Reply With Quote #5

Thank you Doombringer I haven't gotten the translation thread up yet. It will be up soon.

Edit: Translation Topic is posted

URL = http://forums.alliedmods.net/showthread.php?t=27091
SubStream is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-14-2006 , 16:24  
Reply With Quote #6

Quote:
Originally Posted by SubStream
Thank you Doombringer I haven't gotten the translation thread up yet. It will be up soon.
anytime, man ;)
btw, useful plugin xD

happy now? =)
Deviance is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-17-2006 , 15:14  
Reply With Quote #7

Edited
SubStream is offline
techwg
Senior Member
Join Date: Dec 2005
Old 04-17-2006 , 18:20  
Reply With Quote #8

[ 59] unknown unknown unknown restrictcommand bad load
Load fails: Plugin uses an unknown function (name "get_pcvar_num") - check your modules.ini.
__________________
techwg is offline
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 04-17-2006 , 19:00  
Reply With Quote #9

Quote:
Originally Posted by techwg
[ 59] unknown unknown unknown restrictcommand bad load
Load fails: Plugin uses an unknown function (name "get_pcvar_num") - check your modules.ini.
you need at least amxx 1.70, thats when cvar pointers were added
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
techwg
Senior Member
Join Date: Dec 2005
Old 04-18-2006 , 04:02  
Reply With Quote #10

on our true server i have 1.7

I tried to get 1.71 to work on my home pc to test this plugin and it will not load. i have tried allsorts. I even deleted the whole server and started it from scratch and still nothing (yes i added the cs mod part of it)


meta list
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] <amxmodx_mm.dll badf load amxmodx_mm.dll v - ini Never Never
[ 2] POD-Bot mm RUN - podbot_mm.dll vR2b46d ini Chlvl ANY
[ 3] Eye1.2 Metamod RUN - eye_mm.dll v1.2 ini Chlvl Chlvl
[ 4] Ent Mod RUN - entmod_mm.dll v3 ini Start Start
[ 5] Adminmod RUN - admin_mm.dll v2.50.60 ini Start ANY
[ 6] LogDaemon RUN - logd_mm.dll v1.0.0.6 ini ANY Pause
6 plugins, 5 running


[EDIT] HAR HAR bloody har . . . i figured it out my copy of the server was PRE 1.7 . . . ie old crappy ass metamod original ancient . . i get latest metamod-p and Boom it all works!! ok great plugin just got done tstoing it.. i am going to add this to the server. One more thing, can you add other commands to the list at all ? how about name
__________________
techwg 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 01:28.


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