This plugin was designed and tested for use on Counter-Strike: Source. It uses some of the SDK Calls that teame06 wrote for GunGame: Source, and would not have been possible without the help of teame06, BAILOPAN, pRed, Tsunami, and many others who idle #sourcemod.
If you have any questions or find any issues, please let me know either here or in #sourcemod on irc.gamesurge.net.
Instructions for installation:
Download and unzip the attached file. The zip file has been designed to mimic the structure of a standard srcds installation, and all files are in their correct places.
I've expanded this out to use a translations file, a gamedata file, and two config files, so make sure you check the file contents before just dropping it in, or you will have trouble.
This requires the latest version of the 1.0.3 Sourcemod snapshot.
sm_restrict <weapon|group> <amount|default=0> <all=default|ct|t>
sm_unrestrict <weapon|group> <all=default|ct|t>
sm_addgroup <"group name"> <"weapon_one weapon_two weapon_three">
-If you want to setup "static" groups, you will need to add the command to either server.cfg or restrict_weapons.cfg in the above format.
-Ex. sm_addgroup "pistols" "glock p228 deagle"
Valid weapons are:
"glock", "usp", "p228", "deagle",
"elite", "fiveseven", "m3", "xm1014",
"galil", "ak47", "scout", "sg552",
"awp", "g3sg1", "famas", "m4a1",
"aug", "sg550", "mac10", "tmp",
"mp5navy", "ump45", "p90", "m249",
"flashbang", "hegrenade", "smokegrenade", "c4"
Version 3.1 will include the following:
--Totally rewrote the array setup for the restrictions.
--Allowed the weapon restrictions to differ by team.
--Added knives, pistols, and single-weapon round commands.
--Modified unrestrict to allow all unrestrictions.
--Added in restrict_weapons.cfg for the cfg\sourcemod for weapon\cvar management.
--Rewrote all of the checks to be more efficient and faster.
--Fixed a small problem in the g_ShortWeaponNames array.
--Fixed a small problem in the g_WeaponNames array.
--Added an additional check into the Command_Restrict function to send a message to the client/console and to also add a log to the error log with what was wrong.
--Rewrote plugin from scratch to greatly improve efficiency and speed.
--Added a public tracking cvar.
--Repaired all bugs with weapons not being properly restricted.
--Removed teame06's hack system.
--Added checks to grab on round start, weapon_pickup, and weapon_fire.
--Weapons refund money only on weapon_fire and if they are carrying it when restricted.
--Fixed the version number in the plugin.
--Added a warmup system
--Exported warmup configs out to addmons\sourcemod\configs
--Exported restriction configs out to cfg\sourcemod
--Added a warmup cvar (g_Cvar_Warmup) so the warmup system is trackable for external plugins
--Added sm_dropc4 for use on de_* maps
--Added DropC4 to the Server Commands menu
--Added Restrict Weapons to the Server Commands menu
--Added cvars to handle all global weaon configs
--Added cvars to handle warmup system
--Exported all cvars to a single cfg file located in cfg/sourcemod
--Added functions to watch the cvars and make changes as necessary
--Fixed a bug in the cVar / cfg system
--Fixed the issue with the cVars not restricting weapons properly on initial load.
--Added sm_unrestrict all option. (sm_restrict <all|weapon> <all|team>)
--Corrected the missing bracket in the code.
--Added the polish translations. Thanks Zuko!
--Added in additional cVars for weapon management.
--Corrected the typo in the warmup cvar that had you set it to 2 to disable it. Should have been 0. Warmup disables without any issue.
--Fixed the issue with weapons not restricting from the cfg file correctly.
--Corrected issues with it not granting a valid weapon when one was restricted. (If you restrict them all, yes, they will walk around without a weapon.)
--Corrected the bug in the warmup system.
--Added a define in the code to remove the menu system from the compiled file. #define STOCK_MENUS 1, set to 0 to remove all menu functionality.
--Added in checking for 'shorthand bind commands'.
--Fixed a bug in the he/smoke/flashbang restrictions.
--Fixed issues with restrictions not working correctly.
--Corrected a bug where warmup wouldn't disable on first run of the plugin.
--Fixed issues with it not removing restricted weapons from the world either on start or on drop.
--Fixed issues with restrictions set in the cfg not parsing over map changes. (Thanks to Derek for pointing this out.)
--Cleaned up the ConVar code a bit to make restrict.sp more organized.
--Added group restrictions for weapons
--Added sm_addgroup command
--Added sm_grouplist command
--Corrected a bug where it was stripping guns from teams who were not being restricted.
--Cleaned up the weapon swap code to be faster and more efficient.
--Cleaned up the core code to be more readable and organized
--Corrected the bug in the warmup system where it wasn't stripping the starting weapons.
--Rewrote the group restrict system to set the entire groups limit to a
number. Ie. Group: "Test" contains "m4a1 ak47 p90" and is restricted to
1. Only one m4a1, ak47, or p90 may be used. Any attempt to buy or
pickup another weapon in that group will result in failure.
--Corrected a bug in the weapon group buy code.
--Changed the warmup config file format. Please replace or update yours correctly.
--Changed the translation file format. Please replace yours with the one included.
--Fixed a typo in the translation file format.
--sm_knife and sm_pistols
--team based restrictions in menu
As always, when uploading this plugin, please -restart- your counter-strike server so that all old bad cvar values are nixed.
Please let me know if you experience any issues.