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

[L4D1 & L4D2] Laser that never sucks (useful upgrades)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Plugin ID:
6434
Plugin Version:
1.7.7
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    21 
    Plugin Description:
    Laser that doesn't crash the server + reload + silent + night
    Old 02-12-2019 , 20:27   [L4D1 & L4D2] Laser that never sucks (useful upgrades)
    Reply With Quote #1

    Author:
    Figa (fork by Dragokas)
    Description:
    These are 4 upgrades any client can manually enable/disable at any time:

    - Laser Sight
    - Night Vision
    - Silencer (L4D1 only)
    - Fast Reload (L4D1 only)

    All upgrades are made permanently per-client, not per-weapon (and saved to cookies, loaded on client re-join).

    Why one more plugin?
    - Most plugins for laser in L4D1 cause clients to crash on some servers. This fork uses SDK-method that works fine all the time.

    Restrictions:
    - for L4D2 only Laser & Night Vision are available at the moment.
    - for L4D2 it is impossible to remove crosshair due to the protected client-side command "crosshair 0". I also tried to change the different hud properties of the client, but they don't have the desired effect.

    Specific:
    - Plugin is blocking perk sound automatically when you equip the upgrade.
    - atm, plugin cannot block the secondary sound (in L4D2) and game hint (on-screen message and sound) (L4D2) when you equip/re-equip weapon with upgrade. Need help.

    Commands:
    sm_laser - Toggle Laser Sight
    sm_laseron - Turn on the laser
    sm_laseroff - Turn off the laser
    sm_night - Toggle Night Vision
    sm_silent - Toggle Silencer (L4D1 only)
    sm_silencer - same
    sm_reload - Toggle Fast Reload (L4D1 only)
    Settings (ConVars):
    - cfg/sourcemod/l4d_useful_upgrades.cfg:

    l4d_enable_silencer - def.: 1 - Enable Toggle Silencer Upgrade; 0 - Disable This Upgrade
    l4d_enable_laser_sight - def.: 1 - Enable Toggle Laser Sight Upgrade; 0 - Disable This Upgrade
    l4d_enable_night_vision - def.: 1 - Enable Toggle Night Vision Upgrade; 0 - Disable This Upgrade
    l4d_enable_fast_reload - def.: 1 - Enable Toggle Fast Reload Upgrade; 0 - Disable This Upgrade

    l4d_force_spawn_silencer - def.: 0 - Force Silencer Upgrade on spawn (0 - No, 1 - Yes)
    l4d_force_spawn_laser_sight - def.: 0 - Force Laser Sight Upgrade on spawn (0 - No, 1 - Yes)
    l4d_force_spawn_night_vision - def.: 0 - Force Night Vision Upgrade on spawn (0 - No, 1 - Yes)
    l4d_force_spawn_fast_reload - def.: 1 - Force Fast Reload Upgrade on spawn (0 - No, 1 - Yes)

    l4d_force_join_silencer - def.: 1 - Force Silencer Upgrade on first join (0 - No, 1 - Yes)
    l4d_force_join_laser_sight - def.: 1 - Force Laser Sight Upgrade on first join (0 - No, 1 - Yes)
    l4d_force_join_night_vision - def.: 0 - Force Night Vision Upgrade on first join (0 - No, 1 - Yes)
    l4d_force_join_fast_reload - def.: 1 - Force Fast Reload Upgrade on first join (0 - No, 1 - Yes)

    l4d_upgrades_remove_dropped_laser - def.: 1 - Auto switch off laser on the dropped weapon (0 - No, 1 - Yes) (L4D2 only)

    - cfg/server.cfg (L4D1)

    sm_cvar survivor_upgrade_reload_shotgun_duration "0.6" // default value - control shotgun reload speed if upgrade is enabled
    sm_cvar survivor_upgrade_reload_duration "1" // default value - control other weapons reload animation speed if upgrade is enabled

    Natives & Forwards
    Spoiler


    Translations:
    - English
    - Russian
    - Spanish
    Credits:
    - Figa - original author
    - Whosat - for SDK-method of laser activation
    - AlexMy - helping with crash fix
    - SilverShot - helping with crash fix and for patch example
    - Krivous Anatolii (The Trick) - resolving Windows crash in NOP patch
    - dcx2 - for code to manipulate laser on the weapon in L4D2.
    TODO:

    - disable annoying instructor hints in L4d2.
    - find a method to enable laser for any weapon in L4d2.
    Donate
    Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
    - Patreon (Paypal)
    - BitCoin
    - Ю.Money
    Attached Files
    File Type: zip useful_upgrades_v.1.7.X.zip (28.2 KB, 440 views)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 02-08-2023 at 08:50.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-05-2019 , 00:48   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #2

    Plugin is rewritten on the basis of my alternative fork branch.

    Quote:
    1.4 (01-Mar-2019)
    - Converted to a new syntax and methodmaps
    - Added sdk method to enable laser
    - Added more reliable managing the cookies
    - Added "l4d_useful_upgrades" config file.
    - Added "l4d_force_silencer" ConVar to force Silencer Upgrade on spawn
    - Added "l4d_force_laser_sight" ConVar to force Laser Sight Upgrade on spawn
    - Added "l4d_force_night_vision" ConVar to force Night Vision Upgrade on spawn
    - Added "l4d_force_fast_reload" ConVar to force Fast Reload Upgrade on spawn
    - Added checking for game requirements (L4D1 only).

    1.3 (private)
    - Removed laser, because it crash my server

    1.2 (based on alternate fork branch)
    - Added saving upgrades state to the cookies
    - Added some safe checkings
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    BlackSabbarh
    Senior Member
    Join Date: Sep 2018
    Old 03-05-2019 , 12:45   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #3

    I could create a plugin that uses the night vision but it can be used to decorate an event such as a car alarm or a horde or a spawn tank, activated only when an event happens, or with a timer. would create a good atmosphere
    BlackSabbarh is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-05-2019 , 15:21   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #4

    Is it a question?
    Look how it is done in "Mutant zombies" plugin.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-11-2019 , 04:13   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #5

    1.5 (07-Mar-2019)
    Added additional delay before activation the laser because sometimes player's netprops have no time to init.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-22-2019 , 13:57   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #6

    Anybody know, why that crash can happen? https://forums.alliedmods.net/showthread.php?t=315101
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Alexmy
    Senior Member
    Join Date: Oct 2014
    Location: Russian Federation
    Old 03-22-2019 , 16:02   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #7

    Why do you check real players?
    PHP Code:
    public Action round_end(Event event, const char[] namebool dontBroadcast)
    {
        for(
    int i=1i<=MaxClientsi++)
        {
            if(
    IsClientInGame(i) && !IsFakeClient(i)) DisableAllUpgrades(i);
        }

    Only need a check on the game and everything.Further did not begin to look.
    Alexmy is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-22-2019 , 18:31   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #8

    Bots doesn't need upgrades.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 03-22-2019 , 18:43   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #9

    Quote:
    Originally Posted by Dragokas View Post
    Bots doesn't need upgrades.
    What if someone uses upgrade and disconnects/AFK.. the bot carries the upgrades or not?
    __________________
    Silvers is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-22-2019 , 19:06   Re: [L4D1] Laser that never sucks (useful upgrades)
    Reply With Quote #10

    Actually, I missed that. I even didn't think about that. Possibly, bot cares the upgrade. I have to check.
    Thanks, SilverShot and Alexmy.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 03-22-2019 at 19:07.
    Dragokas 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 07:26.


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