Raised This Month: $32 Target: $400
 8% 

[L4D & L4D2] Reload Interrupt (1.12) [03-Dec-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7105
Plugin Version:
1.12
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Shooting cancels reloading like TF2 weapons. Also can auto reload weapons after shooting.
    Old 05-14-2020 , 23:01   [L4D & L4D2] Reload Interrupt (1.12) [03-Dec-2022]
    Reply With Quote #1

    Thanks:
    • SkiPlix - the idea and request.
    • Lux - reviewing code.
    • SilentBr - testing.
    • MasterMind420 - testing.


    Related Plugins:

    About:
    • Mimics the TF2 feature where shooting interrupts reloading unless the clip is empty.
    • The cvar l4d_reload_interrupt_restart value "2" can enable auto reloading after shooting or "1" for auto reloading only when interrupted by shooting.
    • Because of how the game engine works, when shooting during reload the first bullet is not heard by the person shooting.
    • To fix this I've made it play the sound but maybe sometimes that might not work or the 2nd bullet is not audible (especially for machine guns or rapid fire weapons).
    • Due to this workaround some might have the wrong loudness. The sound emits from the client not the weapon.
    • Also the first shot will not create bullet decals or tracers, but it still impacts entities.
    • This only affects the person shooting the gun, others will hear the sound and see tracers etc.


    Plugin Conflict:

    This plugin does not work correctly with the following plugins:

    CVars:

    Saved to l4d_reload_interrupt.cfg in your servers \cfg\sourcemod\ folder.

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

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

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

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

    // 0=Off. 1=Restart reloading when reloading was interrupted by shooting. 2=Auto reload anytime shooting stops.
    l4d_reload_interrupt_restart "1"

    // Allowed weapons (add numbers together):
    // 1=autoshotgun, 2=hunting_rifle, 4=pistol, 8=pistol_magnum, 16=pumpshotgun, 32=rifle, 64=rifle_ak47, 128=rifle_desert, 256=rifle_sg552, 512=shotgun_chrome, 1024=shotgun_spas, 2048=smg, 4096=smg_mp5, 8192=smg_silenced, 16384=sniper_awp, 32768=sniper_military, 65536=sniper_scout, 131071=All.
    l4d_reload_interrupt_weapons "131071"

    // Reload Interrupt plugin version
    l4d_reload_interrupt_version 


    Changes:
    Code:
    1.12 (03-Dec-2022)
        - Fixed unknown sound errors in console. Thanks to "TBK Duy" for reporting.
    
    1.11 (26-Nov-2022)
        - Fixed breaking under certain conditions until swapping weapon. Thanks to "TBK Duy" for reporting.
    
    1.10 (15-Jan-2022)
        - Fixed L4D1 not reading reserve ammo correctly. Thanks to "ZBzibing" for reporting.
    
    1.9 (27-Oct-2021)
        - Fixed the plugin wiping reserve ammo if it was turned off during gameplay.
    
    1.8 (06-Oct-2021)
        - Fixed going AFK and bots reloading emptying the reserve clip. Thanks to "TQH" for reporting.
    
    1.7 (13-Apr-2021)
        - Another precache sound fix attempt. Should be right now.
    
    1.6 (27-Mar-2021)
        - Fixed precache sound errors by verifying files exist before. Thanks to "Maur0" for reporting.
    
    1.5 (20-Mar-2021)
        - Fixed some console errors due to not precaching sounds. Thanks to "Balloons" for reporting.
    
    1.4 (28-Sep-2020)
        - Blocked bots from using to prevent any bugs.
        - Fixed the plugin sometimes wiping ammo when quickly switching weapons (Gear Transfer - grenades issue).
    
    1.3 (07-Jun-2020)
        - Fixed L4D1 issues. Thanks to "jamalsheref2" for reporting.
    
    1.2 (19-May-2020)
        - Added extra check on switching weapons. Thanks to "Crasher_3637" for reporting.
        - Added reset vars on player spawn and death.
    
    1.1 (16-May-2020)
        - Fixed reserve ammo increasing. Thanks to "Crasher_3637" for reporting.
    
    1.0 (15-May-2020)
        - Initial release.


    Installation
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_reload_interrupt.sp - 501 views - 24.9 KB)
    __________________

    Last edited by Silvers; 12-03-2022 at 10:16.
    Silvers is offline
    SkiPlix
    Member
    Join Date: Dec 2016
    Location: Argentina
    Old 05-15-2020 , 00:30   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #2

    Beautiful.

    Thanks Silvers!

    Last edited by SkiPlix; 05-15-2020 at 00:30.
    SkiPlix is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 05-15-2020 , 05:58   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #3

    This could be decent.

    Over the 10 years this game has been out. There really hasn't been any realistic mods or plugins that feasibly nerfs shotguns in my book. After all these years, I still see so many tards that default to grabbing a T2 shotgun and just trying to rat rush to the saferoom and why?...Its still just so effective because the shotty is still so much of a nuclear get out of jail free card. Sure anti rushing methods work, but something that can outright make the shotties more difficult is a win in my book.

    Making shotties have super recoil on the move while shooting so spraying and praying would be great. Not asking for it, just saying the obvious really.

    Last edited by Sev; 05-15-2020 at 05:59.
    Sev is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-15-2020 , 07:05   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #4

    Quote:
    Originally Posted by Sev View Post
    This could be decent.

    Over the 10 years this game has been out. There really hasn't been any realistic mods or plugins that feasibly nerfs shotguns in my book. After all these years, I still see so many tards that default to grabbing a T2 shotgun and just trying to rat rush to the saferoom and why?...Its still just so effective because the shotty is still so much of a nuclear get out of jail free card. Sure anti rushing methods work, but something that can outright make the shotties more difficult is a win in my book.

    Making shotties have super recoil on the move while shooting so spraying and praying would be great. Not asking for it, just saying the obvious really.
    Do something about it then.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 05-15-2020 , 07:58   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #5

    Great work as always man! Immediately installed this on all my servers along with your new Saferoom Door Spam Protection. So far, so good.
    __________________
    Psyk0tik is offline
    SkiPlix
    Member
    Join Date: Dec 2016
    Location: Argentina
    Old 05-15-2020 , 22:46   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #6

    One little issue is sometimes the pistol shoots slower than the actual fire rate after you reload from 0 bullets in the chamber.
    SkiPlix is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-15-2020 , 22:53   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #7

    I don't see how that's possible, this doesn't affect fire rate. The only thing is the plugin bypasses fire rate when interrupting reload to shoot so I guess you can shoot quicker when it's trying to reload and being interrupted. That might give you a false sense of increased speed, and when shooting after reloading it seems slower. Unless you have a video showing the actual bug I will ignore.
    __________________
    Silvers is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 05-16-2020 , 00:50   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #8

    Quote:
    Originally Posted by Sev View Post
    This could be decent.

    Over the 10 years this game has been out. There really hasn't been any realistic mods or plugins that feasibly nerfs shotguns in my book. After all these years, I still see so many tards that default to grabbing a T2 shotgun and just trying to rat rush to the saferoom and why?...Its still just so effective because the shotty is still so much of a nuclear get out of jail free card. Sure anti rushing methods work, but something that can outright make the shotties more difficult is a win in my book.

    Making shotties have super recoil on the move while shooting so spraying and praying would be great. Not asking for it, just saying the obvious really.
    I reduced the shotgun range that they smokers and chargers become a huge threat as you can't reach them. You can easily do something like that.
    __________________
    Spirit_12 is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 05-16-2020 , 15:36   Re: [L4D & L4D2] Reload Interrupt (1.0) [15-May-2020]
    Reply With Quote #9

    There's an issue with the ammo reservation for sniper rifles, assault rifles, and SMGs. When reloading, regardless of whether it was interrupted or not, the ammo reservation is increased when the reload animation finishes. When you drop the weapon and pick it up again, you get the default max ammo reserve. I haven't seen this happen with any of the shotguns so far.
    __________________
    Psyk0tik is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-16-2020 , 16:07   Re: [L4D & L4D2] Reload Interrupt (1.1) [16-May-2020]
    Reply With Quote #10

    Very strange I never had this problem, some last minute changes I didn't test must have broken something somewhere.

    Code:
    1.1 (16-May-2020)
        - Fixed reserve ammo increasing. Thanks to "Crasher_3637" for reporting.
    __________________
    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 09:59.


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