View Single Post
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-15-2012 , 14:32   Re: (req) help me with this
Reply With Quote #4

WHAT IS WRONG HERE?


PHP Code:
public Pause(id)
{
    
    if (
get_pcvar_num(kz_pause) == 0)
    {    
        
kz_hud_message(id"Pause is disabled")
        return 
PLUGIN_HANDLED
    
}

    if(! 
timer_started[id])
    {
        
kz_hud_message(id"Timer is not started")
        return 
PLUGIN_HANDLED
    
}
    
    if(! 
is_user_alive(id) )
    {
        
kz_hud_message(id"You must be alive to use this command")
        return 
PLUGIN_HANDLED
    
}


    if( ( 
pevidpev_flags ) & FL_ONGROUND2  ) )
    {
        if(!
IsPaused[id]) 
        {
            
      if( 
get_pcvar_numgCvar_Screenfade ))
            { 
            new 
Color_redColor_greenColor_blue;
            new 
color[16], red[4], green[4], blue[4];
            
get_pcvar_string(gCvar_Colorcolor15);
            
parse(colorred3green3blue3);
            
            
Color_red str_to_num(red);
            
Color_green str_to_num(green);
            
Color_blue str_to_num(blue);
                
            
UTIL_ScreenFadeid, {gCvar_Color},1.0,0.0,75  );
            }
            
            
g_pausetime[id] =   get_gametime() - timer_time[id]
            
timer_time[id] = 0.0
            IsPaused
[id] = true
            
            kz_hud_message
(id"Your timer has been paused")
            
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN)
            
pev(idpev_originPauseOrigin[id])
            
            
        }
        else
        {
            
timer_time[id] = get_gametime() - g_pausetime[id] + timer_time[id]
            
IsPaused[id] = false
            kz_hud_message
(id"Your timer has been unpaused")
            
set_pev(idpev_flagspev(idpev_flags) & ~FL_FROZEN)
        }
    }
    else
        
kz_hud_message(id"You must be on ground to get paused")

    return 
PLUGIN_HANDLED


Last edited by bazhenov93; 03-15-2012 at 14:41.
bazhenov93 is offline