Raised This Month: $ Target: $400
 0% 

Poss. change to fake?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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