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( ( pev( id, pev_flags ) & FL_ONGROUND2 ) )
{
if(!IsPaused[id])
{
if( get_pcvar_num( gCvar_Screenfade ))
{
new Color_red, Color_green, Color_blue;
new color[16], red[4], green[4], blue[4];
get_pcvar_string(gCvar_Color, color, 15);
parse(color, red, 3, green, 3, blue, 3);
Color_red = str_to_num(red);
Color_green = str_to_num(green);
Color_blue = str_to_num(blue);
UTIL_ScreenFade( id, {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(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
pev(id, pev_origin, PauseOrigin[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(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)
}
}
else
kz_hud_message(id, "You must be on ground to get paused")
return PLUGIN_HANDLED
}