L4D2 ONLY
Description
With the L4D2
Last Stand update, some of the new things brought are new skins for weapons (e.g.:
golden crowbar).
This plugin opens a menu for the client to choose their own weapon skin.
Features
- Menu to change the client's weapon skin (!wskin).
- Store client preferences (cookies).
- Intro message in the chat showing up that the !wskin is available as command.
- Allow admins to get or set target weapon skins through commands. (!getskin / !setskin <value>)
Preview
Cvars
A configuration file named "
l4d2_wskin.cfg" will automatically be created for you upon the first run in the "
\cfg\sourcemod\" folder.
PHP Code:
// Weapon skin option for Auto Shotgun.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_auto_shotgun "1"
// Allow cookies for storing client preferences.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_cookies "1"
// Weapon skin option for Cricket Bat melee.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_cricket_bat "1"
// Weapon skin option for Crowbar melee.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_crowbar "1"
// Enable/Disable the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_enable "1"
// Weapon skin option for Gascan.
// Note: Enabling this may glitch some plugins that check the gascan skin to detect if is a scavenge one.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_gascan "1"
// Weapon skin option for Hunting Rifle.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_hunting_rifle "1"
// Show intro message in chat this many seconds after a client joins.
// 0 = OFF.
// -
// Default: "60.0"
// Minimum: "0.000000"
l4d2_wskin_intro "60.0"
// Weapon skin option for Pistol Magnum.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_pistol_magnum "1"
// Weapon skin option for Pump Shotgun.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_pump_shotgun "1"
// Weapon skin option for AK47 Rifle.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_rifle_ak47 "1"
// Weapon skin option for M16 Rifle.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_rifle_m16 "1"
// Weapon skin option for Chrome Shotgun.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_shotgun_chrome "1"
// Shows a different icon for equipped weapons in menu if sorted (l4d2_wskin_sort_equipped_first = "1").
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_show_equipped_icon "1"
// Weapon skin option for SMG Uzi.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_smg_uzi "1"
// Weapon skin option for Silenced SMG.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_smg_silenced "1"
// Equipped weapons appear first in the menu.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_wskin_sort_equipped_first "1"
Public Commands
- sm_wskin => Opens a menu to select and configure the weapon skins.
Admin Commands
- sm_getwskin => Output to the chat the target skin/classname/model value of entities with "weapon_*" classname. (z flag required)
- sm_setwskin => Set the target skin value of entities with "weapon_*" classname. Usage: sm_setwskin <value>. (z flag required)
- sm_print_cvars_l4d2_wskin => Print the plugin related cvars and their respective values to the console. (z flag required)
Change Log
Current Translations
- en - English
- es - Spanish
- hu - Hungarian
- pt - Brazilian Portuguese
- pt_p - Portuguese
- ru - Russian
- ua - Ukrainian
- chi - Simplified Chinese
- zho - Traditional Chinese
Known issues
- The skin doesn't apply very well while on the third person (e.g. thirdpersonshoulder). You may have to swap weapons to see the changes.
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.
- 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 (shoving for example, updates the view model).
- You can use "cl_viewmodelfovsurvivor 80" while in the first person to be able to see the whole weapon easier.
- 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.
- 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.
- I don't know if it conflicts with the "Golden Crowbar" achievement.
- Enabling gascan RNG skin may glitch some plugins that check the skin to detect if is a scavenge one.
Thank you!
Related Plugins
Post Reply
- Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.
Installation
- Put the "l4d2_wskin.phrases.txt" file in your "\addons\sourcemod\translations\" folder.
- Put the "l4d2_wskin.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.