Individual Weapon Restrictions v0.5
- Description -
This plugin restricts weapons on a per-player basis. All primary and secondary weapons are supported including all grenades; no shield support at this time. It saves all restrictions to the vault using the players SteamID as the key; if the player disconnects and rejoins, the restrictions will get re-applied. If a player purchases a weapon that is restricted, the players money spent on the restricted weapon will be reimbursed and the weapon gets deleted from game.
- Console Commands - - amx_restrictadd <partial name> <partial weapon> - Add a weapon restriction. Example: amx_restrictadd bugs gloc
- amx_restrictremove <partial name> <partial weapon> - Remove a weapon restriction. Example: amx_restrictremove bugs gloc
- amx_restrictclear <partial name> - Clears all weapon restrictions
- Chat Commands -- /restrict - Displays list of players restricted weapons
- Changelog - - v0.5
- Changed the way restrictions are stored. Instead of storing individual weapon restrictions with an array of integers for each player, they are now stored in a single integer using bit-flags to represent each weapon index.
- Added Ham_AddPlayerItem forward to detect when a player purchases a weapon. Adding this removed the need to monitor money transactions and the SetModel forward. When a restricted weapon is purchased we can block the player from ever receiving the weapon; the weapon will then be deleted and the players money is reimbursed.
- Forwards are now enabled\disabled so are only active when needed.
- Added weapon priority switching so if a player is carrying a weapon when a restriction is for it is added, the most powerful weapon will be set as current weapon. (from VENs real nade drop)
- This release is nearly a complete re-write
- v0.4
- Added notification of weapon restriction when purchased. Now displays name of weapon.
- Fixed bug where the removal of a restriction was not getting saved to vault
- v0.3
- Removed cstrike module and replaced with all fakemeta functions. Also removed WeapPickup, this is now handled in FM_Touch forward. Thanks to Exolent for tips on cleaning up the code.
Revision - Re-added WeapPickup because weapon was not getting dropped when purchased via buyscript in FM_Touch
- v0.2
- Cleaned up the code
- v0.1
- Fixed an error index out of bounds in fw_Touch.
328