Since valve technically removed it for some stupid command to look at your gun skin, server owners can put this on their server to replace that command with a flashlight.
: (bind t sm_flashlight
) this is a secondary command for player to bind.
A config is made also in cfg/sourcemod/ folder.
: (def 1
) disables the hook of +lookatweapon
: (def 0
) determines whether to ignore the command completely or to continue the command.
: (def "items/flashlight1.wav"
) The sound the flashlight makes when toggled (default included)
: (def 1
) Will the sound be played to all players?
If you want to have the +lookatweapon to still work and not turn on flashlight, and just have the command: sm_flashlight, set the following cvars to these values: (no need to set return to anything cause the cvar is skipped due to the fact lookatweapon cvar is checked first in the hook.
If you want to have +lookatweapon still look at the weapon and turn on the flashlight use this config:
The third option is my favorite cause it replaces a command i never use (+lookatweapon) which is the default variables. Uses this config.
: Fixed the convar hook of Sound All.
: Custom sounds are now fixed and downloaded correctly. (479 downloads)
: Sounds are now fixed and properly precached and played. Also added the sm_flashlight_sound_all ConVar. (2.7k Downloads)
: Custom flashlight sounds are now automatically added to download table (2.2k Downloads since 2013, Wow!)
: Removed the required emitany include.
: Added Sound
: Added Enabled Cvar (958 downloads from last update)
: Added to check if the player is in the current gaming session to avoid errors.
: Adjusted code to be more clean, and added comments.
: Added a cvar to enable the return, also a cvar to disable the +lookatweapon hook. and the cvar sm_flashlight
Bacardi gave me some bit examples which i consider in this update, and replaced the check with just IsPlayerAlive().