Raised This Month: $12 Target: $400
 3% 

[L4D2] Upgrade Pack Fixes


Post New Thread Reply   
 
Thread Tools Display Modes
Author
bullet28
Member
Join Date: Apr 2012
Plugin ID:
7022
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Fixes upgrade packs pickup bug when using survivor model change
    Old 04-05-2020 , 10:19   [L4D2] Upgrade Pack Fixes
    Reply With Quote #1

    The reason why I am posting this plugin is that Upgrade packs BUG FIX plugin that we all always used has a critical bug related to the character change. It allows some characters to use the upgrade boxes without limits (more than one time), as well as take all the "ammo uses" before someone else has time to take them (the box disappears and you are the only who took upgrade, but 4x times). To reproduce this bug, you must install one of the plugins that allow you to change the character (for example, CSM) and install a model of Francis, Bill or Louis. Video demonstration of bug: https://youtu.be/7EtEDTKrcFs

    Cvars:
    upgrade_denied_sound "1" - Play sound when ammo already used
    upgrade_block_glauncher "1" - "Block use of special ammo with grenade launcher (0 - Allow | 1 - Block any | 2 - Block incendiary | 3 - Block explosive)
    upgrade_incendiary_multi "1.0" - Incendiary ammo multiplier on pickup
    upgrade_explosive_multi "1.0" - Explosive ammo multiplier on pickup

    Notice:
    - By default grenade launcher upgrades is blocked, set upgrade_block_glauncher cvar to 0 if you won't block it.
    - If you just want to block grenade launcher, but you don't have model changer (CSM) - use this instead.
    - Boxes doesn't have proper glow indicating if it's used, and for some characters, i guess, we will never find way to do it. Anyway, players don't bother about it.

    Credits:
    V10 - original plugin, on which this is based
    Silvers - all the brilliant stuff he bring for L4D

    Installation:
    1. Put .smx file into plugins folder
    2. Remove l4d2_upgradepackfix.smx if it's exists
    2. Put the .txt file into gamedata folder
    Attached Files
    File Type: sp Get Plugin or Get Source (lfd_both_fixUpgradePack.sp - 1240 views - 6.8 KB)
    File Type: txt upgradepackfix.txt (805 Bytes, 697 views)

    Last edited by bullet28; 04-05-2020 at 13:42.
    bullet28 is offline
    Alex101192
    Senior Member
    Join Date: Aug 2018
    Old 04-05-2020 , 12:18   Re: [L4D2] Upgrade Pack Fixes
    Reply With Quote #2

    Works great thanks!
    Alex101192 is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 04-21-2020 , 07:01   Re: [L4D2] Upgrade Pack Fixes
    Reply With Quote #3

    I tested and found that if there are more than one upgrade box on the ground, fake survivors(bot) can use the upgrade boxes without limits (more than one time).

    so I modify this code
    PHP Code:
    bool isPlayerReal(int client) {
        return 
    isPlayerValid(client/*&& !IsFakeClient(client)*/;

    PHP Code:
    bool isPlayerAliveSurvivor(int client) {
        return 
    isPlayerSurvivor(client/*&& IsPlayerAlive(client)*/;

    And is there any chance to remove upgrade box entity when all survivors has used?
    because server becomes lag if there are so many upgrade boxes on the ground.
    __________________

    Last edited by HarryPotter; 04-21-2020 at 07:01.
    HarryPotter is offline
    Edison1318
    Senior Member
    Join Date: Nov 2015
    Location: Peaceful place of the in
    Old 05-04-2020 , 06:30   Re: [L4D2] Upgrade Pack Fixes
    Reply With Quote #4

    Quote:
    Originally Posted by fbef0102 View Post
    I tested and found that if there are more than one upgrade box on the ground, fake survivors(bot) can use the upgrade boxes without limits (more than one time).

    so I modify this code
    PHP Code:
    bool isPlayerReal(int client) {
        return 
    isPlayerValid(client/*&& !IsFakeClient(client)*/;

    PHP Code:
    bool isPlayerAliveSurvivor(int client) {
        return 
    isPlayerSurvivor(client/*&& IsPlayerAlive(client)*/;

    And is there any chance to remove upgrade box entity when all survivors has used?
    because server becomes lag if there are so many upgrade boxes on the ground.
    It kinda made my survivor bots bugged and they non-stop picking up the upgrade boxes which is annoying
    __________________
    EdisonGar
    Edison1318 is offline
    Send a message via Skype™ to Edison1318
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 05-05-2020 , 02:43   Re: [L4D2] Upgrade Pack Fixes
    Reply With Quote #5

    ok, so I finally made another version
    when all survivors already pick up a upgrade pack,
    it will remove this upgrade pack.

    Latest version always here
    __________________

    Last edited by HarryPotter; 09-03-2022 at 03:29.
    HarryPotter is offline
    sbrblz
    Member
    Join Date: Jun 2021
    Old 08-18-2021 , 00:15   Re: [L4D2] Upgrade Pack Fixes
    Reply With Quote #6

    I have attached the modified plugin with HarryPotter's fix for ease of use.

    The only thing I noticed is that the pack only disappears if all human players use it and there are no survivor bots. If there are survivor bots, even if they all grab the upgrade as well, the pack will not disappear. It shouldn't be an issue I supposed with an all human team.

    Edit: HarryPotter updated his post above with the latest updated version, I've removed the previously attached file. The new version seems to have a timer to get around the issue of the pack being not disappearing.

    Last edited by sbrblz; 08-23-2021 at 20:37.
    sbrblz 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 08:21.


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