- Allows players press Shift + R to switch between Primary Ammo and Upgraded Ammo.
- Allows players to carry both upgrade ammo types (Incendiary and Explosive).
- Both upgrade ammo types keep with the weapon when it's dropped.
- Upgraded ammo is carried over map transitions or restarts (only in coop/realism modes).
- This plugin was really complicated to write (6 re-writes) due to multiple ammo bug issues with the engine.
This plugin is incompatible with the following plugins:
- strikeraot - For tons of testing and the idea and request.
- Lux and MasterMind420 - For putting up with my rage while trying to figure out ammo bug issues.
- Toranks - Spanish translation.
- NoroHime - Chinese translations.
Saved to l4d2_switch_ammo.cfg
in your servers \left4dead\cfg\sourcemod\
// 0=Plugin off, 1=Plugin on.
// Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
// Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
// Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
// Allow swapping ammo on: 0=Neither. 1=Grenade Launcher. 2=M60. 3=Both.
// Display a hint when taking upgrade ammo about how to use the plugin. 0=Off. 1=Print to Chat. 2=Hint text.
// Which key combination to switch ammo. 1=Shift + Reload. 2=Holding Reload key.
// 0=Reload shotguns by emptying the clip when changing ammo types. 1=Shotguns will reload 1 bullet before the clip is full.
// Switch Ammo Types plugin version.
- Fixed not deleting 1 handle on plugin start.
- Fixed errors when late loading the plugin or enabling during gameplay. Thanks to "Proaxel" for reporting.
- Fixed the last update accidentally enabling unlimited usage of upgrade ammo piles and removing laser spawns. Thanks to "Proaxel" for reporting.
- Fixed the Grenade Launcher reloading in 3rd person being broken. Thanks to "Black_Wolf" for reporting.
- Fixed array out of bounds error. Thanks to "LindaFelicia" for reporting.
- Fixed errors thrown due to Special Infected being on Survivor team. Thanks to "Voevoda" for reporting.
- Fixed rare error about invalid entity. Thanks to "sonic155" for reporting.
- Fixed "Event_WeaponFire" errors when a Special Infected is on Survivor team. Thanks to "Voevoda" for reporting.
- Plugin now listens for the "upgrade_add" command for adding upgrade ammo.
- Plugin now switches to an upgraded ammo type if available, when stock ammo is depleted. Thanks to "swiftswing1" for reporting.
- Plugin now supports dynamic shotgun weapon clip sizes. Optionally uses Left4DHooks to detect clip size.
- Fixed invalid weapon error. Thanks to "NoroHime" for reporting.
- Now swaps ammo when holding the reload key when a clip isn't full and normal reloading has begun.
- Updated translations for holding reload key method of changing ammo.
- Thanks to "NoroHime" for updating the Chinese translations.
- Added cvar "l4d2_switch_ammo_keys" to control the key combination for reloading.
- Setting the cvar as "2" will allow holding Reload to change ammo. Requested by "sonic155".
- The source contains a "MAX_TIME_KEY_HOLD" define set at 0.5 which controls how long to hold reload.
- Moved "ammo_pickup" event hook to plugin start, to prevent errors throwing about no active hook.
- Added GameData file and new feature to reload the gun when changing ammo types. Requested by "Shao".
- Added cvar "l4d2_switch_ammo_guns" to control if the "Grenade Launcher" or "Rifle M60" ammo can be switched.
- Changed cvar "l4d2_switch_ammo_reload" to control if shotguns should reload the whole clip or 1 round.
- Now prevents swapping ammo until the weapon is ready to shoot.
- Thanks to "Shao" and "Toranks" for testing.
- Added cvar "l4d2_switch_ammo_reload" to wait for reloading to finish before switch ammo type. Requested by "Shao".
- Fixed a bug where you couldn't switch to stock ammo. Thanks to "Toranks" for reporting.
- Fixed invalid entity error. Thanks to "sonic155" for reporting.
- Fixed late loading (turning the plugin off and on again) from not detecting stock ammo when upgrade ammo is equipped.
- Fixed gaining ammo issue. Thanks to "Toranks" for reporting and testing.
- Weapon now switches to upgrade ammo if available when no stock ammo remains.
- Added Spanish translations. Thanks to "Toranks" for providing.
- Changes to fix warnings when compiling on SM 1.11.
- Now uses the new forward provided by "Save Weapon" plugin modified by "HarryPotter". Requires version "5.4" or newer.
- For compatibility with both plugins to work together. Thanks to "HarryPotter" for supporting.
- Supported plugin can be found here: https://github.com/fbef0102/L4D2-Plugins/tree/master/l4d2_ty_saveweapons
- Added support for "L4D2 coop save weapon" version by "HarryPotter".
- Removed support for [l4d2] Save Weapon (Co-op)" plugin by "maks".
- Changes to prevent giving upgraded ammo when someone respawns.
- Fixed not restoring map transitioned ammo on round restart. Thanks to "swiftswing1" for reporting.
- Fixed not saving ammo on map transition. Thanks to "swiftswing1" for reporting.
- Fixed the plugin breaking in modes other than coop. Thanks to "swiftswing1" for reporting and testing.
- Now automatically detects "[l4d2] Save Weapon (Co-op)" plugin by "maks" to fix giving upgrade ammo to players after map transition.
- Added cvar "l4d2_switch_ammo_hint" to display a message when taking upgrade ammo about how to use the plugin.
- Added file "switch_ammo.phrases.txt" to display hints.
- Fix for "[l4d2] Save Weapon (Co-op)" plugin by "maks". Thanks to "swiftswing1" for reporting.
- Fixed the last update accidentally enabling unlimited usage of upgrade ammo piles.
- Blocked the M60 and Grenade Launcher from being able to switch ammo types.
- Initial release.
Updating from 1.16 or older:
- Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
- Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.
- Download "translations.zip" and extract the "translations" folder to your servers \addons\sourcemod\ folder.
Updating from 1.17 or older:
- New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
- New translations have been added.
: English (en), Spanish (es), Simplified Chinese (chi), Traditional Chinese (zho).