// Enable/Disable the plugin.
// Note: Enabling this may glitch some plugins that checks the gascan skin to detect if is a scavenge one.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_rng_enable "1"
sm_wskin_rng => Scramble the weapon skins randomly in real time. (z flag required)
sm_print_cvars_l4d2_wskin_rng => Print the plugin related cvars and their respective values to the console. (z flag required)
Change Log
Spoiler
1.1.1 (05-February-2024)
- Fixed a bug where the skin would reset while interacting with other items. (thanks "HarryPotter" for requesting)
- Fixed a bug not updating the viewmodel skin while using the give command.
- Now the plugin doesn't set skins for player weapons equipped during the map chapter transition.
1.1.0 (17-September-2022)
- Added cvar to ignore weapons that already have a skin different than default. (thanks "HarryPotter" for requesting)
1.0.9 (14-March-2022)
- Added safe check while getting the entity skin to prevent errors. (thanks "HarryPotter" for reporting)
1.0.8 (12-March-2022)
- Fixed gascans not applying skin on pickup. (thanks to "Toranks" for reporting and "ryzewash" for the code snippet to fix it)
1.0.7 (17-October-2021)
- Fixed prop_physics gascans not changing their skin when enabled. (thanks to "ryzewash" for reporting)
1.0.6 (04-June-2021)
- Added gascan option. (thanks to "TrevorSoldier" for requesting)
1.0.5 (10-November-2020)
- Fixed logic to apply RNG skin only after the config is loaded.
- Fixed error when the StringMaps weren't initialized yet. (thanks to "Krufftys Killers" for reporting)
1.0.4 (10-November-2020)
- Added cvar to select which weapons should have RNG skin. (thanks to "larrybrains" for requesting)
1.0.3 (03-November-2020)
- Fixed spawner entities' skin logic.
- Removed RNG logic from owned weapons.
- Added admin command to scramble weapon skins in real-time.
- Fixed compatibility with the skin menu plugin.
1.0.2 (30-September-2020)
- Fixed a bug where sometimes it didn't apply the correct skin when picking up an item from a spawner with count = 1. (thanks "Tonblader" for reporting)
1.0.1 (30-September-2020)
- Removed EventHookMode_PostNoCopy from hook events. (thanks "AK978" for reporting)
1.0.0 (29-September-2020)
- Initial release.
Notes
The skin change was achieved by changing the weapon "m_nSkin" netprop value.
For spawner entities the "m_nWeaponSkin" is also changed to the same value.
If the map, by default, changes the skin of a weapon, this plugin won't prevent it.
When the weapon is already equipped (active) I had to apply the skin also to the "m_hViewModel" netprop, otherwise there is some delay on skins changes.
Not all weapons have new skins and some aren't so different from the original one.
The currently supported weapons are: Melees: Crowbar, Cricket Bat Pistols: Magnum SMGs: Uzi; Silenced Shotguns: Pump; Chrome; Auto Rifles: M16; AK47 Sniper: Hunting Rifle Gascan
These weapons have 2 new skins: Magnum; M16; AK47, the others just 1.
Total of 14 new skins from 11 weapons.
The gas can skin isn't affected by this plugin.
By now, 29-September-2020, there are no more skins available.
The plugin may not work properly for clients that use addons to change the weapon appearance.
Enabling gascan RNG skin may glitch some plugins that check the skin to detect if is a scavenge one.
I don't know if it conflicts with the "Golden Crowbar" achievement.
To Do
Create a config to select the % chance to apply a different skin.
Thank you!
Alex Alcalá - for testing in his server and reporting some bugs.
Tonblader - for testing in his server and reporting some bugs.
larrybrains - for requesting a cvar to control which weapons should RNG.
One way this could be improved even further, either with this plugin or the menu plugin (probably makes more sense for the menu plugin) is adding a cookie similar to what's seen with survivor chat select for the characters. Only here, the server would remember what skin you chose for the weapons you decided to choose them for.
I downloaded the main post version, did a test right now and is working fine for me.
Better to test in the Whitetaker's Gun Shop (Dead Center - c1m2_streets) where you have a lot of weapons, then look for the AK47 and Magnum models which has more noticeable different skins.
There is no cvar to set a specific spawn skin yet.
I gonna add an admin command in the future to make the RNG in real-time.