Monthly Target: $400 Donations: $133
 33% 

[L4D & L4D2] Flashlight (2.5) [25-May-2012]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
Veteran Member
Join Date: Aug 2010
Location: Space
Plugin ID:
2693
Plugin Version:
2.5
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Approver:
    Plugin Description:
    Attaches a flashlight to survivors. Spectators can have personal lights only they can see.
    Servers with this Plugin:
     
    Old 12-02-2011 , 17:53   [L4D & L4D2] Flashlight (2.5) [25-May-2012]
    Reply With Quote #1


    This plugin was originally part of the Flare and Light Package. I have seperated the Flare, Flashlight and Flare Gun into new plugins.



    Thanks:
    • 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.



    Details:
    • Attaches flashlights to survivors.
    • Spectators and dead players can have a personal flashlight only they can see.
    • Flashlight colors can be locked so players cannot change. Put the cvar l4d_flashlight_lock_colors 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.



    Player commands:

    Usage: sm_light <R G B|red|green|blue|purple|orange|yellow|white>
    Optional: Color name trigger or 3 RGB values (-1 to 255) for light color.

    PHP Code:
    sm_light    // Toggle the attached flashlight.

    // Examples:
    sm_light 255 0 0     // Makes your flashlight red
    sm_light purple      // Makes your flashlight purple 


    Admin Commands: (requires "z" flag)

    Usage: sm_lightclient <#user id|name> <R G B|red|green|blue|purple|orange|yellow|white>
    Optional: Color name trigger or 3 RGB values (-1 to 255) for light color.

    PHP Code:
    sm_lightclient // Turn on/off the flashlight on specified player.

    // Examples:
    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. 


    CVars:

    Saved to l4d_flashlight.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d_flashlight_allow "1"

    // Brightness of the light <10-255> (changes Distance value)
    // Minimum: "10.000000" Maximum: "255.000000"
    l4d_flashlight_bright "255.0"

    // 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).
    l4d_flashlight_flags ""

    // 0=Off, 1=Show intro message to players entering spectator.
    l4d_flashlight_hints "1"

    // 0=Off, Show intro message in chat this many seconds after joining.
    // Minimum: "0.000000" Maximum: "120.000000"
    l4d_flashlight_intro "35.0"

    // 0=Let players set their flashlight color, 1=Force to cvar specified.
    l4d_flashlight_lock "0"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d_flashlight_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d_flashlight_modes_off ""

    // (L4D2 only). Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d_flashlight_modes_tog "0"

    // 0=Off, 1=Spectators, 2=Survivors, 4=Infected, 7=All. Give personal flashlights when dead which only they can see.
    l4d_flashlight_spec "7"

    // Flashlight plugin version.
    l4d_flashlight_version 


    Changes:
    Code:
    2.5 (25-May-2012)
        - Added more checks to events, preventing errors being logged.
    
    2.4 (22-May-2012)
        - 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.
    
    2.3 (22-May-2012)
        - 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.
    
    2.2 (20-May-2012)
        - Changed cvar "l4d_flashlight_spec". You can now specify which teams can use spectator lights.
        - Added German translations - Thanks to "Dont Fear The Reaper".
    
    2.1 (30-Mar-2012)
        - 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.
    
    2.0 (02-Dec-2011)
        - 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.
    
    1.0 (29-Jan-2011)
        - Initial release.


    Compiling:
    1. Put the SDKHooks include into your \addons\sourcemod\scripting\include\ folder.
    2. Put the colors.inc include into your \addons\sourcemod\scripting\include\ folder.
    3. Put the plugins .sp file into your scripting folder and compile the plugin.


    Requirements:
    • This plugin requires the SDKHooks extension.


    Installation:
    • Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder.
    • This plugin was compiled with SDKHooks version 2.1.

    Updating from 2.0 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.

    Current Translations: English (en), German (de), Russian (ru), Spanish (es).
    Attached Files
    File Type: zip l4d_flashlight.zip (24.6 KB, 2605 views)
    __________________

    Last edited by KyleS; 10-09-2012 at 14:31. Reason: Feedback Given.
    Silvers is offline
    Dont Fear The Reaper
    Member
    Join Date: Nov 2011
    Old 12-17-2011 , 07:12   Re: [L4D & L4D2] Flashlight (2.0) [02-Dec-2011]
    Reply With Quote #2

    Great work once again

    I didn't notice any bugs so far. To support you a little bit i've attached the german translation. I'll look through your other plugins aswell to see if i can do it for them too since i'm using quite some of them (no need to mention we like them i guess, well now i did anyway )
    Attached Files
    File Type: txt flashlight.phrases.txt (508 Bytes, 228 views)
    Dont Fear The Reaper is offline
    Silvers
    Veteran Member
    Join Date: Aug 2010
    Location: Space
    Old 12-17-2011 , 07:57   Re: [L4D & L4D2] Flashlight (2.0) [02-Dec-2011]
    Reply With Quote #3

    Thank you very much
    __________________
    Silvers is offline
    TheHyena
    Junior Member
    Join Date: Dec 2011
    Old 02-10-2012 , 10:14   Re: [L4D & L4D2] Flashlight (2.0) [02-Dec-2011]
    Reply With Quote #4

    does this make it so that i can see others flashlights shine on objects? ie. Nick lighting up area ahead of me?
    TheHyena is offline
    Silvers
    Veteran Member
    Join Date: Aug 2010
    Location: Space
    Old 02-10-2012 , 11:29   Re: [L4D & L4D2] Flashlight (2.0) [02-Dec-2011]
    Reply With Quote #5

    It attaches a flashlight to the survivors left hip. I've fixed the screenshot which was missing.
    __________________
    Silvers is offline
    bubbabyte
    Member
    Join Date: Jun 2010
    Old 02-24-2012 , 15:38   Re: [L4D & L4D2] Flashlight (2.0) [02-Dec-2011]
    Reply With Quote #6

    no matter what i do i cannot get this to be admin/donator only.. i set the flag to "z" in the cfg but still everyone is able to use it, what am i doing wrong?
    bubbabyte is offline
    asto
    Member
    Join Date: Aug 2010
    Old 03-01-2012 , 12:15   Re: [L4D & L4D2] Flashlight (2.0) [02-Dec-2011]
    Reply With Quote #7

    This plugin can be the solution for this problem:
    http://forums.alliedmods.net/showthread.php?t=149311

    This plugin would be the best if it could replace the original flashlight.

    Just need to change these things:
    1. Disable the original flashlight by mp_flashlight 0 cvar.
    2. Put the position of light to the player's eye/crosshair position.
    asto is offline
    Silvers
    Veteran Member
    Join Date: Aug 2010
    Location: Space
    Old 03-30-2012 , 07:29   Re: [L4D & L4D2] Flashlight (2.1) [30-Mar-2012]
    Reply With Quote #8

    Plugin updated:

    2.1 (30-Mar-2012)
    - 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.

    @bubbabyte this should fix the issue you were having.
    __________________
    Silvers is offline
    bubbabyte
    Member
    Join Date: Jun 2010
    Old 03-30-2012 , 14:26   Re: [L4D & L4D2] Flashlight (2.1) [30-Mar-2012]
    Reply With Quote #9

    yes it did, thanks so much for the update
    bubbabyte is offline
    Dont Fear The Reaper
    Member
    Join Date: Nov 2011
    Old 05-17-2012 , 14:43   Re: [L4D & L4D2] Flashlight (2.1) [30-Mar-2012]
    Reply With Quote #10

    In your "player_team" hook in line 403 you accidentally check "if( team == 0 ...)" instead of 1 for team spectator which prevents spectators to automatically get a light attached to them.

    And one error i got:
    Code:
    L 05/17/2012 - 00:19:36: Info (map "c4m4_milltown_b") (file "errors_20120517.log")
    L 05/17/2012 - 00:19:36: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
    L 05/17/2012 - 00:19:36: [SM] Displaying call stack trace for plugin "l4d_flashlight.smx":
    L 05/17/2012 - 00:19:36: [SM]   [0]  Line 389, C:\SRCDS\left4dead2\left4dead2\addons\sourcemod\scripting\l4d_flashlight.sp::Event_Spawn()

    Last edited by Dont Fear The Reaper; 05-17-2012 at 14:50.
    Dont Fear The Reaper is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 08:29.


    Powered by vBulletin®
    Copyright ©2000 - 2015, vBulletin Solutions, Inc.
    Theme made by Freecode