sm_laser_sight_upgrade_on_equip_reload (admin flag "z")
:reload config data from file.
known issue
if load plugin/use command "laser_sight_upgrade_on_equip_reload" on map transition, the enabled and dropped weapon's laser sight will restore after new level start.
Change log
Spoiler
Code:
1.25 (2024-04-22:
-safer entity check in late load.
1.24 (2024-02-22:
-minor improve.
1.23 (2024-02-17:
-minor improve of code.
1.22 (2024-02-13 | re-upload 2024-02-14:
-add cvar "laser_sight_upgrade_on_equip_path" to dynamically load config.
1.21 (2023-12-27:
-no longer load empty weapon name.
1.20 (2023-12-17:
-improve .cfg data parsing, use SMCParser instead of KeyValues.
1.19 (2023-06-21:
add check for engine version, no longer load plugin in other games.
1.18 (2023-05-13:
minor improve of code.
1.17 (2023-05-02:
use event "weapon_drop" instead of SDKHook_WeaponDropPost, correctly remove laser sight by weapon drop plugins use SDKHooks_DropWeapon.
1.16 (2023-04-25:
refurbishment code format.
1.15 (2023-04-12:
minor improve of code.
1.14 (2023-03-03:
remove unnecessary check for upgrade status.
improve function of checking all weapons in reload cmd and late load.
1.13 (2023-01-27:
simplify detections in reload command.
1.12 (2023-01-24:
no longer automatically spawn config data, you have to install it manually.
1.11 (2023-01-21:
change command from server cmd to admin cmd.
1.10 (2023-01-21:
minor improve.
1.9 (2023-01-20:
clean up code.
1.8 (2023-01-16:
minor improve of code.
1.7 (2023-01-11:
improve ArrayList creating: use ByteCountToCells() to detect how many cells required.
1.6 (2022-12-25:
check GetMaxEntities() every time when detecting all weapons, better compatibility.
1.5 (2022-12-24:
improve detection of all weapons on late-load and command, use GetMaxEntities() instead of hardcode "2048".
1.4 (2022-12-21:
minor improve.
1.3 (2022-12-18:
minor improve.
1.2 (2022-12-13 | reupload 2022-12-17:
new version naming style.
1.1.4 (2022-12-12:
optimize performance by using static char array.
1.1.3 (2022-12-11:
add team check, only works for survivors.
original configs now not enable for pistols.
1.1.2 (2022-12-05:
minor improve.
1.1.1 (2022-12-02:
minor improve.
1.1.0 (2022-11-28:
use ArrayList instead of char array.
1.0.9 (2022-11-25:
improve the reload command. instantly give laser sight upgrade to weapon already equipped if not enabled before but after command run.
1.0.8 (2022-11-25:
update plugin info.
1.0.7 (2022-11-22:
improve late-load again.
1.0.6 (2022-11-22:
add late-load support, functions should work after loaded during gameplay.
1.0.5 (2022-11-21:
try to fix "invalid entity -1" error.
1.0.4 (2022-11-21:
remove laser sight upgrade for enabled weapons on them dropped.
1.0.3 (2022-11-21:
minor improve.
1.0.2 (2022-11-20:
rename config data, maybe you have to configure them manually.
1.0.1 (2022-11-18:
minor improve.
1.0.0 (2022-11-13:
init public release.
Configs installation
put laser_sight_upgrade_on_equip.cfg in sourcemod/data/. if you changed the file name or path, you have to edit the cvar "path" too.
"enable" means whether to enable on this weapon. 1 = enable, 0 = disable.