Raised This Month: $32 Target: $400
 8% 

Custom Flashlight v0.5.4 (10/20/09)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Emp` (115)
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2008 , 06:50   Custom Flashlight v0.5.4 (10/20/09)
Reply With Quote #1

Custom Flashlight




.: Description :.

This plugin lets you customize flashlight with those features :
  • Set the drain frequency
  • Set the charge frequency
  • Choose the radius of flashlight
  • New! Unlimited flashlight (no drain)
  • New! Choose the color according to players team, or randomly
  • New! Show the flashlight to all players or only to the player who is using it (this can be usefull on kz servers)
  • New! Set a max distance after with the flashlight won't display
  • New! Set the light attenuation according to distance
  • New! Set flashlight sounds
  • Supports simon logic Blinding Flashlight plugin



.: Commands :.

  • flashlight_set custom < 0|1 >
    Turn the plugin on/off
  • flashlight_set show < 0|1 >
    Show flashlight to all players or only to the player who is using it
  • flashlight_set drain < value > default cs value is 120
    Time in seconds it will take to flashlight to be fully drained
  • flashlight_set charge < value > default cs value is 20
    Time in seconds it will take to flashlight to be fully charged
  • flashlight_set colortype < 0|1 >
    0:random (predifined) colors
    1:team colors
  • flashlight_set colorct < RRRGGGBBB >
    Flashlight color for CTs if flashlight_color_type is set to 1
  • flashlight_set colorte < RRRGGGBBB >
    Flashlight color for Ts if flashlight_color_type is set to 1
  • flashlight_set radius < 0-255 >
    Flashlight radius
  • flashlight_set distance < value >
    Max distance in units where you can see the flashlight
  • flashlight_set attenuation < value >
    Attenuation light factor according to distance between player and flashlight



.: Modules/Requirements :.

  • AMXX1.8+
  • Engine
  • $CONFIGSDIR/flashlight_colors.ini (see attachment)
    (plugin will automatically use per team colors if this file doesn't exist)


.: Credits :.


XxAvalanchexX for the previous plugin version witch gave me this idea and in witch i took the TE_DLIGHT message
HLSDK
Salamon for some ideas



.: Colors examples :.


http://en.wikipedia.org/wiki/List_of_colors



.: Config example :.


Put this code in amxx.cfg (or maps/de_dust2.cfg, maps/prefix_de.cfg etc..) -> default amxx .cfg files system.
Code:
// Custom Flashlight Settings
flashlight_set custom 1
flashlight_set show 1

flashlight_set drain 120
flashlight_set charge 20

flashlight_set colortype 0
flashlight_set colorte 255000000
flashlight_set colorct 000000255

flashlight_set radius 9
flashlight_set distance 2000
flashlight_set attenuation 5
To use per maps .ini file, do as for per maps plugins.ini file but instead of using maps/ folder, use flashlight/ one.
Examples :
Code:
addons\amxmodx\configs\flashlight\de_dust.ini
addons\amxmodx\configs\flashlight\prefix_cs.ini
.: Changelog :.
Code:
* v0.5.4 (10.20.09)
* attempt to fix the bug when you can re-activate fl when empty
*
* v0.5.3 (09/01/09)
* -fixed little errors due to version change
* -added player range check in death event
** v0.5.2 (07/23/09)
* -fixed inverted teams colors
*
* v0.5.1 (04/04/09)
* -haven't realised i can remove FM include
*
* v0.5.0 (04/03/09)
* - use register_think instead of FM_CmdStart
* - use client_PreThink instead of FM_PlayerPreThink
* - use get_user_origin mode 1 and 3 instead of fakemeta stock
* - replaced some FM natives+enums with amxx natives (emit_sound, write_coord)
*
* v0.4.0 (07/27/08)
* - replaced cvars with commands
* - .ini file now supports prefix/per map configs
*
* v0.3.1 (06/29/08)
* - fixed bug when you could have seen normal flashlight
*
* v0.3.0 (06/21/08)
*
* - some code optimizations (thanks to simon logic and jim_yang)
* - changes cvars flashlight_drainfreq and flashlight_chargefreq to
*  flashlight_fulldrain_time and flashlight_fullcharge_time
*  (simon logic suggestion)
* - moved random colors into $CONFIGSDIR/flashlight_colors.ini
*
* v0.2.0
* First public release
Attached Files
File Type: ini flashlight_colors.ini (817 Bytes, 8348 views)
File Type: sma Get Plugin or Get Source (CustomFlashLight.sma - 11334 views - 9.3 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-22-2011 at 13:55.
ConnorMcLeod is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-01-2008 , 06:59   Re: Custom Flashlight (New)
Reply With Quote #2

Just tested, and works great! Gj
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 06-01-2008 , 08:38   Re: Custom Flashlight (New)
Reply With Quote #3

wow , something new . =)
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Fan of Da!!!
Junior Member
Join Date: Jun 2008
Location: Bulgaria
Old 06-01-2008 , 09:28   Re: Custom Flashlight (New)
Reply With Quote #4

Will this work with zombie infection ?
Fan of Da!!! is offline
Send a message via ICQ to Fan of Da!!! Send a message via Skype™ to Fan of Da!!!
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 06-01-2008 , 09:45   Re: Custom Flashlight (New)
Reply With Quote #5

Why You don't try ?
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Fan of Da!!!
Junior Member
Join Date: Jun 2008
Location: Bulgaria
Old 06-01-2008 , 10:20   Re: Custom Flashlight (New)
Reply With Quote #6

Because i have Sparta mod server the plugin is for one friend
Fan of Da!!! is offline
Send a message via ICQ to Fan of Da!!! Send a message via Skype™ to Fan of Da!!!
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2008 , 10:31   Re: Custom Flashlight (New)
Reply With Quote #7

Quote:
Originally Posted by Fan of Da!!! View Post
Will this work with zombie infection ?
Should work.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Zul Rivers
Member
Join Date: May 2008
Old 06-04-2008 , 04:13   Re: Custom Flashlight (New)
Reply With Quote #8

Good Job, this plugin doesn't seem to lag me in my server.
__________________
Projects:
Superhero: Hydrogen [Completed]
Superhero: Liberty Lad [Incomplete]


No Longer AMX Scripting, I Suck At It.
Zul Rivers is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-04-2008 , 12:34   Re: Custom Flashlight (New)
Reply With Quote #9

Players can have low fps if you set radius too high.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-04-2008 , 13:03   Re: Custom Flashlight (New)
Reply With Quote #10

I donīt have any problem with FPS.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
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 19:15.


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