This plugin was originally part of the Flare and Light Package
. I have seperated the Flare
and Flare Gun
into new plugins.
- SilentBr - for the idea and request.
- Mr.RuyC - For recording videos and playing for hours and hours testing the plugin on his server.
- nakashimakun - Who came up with the plugin name. Also tested the plugin on his server.
- honorcode23, DJ_WEST, AtomicStryker, Boikinov, pimpinjuice and FoxMulder for source code (full credits inside the source).
- NanX, japan555, CeeJ, Farmer, SilentBr, sapphire989, Visual77, Mr. Man and everyone else who helped testing, it's been fun!
- disawar1 - Testing 2.0 and Russian translations.
- Januto - Spanish translations.
- Dont Fear The Reaper - German translations.
- Attaches flashlights to survivors.
- Special Infected can now use. See the l4d_flashlight_users cvar.
- Spectators and dead players can have a personal flashlight only they can see.
- Saves clients flashlight color and on/off state.
- Flashlight colors can be locked so players cannot change. Put the cvar l4d_flashlight_lock to 1 and it will force the colors to what you specified in the config.
- Checks the command access overrides for "sm_light" as well as providing cvars to control access flags.
Admin Commands: (requires "z" flag)
sm_light // Toggle the attached flashlight. Usage: sm_light [R G B|off|random|red|green|blue|purple|cyan|orange|white|pink|lime|maroon|teal|yellow|grey]
sm_lightmenu // Opens the flashlight color menu.
sm_light 255 0 0 // Makes your flashlight red
sm_light purple // Makes your flashlight purple
sm_lightclient // Turn on/off the flashlight on specified player. Usage: sm_lightclient <#user id|name> [R G B|off|random|red|green|blue|purple|cyan|orange|white|pink|lime|maroon|teal|yellow|grey]
sm_lightclient Roch 0 0 255 // Makes Rochelle's light blue
sm_lightclient Nick green // Makes Nick's light green
sm_lightclient @survivors // Toggles the flashlights on all survivors.
Saved to l4d_flashlight.cfg
in your servers \cfg\sourcemod\
// 0=Plugin off, 1=Plugin on.
// Brightness of the light for Survivors <10-255> (changes Distance value)
// Minimum: "10.000000" Maximum: "255.000000"
// Brightness of the light for Special Infected <10-255> (changes Distance value).
// Minimum: "10.000000" Maximum: "255.000000"
// The default light color. Three values between 0-255 separated by spaces. RGB Color255 - Red Green Blue.
l4d_flashlight_colour "200 20 15"
// Players with these flags may use the sm_light command. (Empty = all).
// 0=Off, 1=Show intro message to players entering spectator.
// 0=Off, Show intro message in chat this many seconds after joining.
// Minimum: "0.000000" Maximum: "120.000000"
// 0=Let players set their flashlight color, 1=Force to cvar specified.
// Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
// Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
// Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
// Empty = Allow all. 0=Block on all maps. Prevent displaying the model on these maps, separate by commas (no spaces).
// 0=Off, 1=Save client preferences for flashlight color and state.
// 0=Off, 1=Spectators, 2=Survivors, 4=Infected, 7=All. Give personal flashlights when dead which only they can see.
// 1=Survivors, 2=Infected, 3=All. Allow these players when alive to use the flashlight.
// Flashlight plugin version.
- Now sets the clients saved color if they spawned before client prefs were loaded. Thanks to "kochiurun119" for reporting.
- Fixed the default light color not setting when new players join. Thanks to "iciaria" for reporting.
- No longer shows the flashlight of the player you're spectating. Thanks to "yabi" for reporting.
- Plugin now deletes the client cookie if they no longer have access to use the flashlight. Requested by "maclarens".
- Added cvar "l4d_flashlight_brights" to control the brightness of lights for Special Infected. Requested by "A1ekin".
- Changed the light position on Special Infected and Spectators in an attempt to fix lighting the area. Thanks to "A1ekin" for reporting.
- Added a 1 second delay before creating a light on spawn, to avoid the light flashing once. Thanks to "Ja-Forces" for reporting.
- Fixed not saving light state across map changes. Thanks to "NoroHime" for reporting.
- Fixed not setting the default color when "l4d_flashlight_default" is "1" and "l4d_flashlight_random" is "0". Thanks to "kalmas77" for reporting.
- Fixed command "sm_light <color>" not changing the color. Thanks to "Shadowart" for reporting.
- Fixed cvar "l4d_flashlight_default" not restricting bots when set to "1". Thanks to "Shadowart" for reporting.
- Changes to fix warnings when compiling on SourceMod 1.11.
- Changed command "sm_light" to accept "rand" or "random" as a parameter option to give a random light color. Requested by "NoroHime".
- Code change includes completely random color instead of specified from the list. Uncomment and delete other code if you want this instead.
- Menu now returns to the page it was on before selecting an option. Requested by " Shadowart".
- Changed the plugin to allow bots to use the color cvar when _default cvar is enabled _random cvar was disabled.
- Added cvar "l4d_flashlight_default" to turn on the flashlight by default when spawning.
- Added cvar "l4d_flashlight_random" to give random colors when spawning.
- Fixed the Special Infected light being visible to others. Thanks to "A1ekin" for reporting.
- Added cvar "l4d_flashlight_users" to control if Survivors and Special Infected can use the plugins light.
- Fixed the Survivors spectator light attaching to their dead body and not themselves.
- Added a warning message to suggest installing the "Attachments API" and "Use Priority Patch" plugins if missing.
- Changed command "sm_light" to accept "off" param to turn off the light. Thanks to "Dragokas" for requesting.
- Changed "OnClientPostAdminCheck" to "OnClientPutInServer" - to fix any issues if Steam service is down.
- Added cookie preferences to save player flashlight color and state. Thanks to "GoGetSomeSleep" for requesting.
- Added cvar "l4d_flashlight_save" to control if the server can save and load client preferences.
- Extra checks to prevent "IsAllowedGameMode" throwing errors.
- Increased "l4d_flashlight_precach" cvar length, max usable length 485 (due to game limitations).
- Various changes to tidy up code.
- Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
- Removed "colors.inc" dependency.
- Updated these translation file encodings to UTF-8 (to display all characters correctly): Hungarian (hu).
- Fixed "sm_light" not working with color names because 2 args were the wrong way round. Thanks to "K4d4br4" for reporting.
- Added command "sm_lightmenu" to display a menu and select light color. No translations support.
- Added cvar "l4d_flashlight_precach" to prevent displaying the model on specific maps. Or "0" for all.
- Added to "sm_light" and "sm_lightclient" additional colors by name: "cyan" "pink" "lime" "maroon" "teal" "grey".
- Added Hungarian translations - Thanks to KasperH.
- No other changes.
- Fixed errors, thanks to "ReCreator" for reporting and testing.
- Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
- Changed cvar "l4d_flashlight_modes_tog" now supports L4D1.
- Fix to prevent garbage being passed into SetVariantString, as suggested by "KyleS".
- Added more checks to events, preventing errors being logged.
- Fixed cvar "l4d_flashlight_spec" enums mistake, thanks to "Dont Fear The Reaper".
- Fixed errors being logged on player spawn event when clients were not in game.
- Changed cvar "l4d_flashlight_spec". The cvar is now a bit flag, add the numbers together.
- Fixed cvar "l4d_flashlight_spec" blocking alive survivors from using the flashlight.
- Changed cvar "l4d_flashlight_spec". You can now specify which teams can use spectator lights.
- Added German translations - Thanks to "Dont Fear The Reaper".
- Added Spanish translations - Thanks to "Januto".
- Added cvar "l4d_flashlight_modes_off" to control which game modes the plugin works in.
- Added cvar "l4d_flashlight_modes_tog" same as above, but only works for L4D2.
- Added cvar "l4d_flashlight_hints" which displays the "intro" message to spectators if spectator lights are enabled.
- Changed the way "l4d_flashlight_flags" validates clients by checking they have one of the flags specified.
- Fixed the "sm_lightclient" command not affecting all clients.
- Fixed the "sm_light" command not working for spectators.
- Fixed ghost players still having flashlights.
- Small changes and fixes.
- Plugin separated and taken from the "Flare and Light Package" plugin.
- Added Russian translations - Thanks to "disawar1".
- Added personal flashlights for spectators and dead players. The light is invisible to everyone else.
- Added cvar "l4d_flashlight_spec" to control if spectators should have personal flashlights.
- Added the following triggers to specify colors with sm_light: red, green, blue, purple, orange, yellow, white.
- Saves players flashlight on/off state and colors on map change.
- Initial release.
- Put the plugins .sp file into your scripting folder and compile the plugin.
Updating from 2.23 or older:
- Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder.
- Install the Use Priority Patch plugin to prevent blocking +USE.
- Optional: Install the Attachment_API plugin to fix attachment positions breaking on model change.
- New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
: English (en), German (de), Hungarian (hu), Russian (ru), Spanish (es).