Raised This Month: $ Target: $400
 0% 

PlayerPrethink, cause lags...?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-15-2009 , 13:00   PlayerPrethink, cause lags...?
Reply With Quote #1

If I want to use any of buttons,then I must better to use : fw_CmdStart?
And if speed in Cur Weapon?
Can this cause teleportical lags?

PHP Code:
public fw_PlayerPreThink(id)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    static 
Floatvelocity[3], FloatTime
    
static buttonflag
    button 
pev(idpev_button)
    
flag pev(idpev_flags)
    
Time get_gametime()
    
    if (
g_zombie[id] && PlayerClass[id] == 0)
    {
        if ( (!
g_infreezetime) && (button IN_DUCK) && (button IN_ATTACK) && (flag FL_ONGROUND))
        {
            static 
FloatcooldownFloatlheightlforce
            cooldown 
get_pcvar_float(cvar_cooldown)
            
lforce get_pcvar_num(cvar_lforce)
            
lheight get_pcvar_float(cvar_lheight)
            if (
Time cooldown g_LastLeap[id])
            { 
                
emit_sound(idCHAN_ITEMhunter_leap1.0ATTN_NORM0PITCH_NORM);
                
set_pev(idpev_buttonbutton & ~IN_ATTACK)
                
velocity_by_aim(idlforcevelocity)
                
velocity[2] = lheight
                set_pev
(idpev_velocityvelocity)
                
g_LastLeap[id] = Time
            
}
        }
    }
    if (!
g_infreezetime && g_zombie[id] && PlayerClass[id] == 0)
    {
        static 
Float:speed1speed1 get_pcvar_float(cvar_speed_hunter)
        
set_pev(idpev_maxspeedspeed1)
    }
    else if (!
g_infreezetime && g_zombie[id] && PlayerClass[id] == 1)
    {
        static 
Float:speed2speed2 get_pcvar_float(cvar_speed_boomer)
        
set_pev(idpev_maxspeedspeed2)
    }
    else if (!
g_infreezetime && g_zombie[id] && PlayerClass[id] == 2)
    {
        static 
Float:speed3speed3 get_pcvar_float(cvar_speed_smoker)
        
set_pev(idpev_maxspeedspeed3)
    }
    else if (!
g_infreezetime && g_zombie[id] && PlayerClass[id] == 3)
    {
        static 
Float:speed4speed4 get_pcvar_float(cvar_speed_tank)
        
set_pev(idpev_maxspeedspeed4)
    }
    
    return 
FMRES_IGNORED

xbatista is offline
Send a message via Skype™ to xbatista
 



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 02:26.


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