View Single Post
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
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, 448 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