Raised This Month: $ Target: $400
 0% 

Poss. change to fake?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-25-2009 , 06:14   Poss. change to fake?
Reply With Quote #1

i need the CustomFlashlight plugin in fakemeta. is this possible ?

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

 #define TASK_CHARGE 100

 
new flashlight[33];
 new 
flashbattery[33] = { 100, ... };

 public 
plugin_init() {
    
register_plugin("CustomFlashlight","0.11","Avalanche");
    
register_event("Flashlight","event_flashlight","b");
    
register_cvar("flashlight_custom","1");
    
register_cvar("flashlight_r","100");
    
register_cvar("flashlight_g","100");
    
register_cvar("flashlight_b","100");
    
register_cvar("flashlight_drain","1.0");
    
register_cvar("flashlight_charge","0.5");
    
register_cvar("flashlight_radius","9");
    
register_cvar("flashlight_decay","60");
    
register_event("DeathMsg","event_deathmsg","a");
 }

 public 
client_putinserver(id) {
    
flashbattery[id] = 100;
 }

 public 
client_disconnect(id) {
    
remove_task(TASK_CHARGE+id);
 }

 public 
event_deathmsg() {
    new 
victim read_data(2);
    
flashbattery[victim] = 100;
    
flashlight[victim] = 0;
 }

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

    if(
flashlight[id]) {
        
flashlight[id] = 0;
    }
    else {
        if(
flashbattery[id] > 0) {
            
flashlight[id] = 1;
        }
    }

    if(!
task_exists(TASK_CHARGE+id)) {
        new 
parms[1];
        
parms[0] = id;
        
set_task((flashlight[id]) ? get_cvar_float("flashlight_drain") : get_cvar_float("flashlight_charge"),"charge",TASK_CHARGE+id,parms,1);
    }

    
message_begin(MSG_ONE,get_user_msgid("Flashlight"),{0,0,0},id);
    
write_byte(flashlight[id]);
    
write_byte(flashbattery[id]);
    
message_end();

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

 public 
charge(parms[]) {
    if(!
get_cvar_num("flashlight_custom")) {
        return;
    }

    new 
id parms[0];

    if(
flashlight[id]) {
        
flashbattery[id] -= 1;
    }
    else {
        
flashbattery[id] += 1;
    }

    
message_begin(MSG_ONE,get_user_msgid("FlashBat"),{0,0,0},id);
    
write_byte(flashbattery[id]);
    
message_end();

    if(
flashbattery[id] <= 0) {
        
flashbattery[id] = 0;
        
flashlight[id] = 0;

        
message_begin(MSG_ONE,get_user_msgid("Flashlight"),{0,0,0},id);
        
write_byte(flashlight[id]);
        
write_byte(flashbattery[id]);
        
message_end();

        
// don't return so we can charge it back up to full
    
}
    else if(
flashbattery[id] >= 100) {
        
flashbattery[id] = 100;
        return; 
// return because we don't need to charge anymore
    
}

    
set_task((flashlight[id]) ? get_cvar_float("flashlight_drain") : get_cvar_float("flashlight_charge"),"charge",TASK_CHARGE+id,parms,1);
 }

 public 
client_PreThink(id) {
    if(!
get_cvar_num("flashlight_custom")) {
        return;
    }

    if(
flashlight[id] && flashbattery[id]) {
        new 
origin[3];
        
get_user_origin(id,origin,3);
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        
write_byte(27); // TE_DLIGHT
        
write_coord(origin[0]); // X
        
write_coord(origin[1]); // Y
        
write_coord(origin[2]); // Z
        
write_byte(get_cvar_num("flashlight_radius")); // radius
        
write_byte(get_cvar_num("flashlight_r")); // R
        
write_byte(get_cvar_num("flashlight_g")); // G
        
write_byte(get_cvar_num("flashlight_b")); // B
        
write_byte(1); // life
        
write_byte(get_cvar_num("flashlight_decay")); // decay rate
        
message_end();
    }
 } 
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-25-2009 , 07:01   Re: Poss. change to fake?
Reply With Quote #2

Use this plugin : http://forums.alliedmods.net/showthread.php?p=633031
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-25-2009 , 08:16   Re: Poss. change to fake?
Reply With Quote #3

TY, but XS???? :-( dont wanna use & a new file? i mean ma plugin use already 2 cfg files. idk how can i add the colors file in ma cfgs
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-25-2009 , 10:39   Re: Poss. change to fake?
Reply With Quote #4

What are you talking about ? XS is just useful stocks. See by yourself. It's not a module.
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-25-2009 , 11:05   Re: Poss. change to fake?
Reply With Quote #5

Quote:
Originally Posted by arkshine View Post
What are you talking about ? XS is just useful stocks. See by yourself. It's not a module.
ma bad.what can i do for the colors.ini?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-25-2009 , 11:08   Re: Poss. change to fake?
Reply With Quote #6

I don't understand what you want.
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-25-2009 , 11:22   Re: Poss. change to fake?
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
I don't understand what you want.
idont wanna use the colors.ini !! in ma plugin i have already 2 config files. dont like to release ma plugin with 3 config files.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-25-2009 , 11:36   Re: Poss. change to fake?
Reply With Quote #8

Whoa. Use your brain.

flashlight_colors.ini is used only to get random color ; if you don't want this feature, don't use it...
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-25-2009 , 11:49   Re: Poss. change to fake?
Reply With Quote #9

Quote:
dont like to release ma plugin with 3 config files.
if you have just a bit brain, you can do all settings in one config file.
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-25-2009 , 12:20   Re: Poss. change to fake?
Reply With Quote #10

EDIT: 4get it
__________________

Last edited by One; 03-25-2009 at 12:24.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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:59.


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