Raised This Month: $10 Target: $400
 2% 

[L4D2] Switch Upgrade Ammo Types (1.9) [15-Sep-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7163
Plugin Version:
1.9
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    35 
    Plugin Description:
    Switch between normal bullets and upgraded ammo types.
    Old 06-16-2020 , 02:19   [L4D2] Switch Upgrade Ammo Types (1.9) [15-Sep-2021]
    Reply With Quote #1

    About:
    • 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 (5 re-writes) due to multiple ammo bug issues with the engine.


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



    CVars:

    Saved to l4d2_switch_ammo.cfg in your servers \left4dead\cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_switch_ammo_allow "1"

    // Display a hint when taking upgrade ammo about how to use the plugin. 0=Off. 1=Print to Chat. 2=Hint text.
    l4d2_switch_ammo_hint "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_switch_ammo_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d2_switch_ammo_modes_off ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_switch_ammo_modes_tog "0"

    // Switch Ammo Types plugin version.
    l4d2_switch_ammo_version 


    Changes:
    Code:
    1.9 (15-Sep-2021)
        - 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
    
    1.8 (13-Sep-2021)
        - 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.
    
    1.7 (12-Sep-2021)
        - Fixed not restoring map transitioned ammo on round restart. Thanks to "swiftswing1" for reporting.
    
    1.6 (11-Sep-2021)
        - Fixed not saving ammo on map transition. Thanks to "swiftswing1" for reporting.
    
    1.5 (30-Aug-2021)
        - Fixed the plugin breaking in modes other than coop. Thanks to "swiftswing1" for reporting and testing.
    
    1.4 (17-Aug-2021)
        - Now automatically detects "[l4d2] Save Weapon (Co-op)" plugin by "maks" to fix giving upgrade ammo to players after map transition.
    
    1.3 (15-Aug-2021)
        - 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.
    
    1.2 (21-Aug-2020)
        - Fixed the last update accidentally enabling unlimited usage of upgrade ammo piles.
    
    1.1 (18-Aug-2020)
        - Blocked the M60 and Grenade Launcher from being able to switch ammo types.
    
    1.0 (16-Jun-2020)
        - Initial release.


    Installation:
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Download "translations.zip" and extract the "translations" folder to your servers \addons\sourcemod\ folder.

    Updating from 1.2 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.

    Current Translations: English (en), Traditional Chinese (zho).
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_switch_ammo.sp - 120 views - 25.4 KB)
    File Type: zip translations.zip (986 Bytes, 55 views)
    __________________

    Last edited by Silvers; 09-15-2021 at 08:31.
    Silvers is offline
    sonic155
    Senior Member
    Join Date: Mar 2019
    Old 06-16-2020 , 07:29   Re: [L4D2] Switch Upgrade Ammo Types (1.0) [16-Jun-2020]
    Reply With Quote #2

    testing =)
    ~
    tested =D

    test video up =) " https://www.youtube.com/watch?v=SDUXU08P2Gc "
    your welcome to use the video as a demonstration if you want =)

    Last edited by sonic155; 06-16-2020 at 08:37. Reason: update / adding youtube video
    sonic155 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-16-2020 , 12:23   Re: [L4D2] Switch Upgrade Ammo Types (1.0) [16-Jun-2020]
    Reply With Quote #3

    Thanks for the video. Did you notice any issues? Haven't watched it all yet.

    Looks like M60 and probably Grenade Launcher still have bugs using it. I might have to block them entirely because I'm sick of spending hours trying to fix these stupid ammo bugs. Lucky I even managed to finish the plugin as is. Come to think of it... that issue might be present with all weapons when they have no more reserve ammo and only down to the last clip. Oof. FML.
    __________________

    Last edited by Silvers; 06-16-2020 at 12:23.
    Silvers is offline
    sonic155
    Senior Member
    Join Date: Mar 2019
    Old 06-16-2020 , 12:40   Re: [L4D2] Switch Upgrade Ammo Types (1.0) [16-Jun-2020]
    Reply With Quote #4

    Quote:
    Originally Posted by Silvers View Post
    Thanks for the video. Did you notice any issues? Haven't watched it all yet.

    Looks like M60 and probably Grenade Launcher still have bugs using it. I might have to block them entirely because I'm sick of spending hours trying to fix these stupid ammo bugs. Lucky I even managed to finish the plugin as is. Come to think of it... that issue might be present with all weapons when they have no more reserve ammo and only down to the last clip. Oof. FML.
    ~~~~
    as i saw no bugs nothing wrong i didnt go into other maps or restart though the m60 was fine and the GL had both 1 fire and 1 explove but other then that nothing on my side =o
    sonic155 is offline
    Black_Wolf
    Junior Member
    Join Date: Dec 2019
    Location: Italy
    Old 06-19-2020 , 14:35   Re: [L4D2] Switch Upgrade Ammo Types (1.0) [16-Jun-2020]
    Reply With Quote #5

    Tested for a whole map the plugin using a grenade launcher with special ammo multiple times. No issues at all, works perfectly even after a chapter load. Great plugin Silvers! This goes into my favorites!

    Last edited by Black_Wolf; 06-19-2020 at 14:36.
    Black_Wolf is offline
    PEK727
    Junior Member
    Join Date: Aug 2020
    Location: United States
    Old 08-16-2020 , 23:39  
    Reply With Quote #6

    I found some bugs in switching ammo types:

    M60 and Grenade Launcher can't carry any more bullets besides their active ammo so all you can do is change its type but not have additional ammo. If you pick up upgrade ammo when your gun is empty and switch off the upgrade ammo it turns the special ammo into regular ammo and makes the reserve ammo count read much higher than it should even though it's still 0; if you shoot and switch back this also causes the special ammo counter to read the number of bullets remaining to be incorrect. You can't switch to any upgrade clips you picked up with a gun when it's default ammo is empty, has to be refilled first.

    Not sure what can even be fixed but I figured I'd report anyway.
    PEK727 is offline
    Shao
    Senior Member
    Join Date: Jan 2015
    Old 08-17-2020 , 19:42   Re: [L4D2] Switch Upgrade Ammo Types (1.0) [16-Jun-2020]
    Reply With Quote #7

    The plugin conflicts with Multiple Equipment, as in. Switching for ammo will also switch the first slot weapon.

    They can work together, but it's extremely clunky, I would not recommend using both at the same time.
    Shao is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-18-2020 , 15:42   Re: [L4D2] Switch Upgrade Ammo Types (1.1) [18-Aug-2020]
    Reply With Quote #8

    Code:
    1.1 (18-Aug-2020)
        - Blocked the M60 and Grenade Launcher from being able to switch ammo types.
    __________________
    Silvers is offline
    sonic155
    Senior Member
    Join Date: Mar 2019
    Old 08-18-2020 , 21:20   Re: [L4D2] Switch Upgrade Ammo Types (1.1) [18-Aug-2020]
    Reply With Quote #9

    my server has it to be 2clips of upgrade ammo if i pick up explo ammo i get 100clip then i pick up fire ammo get 100clip then next map load i have fire ammo 100clip but when i switch to explo i have 50clip o.o
    sonic155 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-26-2020 , 19:50   Re: [L4D2] Switch Upgrade Ammo Types (1.2) [21-Aug-2020]
    Reply With Quote #10

    Without seeing a video I don't know what you mean. It works as intended and I have no issue on map change even with increased clip sizes.
    __________________
    Silvers 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 12:29.


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