Im trying to set a task using set_task:
the "Task" it has to do is supposed to be defined by a variable.
here is my code:
Code:
public level4(id)
{
new frags = get_user_frags(id)
new death = get_user_deaths(id)
if (frags > 59 && death <= 30)
{
new thing[64]
new ONOFF = get_cvar_string("offon",thing,63)
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
client_print(id,print_chat,"[MR]: Congrats!! You have reached Level 4!")
cs_set_user_model(id, "leet_t")
set_task(1.0, ONOFF)
}
else if(userTeam == CS_TEAM_CT)
{
client_print(id,print_chat,"[MR]: Congrats!! You have reached Level 4!")
cs_set_user_model(id, "leet_ct")
set_task(1.0, ONOFF)
}
}
}
i want the set_task to be defined by the variable but it doesnt work :S wont compile
Code:
public level4(id)
{
new frags = get_user_frags(id)
new death = get_user_deaths(id)
if (frags > 59 && death <= 30)
{
new thing[64]
new ONOFF = get_cvar_string("offon",thing,63)
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T)
{
client_print(id,print_chat,"[MR]: Congrats!! You have reached Level 4!")
cs_set_user_model(id, "leet_t")
set_task(1.0, "ONOFF") // also tried like this but dint work
}
else if(userTeam == CS_TEAM_CT)
{
client_print(id,print_chat,"[MR]: Congrats!! You have reached Level 4!")
cs_set_user_model(id, "leet_ct")
set_task(1.0, "ONOFF") // I ALSO TRIED LIKE THIS BUT DINT WORK
}
}
}
__________________