so im tring to add a cvar for fade color & i got following error :
Code:
Error: Must be a constant expression; assumed zero on line 927
code :
PHP Code:
new turbo_fadecolor[16], turbo_fade_r[4], turbo_fade_g[4], turbo_fade_b[4]
get_pcvar_string(CV_Turbo_fade,turbo_fadecolor,sizeof turbo_fadecolor -1)
parse(turbo_fadecolor, turbo_fade_r, 3,turbo_fade_g, 3,turbo_fade_b, 3)
CV_Turbo_fade_R = str_to_num(turbo_fade_r)
CV_Turbo_fade_G = str_to_num(turbo_fade_g)
CV_Turbo_fade_B = str_to_num(turbo_fade_b)
public User_has_turbo_ON(id)
{
if(is_user_alive(id) && !user_is_catcher[id])
{
if(TURBO[id][1] < get_pcvar_num(CV_Turbo_Usage_Percent))
{
TURBO[id][0] = 0
}
else if(!chilldown[id])
{
TURBO[id][0] = 1
TURBO[id][1] -= get_pcvar_num(CV_Turbo_Usage_Percent)
set_task(get_pcvar_float(CV_Turbo_Usage_Time),"turbo_task",id)
Speed_settings(id)
chilldown[id] = 1
UTIL_ScreenFade(id,{CV_Turbo_fade_R,CV_Turbo_fade_G,CV_Turbo_fade_b},1.0,2.0,80)
}
Player_Show_Stats(id)
}
}
i tried to check if is my code wrong and i got the same error.
Code:
public User_has_turbo_ON(id)
{
if(is_user_alive(id) && !user_is_catcher[id])
{
if(TURBO[id][1] < get_pcvar_num(CV_Turbo_Usage_Percent))
{
TURBO[id][0] = 0
}
else if(!chilldown[id])
{
TURBO[id][0] = 1
TURBO[id][1] -= get_pcvar_num(CV_Turbo_Usage_Percent)
set_task(get_pcvar_float(CV_Turbo_Usage_Time),"turbo_task",id)
Speed_settings(id)
chilldown[id] = 1
new r,g,b
r = 255
g = 255
b = 255
UTIL_ScreenFade(id,{r,g,b},1.0,2.0,80)
}
Player_Show_Stats(id)
}
}
any ideas?
__________________