Raised This Month: $ Target: $400
 0% 

remove time and add the level


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 05-25-2009 , 10:04   remove time and add the level
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
// CVAR Pointers
// -------------------------------------------------------------------------------------------------
new CVAR_RADIUSCVAR_JUMPRADIUSCVAR_DAMAGECVAR_COOLDOWN;
// Global Variables
// -------------------------------------------------------------------------------------------------
#define MAXSLOTS 32
new gSpriteLightning
new bool:gHit[33][33];
new 
Floatg_LastLeap[33]
new const 
gMessage[] = "No valid targets!";
new const 
gSound[] = "ambience/steamburst1.wav";
// Initialization
// -------------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("xxx""1.0""xxx");
    
    
CVAR_RADIUS register_cvar("shaman_radius""400");
    
CVAR_JUMPRADIUS register_cvar("shaman_jumpradius""400");
    
CVAR_DAMAGE register_cvar("shaman_damage""500");
    
CVAR_COOLDOWN register_cvar("shaman_cooldown""30");
    
register_clcmd("+lightning","lightning"ADMIN_USER"bind ^"key^" ^"+lightning^"")
}
public 
plugin_precache()
{
    
precache_sound(gSound);
    
gSpriteLightning precache_model("sprites/lgtning.spr");
}
// Events and Forwards
// -------------------------------------------------------------------------------------------------
// Custom Functions
// -------------------------------------------------------------------------------------------------
public lightning(id)
{
    if ( !
is_user_alive(id) ) return;
    
    new 
team _:get_user_team(id);
    new 
Float:origin[3], Float:other_origin[3];
    new 
distanceclosest_id idclosest_distance;
    
    static 
Float:Time
    Time 
get_gametime()
    static 
Float:cooldown
    cooldown 
get_pcvar_float(CVAR_COOLDOWN)
    
    new 
first_distance get_pcvar_num(CVAR_RADIUS);
    new 
other_distance get_pcvar_num(CVAR_JUMPRADIUS);
    new 
Float:damage get_pcvar_float(CVAR_DAMAGE)
    
    
pev(idpev_originorigin);
    
    new 
loop_count 0last_id id;
    while ( 
loop_count <= MAXSLOTS )
    {
        if ( !
is_user_alive(closest_id) ) break;
        
        
pev(closest_idpev_originorigin);
        
        if ( 
closest_id == id closest_distance first_distance;
        else 
closest_distance other_distance;
        
        for ( new 
1<= MAXSLOTSi++ )
        {
            if ( !
is_user_alive(i) || == id ) continue;
            if ( 
gHit[id][i] == true ) continue;
            if ( 
_:get_user_team(i) == team ) continue;
            
            
pev(ipev_originother_origin);
            
distance floatround(get_distance_f(originother_origin));
            
            if ( 
distance <= closest_distance )
            {
                
closest_id i;
                
closest_distance distance;
            }
        }
        
        if ( 
closest_id == last_id ) break;
        
gHit[id][closest_id] = true;
        if (
Time cooldown g_LastLeap[id])
        {
        
loop_count++;
        
lightning_effect(last_idclosest_id);
        
emit_sound(last_idCHAN_AUTOgSoundVOL_NORMATTN_NORM0,  PITCH_NORM);
        
ExecuteHam(Ham_TakeDamageclosest_id0iddamage0);
        
client_print(idprint_chat"Wait %i seconds until next fire!"CVAR_COOLDOWN)
        
g_LastLeap[id] = Time
        last_id 
closest_id;
        }
    }
    
    for (new 
0<= MAXSLOTSi++) gHit[id][i] = false;
    
    if ( 
closest_id == id )
    {
        
client_print(idprint_chatgMessage)
        return;
    }
}
public 
lightning_effect(idtarget_id)
{
    if ( !
is_user_alive(id) || !is_user_alive(target_id) ) return;
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(TE_BEAMENTS);
    
write_short(id);            //start entity
    
write_short(target_id);            //end entity
    
write_short(gSpriteLightning);        //sprite index
    
write_byte(0);                //starting frame
    
write_byte(1);                //frame rate in 0.1's
    
write_byte(5);                //life in 0.1's
    
write_byte(25);                //line width in 0.1's
    
write_byte(random_num(2590));        //noise amplitude in 0.1's
    
write_byte(255);            //red
    
write_byte(255);            //green
    
write_byte(255);            //blue
    
write_byte(random_num(100200));    //brightness
    
write_byte(0);                //scroll speed in 0.1's
    
message_end();
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(TE_BEAMENTS);
    
write_short(id);            //start entity
    
write_short(target_id);            //end entity
    
write_short(gSpriteLightning);        //sprite index
    
write_byte(0);                //starting frame
    
write_byte(1);                //frame rate in 0.1's
    
write_byte(5);                //life in 0.1's
    
write_byte(25);                //line width in 0.1's
    
write_byte(random_num(2590));        //noise amplitude in 0.1's
    
write_byte(255);            //red
    
write_byte(255);            //green
    
write_byte(255);            //blue
    
write_byte(random_num(100200));    //brightness
    
write_byte(0);                //scroll speed in 0.1's
    
message_end();
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(TE_BEAMENTS);
    
write_short(id);            //start entity
    
write_short(target_id);            //end entity
    
write_short(gSpriteLightning);        //sprite index
    
write_byte(0);                //starting frame
    
write_byte(1);                //frame rate in 0.1's
    
write_byte(5);                //life in 0.1's
    
write_byte(25);                //line width in 0.1's
    
write_byte(random_num(2590));        //noise amplitude in 0.1's
    
write_byte(255);            //red
    
write_byte(255);            //green
    
write_byte(255);            //blue
    
write_byte(random_num(100200));    //brightness
    
write_byte(0);                //scroll speed in 0.1's
    
message_end();

what i can remove the time ? and make a this example level 5, 6 ?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
 



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 01:32.


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