View Single Post
Author Message
MasterMind420
BANNED
Join Date: Nov 2010
Old 08-20-2016 , 11:16   [L4D2] Improved Prevent M60 Drop
Reply With Quote #1

Firstly thanks to DeathChaos for allowing me to take over his plugin, secondly thanks to AtomicStryker for his GunControl plugin which i've also learned alot from. Thirdly thanks to Lux for all his coding guidance which has helped me become a better coder.

Without further delay I give to you [L4D2] Improved Prevent M60 Drop.
Prevents the m60 from dropping when reaching 0 ammo and allows changing clip and reserve ammo.

M60 utilizing upgraded ammo packs give wrong ammo count with more than 1 clip.
Fixed by modifying AtomicStryker's GunControl to only allow 1 clip for m60 only.
Other weapons will use the clip count set in the config for upgraded ammo clips.

Code:
---VERSION 1.1---
Complete rewrite thanks to ludastar's suggestions the code is better optimized.
Changed OnPlayerRunCmd to Event weapon_fire, which seems to work better.

---VERSION 1.2---
Rewrote and cleaned up code using new syntax
Removed dependency on GunControl plugin
Added upgrade pack ammo fix(1 clip only)
Added code to allow reloading at ammo piles

---VERSION 1.3---
Added ammo reload notification thru chat or hint
Moved ammo pile reload code to ammo_pile_weapon_cant_use_ammo event(more efficient)

---VERSION 1.4---
Converted to new syntax
Changed reload code back to player use, can reload from any weapon(thanks ngBuckWangs)

---VERSION 1.5---
Properly converted to new syntax
Corrected a mistake which caused ammo locking to effect other weapons

---VERSION 1.6---
Ammo issues should be fixed.

---VERSION 1.7---
Removed redundant code.
Reworked ammo pile code to work more naturally.
Fixed bug when reloading at ammo piles current clip would flow into reserve ammo (Shao).
-MY PLUGINS-
Auto Thirdperson Melee v1.6 - https://forums.alliedmods.net/showthread.php?t=282543
Pistol Reloading v1.0 - https://forums.alliedmods.net/showthread.php?t=286695

Last edited by DarkDeviL; 10-18-2021 at 09:03. Reason: Restore to previous version.
MasterMind420 is offline