Hi, Im using
prokreedz 2.27 and have problem with the spectator HUD.
First the Code
PHP Code:
public timer_task()
{
for(new i=1;i<=MaxPlayers;i++)
{
if ( get_pcvar_num(kz_show_timer) == 1 ) // Only do the code if the Cvar is 1..
{
if (is_user_alive(i))
{
if( is_user_connected(i) && timer_started[i])
{
new Float:kreedztime = get_gametime() - (IsPaused[i] ? get_gametime() - g_pausetime[i] : timer_time[i])
if( ShowTime[i] == 1 )
{
new colors[12], r[4], g[4], b[4];
new imin = floatround(kreedztime / 60.0,floatround_floor)
new isec = floatround(kreedztime - imin * 60.0,floatround_floor)
get_pcvar_string(kz_hud_color, colors, 11)
parse(colors, r, 3, g, 3, b, 4)
set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.40, 0.10, 0, 0.0, 1.0, 0.0, 0.0, -1)
show_hudmessage(i, "Time: %02d:%02d | CPs: %d | TPs: %d ",imin, isec,checknumbers[i], gochecknumbers[i])
}
else
if( ShowTime[i] == 2 )
{
kz_showtime_roundtime(i, floatround(kreedztime))
}
}
if( get_pcvar_num(kz_godmode) == 1 )
set_user_godmode(i, 1)
else
set_user_godmode(i, 0)
}
else //Here is the Spec HUD
{
new specmode = pev(i, pev_iuser1)
if(specmode == 2 || specmode == 4)
{
new target = pev(i, pev_iuser2)
if(target != i)
if(is_user_alive(target) && timer_started[target])
{
new name[32], colors[12], r[4], g[4], b[4];
get_user_name (target, name, 31)
new Float:kreedztime = get_gametime() - (IsPaused[target] ? get_gametime() - g_pausetime[target] : timer_time[target])
new imin = floatround(kreedztime / 60.0,floatround_floor)
new isec = floatround(kreedztime - imin * 60.0,floatround_floor)
get_pcvar_string(kz_hud_color, colors, 11)
parse(colors, r, 3, g, 3, b, 4)
set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.40, 0.10, 0, 0.0, 1.0, 0.0, 0.0, -1)
show_hudmessage(i, "Time: %02d:%02d | CPs: %d | TPs: %d %s ",imin, isec, checknumbers[target], gochecknumbers[target], IsPaused[target] ? "| *Paused*" : "")
}
}
}
}
}
}
Ive command the part where the the cvar and spechud message begin..So when the cvar is "1" the Spec HUD works.
Everytime a user is spec the hudmessage should work. But now its only work if the cvar is "1"...
The problem is I wont set the cvar to 1 because it changed it in the whole code and I only want it for this single function.
Hope you understand what I mean