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

[L4D2] Prevent M60 Drop on empty & other M60 bug fixes


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Plugin ID:
4729
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Prevents M60 rifles from being automatically deleted when they run empty, as well as fixing other bugs that occur with empty M60s
    Old 07-17-2015 , 17:28   [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #1

    About : Usually, M60s drop and auto delete themselves when they run empty, this plugin prevents this issue while also fixing other various bugs that occur with having an empty M60.

    This plugin was based on prevent_m60_remove by birno, while also borrowing a small snippet from guncontrol by AtomicStryker.


    How it works :
    It's a secret!

    Code:
    Version 1.0    07-17-2015
    - Initial Release
    KNOWN ISSUES/BUGS
    Code:
    - If you continue to hold down Fire with an empty M60 it'll prevent reload
    - Empty M60s are not supposed to be able to utilize Upgraded Ammo, I tried to fix this bug but sometimes the ammo count is incorrect
    - (Not a bug or Issue) If you utilize the ammo_m60_max cvar, utilizing ammo piles with an M60 will refuel your reserve ammo (This is a plugin feature).
    - Utilizing the above cvar and the guncontrol plugin, it is possible to obtain infinite ammo with an m60, a countermeasure to this was included in this plugin
    - Sometimes switching from another weapon to an M60 with 1 bullet while holding fire will empty your M60 without actually using the bullet, this is a bug with the detection in the system and not the plugin
    - (NOT A PLUGIN BUG, THIS IS A GAME ENGINE BUG) If you use a hold fire on a throwable, and attempt to cancel by switching to the M60, you will be unable to switch and instead the throwing animation will repeat until you finally release your throwable
    - Usually, if an empty M60 is dropped, you are unable to pick them up by any means, however this plugin allows you to pick them up, which is otherwise impossible
    - (GAME ENGINE BUG) If you drop an M60 with reserve ammo, when someone else picks it up it will lose all of it's reserve ammo
    Attached Files
    File Type: sp Get Plugin or Get Source ([L4D2] Prevent M60 Drop on empty clip.sp - 4646 views - 5.1 KB)
    __________________

    Last edited by DeathChaos25; 07-17-2015 at 17:50.
    DeathChaos25 is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 07-18-2015 , 21:59   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #2

    Neat quality of life plugin.

    Couple suggestions/concerns.

    1. Add the 'grabbing ammo' sound when getting the ammo, otherwise people might realize they got it without looking at the hud, because there is no sound otherwise.

    2. I think this might conflict with the Bots T3 plugin, from what I can tell, the bots never drop the 60 now, which is obviously the main point of the plugin. Though the bots do seem to try and reload the 60 manually. I think if its not already an idea or done, you should force the bots to grab ammo for the 60 if possible.

    3. Same ideas for the 60 would be good for the Nade Launcher, add in the ammo sound and allow it to be reloaded by the bots and humans alike.
    Sev is offline
    DeathChaos25
    Senior Member
    Join Date: Jan 2014
    Location: Puerto Rico
    Old 07-19-2015 , 17:10   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #3

    Quote:
    Originally Posted by Sev View Post
    Neat quality of life plugin.

    Couple suggestions/concerns.

    1. Add the 'grabbing ammo' sound when getting the ammo, otherwise people might realize they got it without looking at the hud, because there is no sound otherwise.

    2. I think this might conflict with the Bots T3 plugin, from what I can tell, the bots never drop the 60 now, which is obviously the main point of the plugin. Though the bots do seem to try and reload the 60 manually. I think if its not already an idea or done, you should force the bots to grab ammo for the 60 if possible.

    3. Same ideas for the 60 would be good for the Nade Launcher, add in the ammo sound and allow it to be reloaded by the bots and humans alike.
    For #1, the grabbing ammo sound should be pretty easy, I doubt I can get the visual effect to pop up though, but I guess a hint message should easily replace that.

    For #2, I never really tested this plugin on bots, however, I don't really know how easy it'd to make bots grab ammo without making it either very restrictive and situational, or making it work but they'd prob walk up to it multiple times or maybe even try to infinitely replenish their ammo until you get far away enough.

    The way the ammo replenish works is, you don't really get ammo off of the ammo piles, but rather, when you press +Use on an ammo pile, we edit your ammo value and give max ammo by obtaining it off of the ammo_m60_max cvar, I don't really think bots actually press +Use on Ammo piles with M60s or Grenade launchers equipped, I could look into it, but I really don't know what I should be expecting.

    For #3 it's be easy as pie, all I'd need to do is add the Grenade Launcher in the same way M60s work.
    __________________
    DeathChaos25 is offline
    Manoa
    Junior Member
    Join Date: Jul 2012
    Old 06-25-2016 , 12:05   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #4

    if you have a bug that when switching weapons it auto-switches back again, try to replace the code
    Code:
    if (buttons & IN_ATTACK)
    with:
    Code:
    if (buttons == 1)
    this makes sure that only when not pressing other buttons/keys and pressing fire the function will execute
    the problem is that the last weapon used key is a client-only key, it does not exist in sourcemod includes, so when you are in battle and need to change weapons fast, the change is prevented because the weapon is quickly re-changed, unfortunately this also means that when you are in battle with M60, the prevention of drop will probably not happen, so you should try to avoid running out of M60 and pressing anything other than fire button at the same time

    Last edited by Manoa; 06-25-2016 at 12:15.
    Manoa is offline
    cravenge
    Veteran Member
    Join Date: Nov 2015
    Location: Chocolate Factory
    Old 06-25-2016 , 22:46   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #5

    By doing that, you're removing the function and the purpose of the plugin of what it is supposed to do. DeathChaos made it that way so you can never drop your equipped M60.
    cravenge is offline
    jking
    AlliedModders Donor
    Join Date: Jan 2012
    Old 07-29-2016 , 15:57   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #6

    Hi DC, are you still working on this plugin?
    jking is offline
    Pyc
    Senior Member
    Join Date: Jan 2014
    Old 04-29-2017 , 17:41   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #7

    with this plugin I can't switch from grenade to another slot, if I take grenade and hold mouse1 (can't undo grenade)
    Pyc is offline
    jking
    AlliedModders Donor
    Join Date: Jan 2012
    Old 04-30-2017 , 23:35   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #8

    Quote:
    Originally Posted by Pyc View Post
    with this plugin I can't switch from grenade to another slot, if I take grenade and hold mouse1 (can't undo grenade)
    see here:

    https://forums.alliedmods.net/showthread.php?t=286597
    jking is offline
    4sianR8ine05
    New Member
    Join Date: Apr 2022
    Old 05-03-2022 , 23:59   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #9

    Also, can we remove the mini text box that states no infinite ammo for you? It doesn't disappear when you pick up an M60, it might be too annoying when appearing always. I don't mind using the other plugin that is similar to this like the one given on the link
    4sianR8ine05 is offline
    Nevve9
    Junior Member
    Join Date: Jul 2023
    Old 09-28-2023 , 21:17   Re: [L4D2] Prevent M60 Drop on empty & other M60 bug fixes
    Reply With Quote #10

    for some reason fast melee stops working when we have this installed
    Nevve9 is offline
    Reply



    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 03:47.


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