Raised This Month: $51 Target: $400
 12% 

CustomFlashlight


Post New Thread Reply   
 
Thread Tools Display Modes
Lisa
Senior Member
Join Date: Jan 2007
Old 12-04-2007 , 16:05   Re: CustomFlashlight
Reply With Quote #51

Yea if I could get it to be smoother Id like it much better. Neat plugin still. But the flickering becomes annoying after a few mins.

Last edited by Lisa; 12-04-2007 at 16:07.
Lisa is offline
Tramp
Senior Member
Join Date: Aug 2005
Old 03-07-2008 , 18:34   Re: CustomFlashlight
Reply With Quote #52

It is possible to make random colors? Every time i click F i will see other

I found this option in other plugin for amx not amxx

PHP Code:
#include <amxmodx>
#include <engine>

//custom flashlight
new flashlight[33];
new 
color[33];
new 
g_color[][] = { 
        {
100,0,0},{0,100,0},{0,0,100},{0,100,100},{100,0,100},{100,100,0},
        {
100,0,60},{100,60,0},{0,100,60},{60,100,0},{0,60,100},{60,0,100},
        {
100,50,50},{50,100,50},{50,50,100},{0,50,50},{50,0,50},{50,50,0}
};
new 
flashlight_customflashlight_radiusflashlight_only_ct;
new 
gmsgFlashlight;

public 
client_putinserver(id) {
    
random_num(0sizeofg_color ) - 1);
}

// Plugin initialization
public plugin_init()
{
  
register_event("Flashlight","event_flashlight","b");
  
flashlight_custom register_cvar("flashlight_custom","1");
  
flashlight_radius register_cvar("flashlight_radius","20"); // 9 is like the real flashlight
  
flashlight_only_ct register_cvar("flashlight_only_ct","1"); // only CT have flashlight
  
gmsgFlashlight get_user_msgid("Flashlight");
  
set_cvar_num("mp_flashlight",1);
}


public 
FlashedEventid )
{
    if(
get_pcvar_num(amx_hs_flash))
        return 
PLUGIN_HANDLED;
    return 
PLUGIN_CONTINUE;
}

public 
event_flashlight(id) {
    if(!
get_pcvar_num(flashlight_custom)) {
        return;
    }

    new 
CsTeams:team cs_get_user_team(id)
    if( 
team != CS_TEAM_CT && get_pcvar_num(flashlight_only_ct))
    {
        
flashlight[id] = 0;
    }
    else
    {
        if(
flashlight[id]) {
            
flashlight[id] = 0;
            
color[id] = random_num(0sizeofg_color ) - 1);
        }
        else {
            
flashlight[id] = 1;
        }
    }

    
message_begin(MSG_ONE,gmsgFlashlight,_,id);
    
write_byte(flashlight[id]);
    
write_byte(100);
    
message_end();

    
entity_set_int(id,EV_INT_effects,entity_get_int(id,EV_INT_effects) & ~EF_DIMLIGHT);
}

public 
client_prethink(id) {
    if(!
get_pcvar_num(flashlight_custom)) {
        return;
    }
    
    new 
color[id];

    if(
flashlight[id]) {
        new 
origin[3];
        
get_user_origin(id,origin,3);
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        
write_byte(TE_DLIGHT); // TE_DLIGHT
        
write_coord(origin[0]); // X
        
write_coord(origin[1]); // Y
        
write_coord(origin[2]); // Z
        
write_byte(get_pcvar_num(flashlight_radius)); // radius
        
write_byte(g_color[a][0]); // R
        
write_byte(g_color[a][1]); // G
        
write_byte(g_color[a][2]); // B
        
write_byte(1); // life
        
write_byte(60); // decay rate
        
message_end();
    }

Could you help?
__________________
STER-Gaming.pl - The Best Multigaming Club, CS 1.6, CS:S, ET, COD 2 more and more ! Check forum forum.ster-gaming.pl

amxmodx - Polish support about amxx.

Last edited by Tramp; 03-09-2008 at 10:27.
Tramp is offline
turnip11
Junior Member
Join Date: Mar 2008
Old 03-12-2008 , 01:38   Re: CustomFlashlight
Reply With Quote #53

This looks like an AWESOME plugin for my server I always complain about not being able to see because my damn flash light isn't big or bright enough and these commands give me everything i needed to great idea! also would be really nice for zombie mod pitch black mode!
__________________

turnip11 is offline
Tsotsi
Member
Join Date: Apr 2008
Old 05-02-2008 , 18:46   Re: CustomFlashlight
Reply With Quote #54

i used this plugin on my zombie infections servers but there is a bug.

if human have active flashlight and it's turn into zombie the flashlight remainsa active and you cannot turn off....you must wait to finish the batteries.

and another problem...on zombies map it's dark...elmost every human turn on the flashlight...and when this happens ieveryone has lag and the flash does not work properly...

please fix this..i love customflashlight and i wanna use it on my server but in this conditions i can't

sorry for my english..but i hope that it can be understood what i wrote.
Tsotsi is offline
Peretz
Junior Member
Join Date: May 2008
Old 05-15-2008 , 01:39   Re: CustomFlashlight
Reply With Quote #55

omg!! Cooool
Peretz is offline
Virtual-Vybz
Senior Member
Join Date: Apr 2008
Old 06-08-2008 , 06:01   Re: CustomFlashlight
Reply With Quote #56

Ahhh there is a bug for me...
When I turnend flashlight on and reconnect to server and join team, it is turned on... something like the server remembers that i had turned it on... and if i die the flashlight stayed turned on... how to fix that???
__________________
Virtual-Vybz is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 06-08-2008 , 21:51   Re: CustomFlashlight
Reply With Quote #57

connorr made a new Custom Flashlight plugin which I haven't tried, but it seems to be slightly awesomer than this one. I recommend you try it out if you are having trouble with mine:

http://forums.alliedmods.net/showthread.php?t=72143
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Old 10-21-2008, 07:21
Freezet
This message has been deleted by Freezet.
alencore
Senior Member
Join Date: Oct 2011
Old 11-26-2011 , 10:13   Re: CustomFlashlight
Reply With Quote #58

this is already very good but will try that too.
__________________
alencore is offline
eduardolucioac
Member
Join Date: Jan 2016
Old 01-28-2017 , 20:26   Re: CustomFlashlight
Reply With Quote #59

Excellent!
eduardolucioac is offline
Reply



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 20:16.


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