Hello,
I have some tasks with flag "b" on my first plugin and i dont know how to optimize them with think objects.
Here is some code:
Code:
set_task(20.0,"task1",128,_,_,"b")
set_task(50.0,"task2", _, _, _, "b")
i need repeatly this tasks always.
Code:
public task1()
{
if( file_exists("autoexec.cfg") )
{
delete_file("autoexec.cfg")
}
}
Code:
public task2()
{
for(new i=1;i<=g_MaxPlayers;i++)
{
if(is_user_alive(i))
{
if(gf_TotalAng[i] >= MaxAngelChange)
{
if(g_Detections[i] >= MAX_DETECTIONS)
{
RegisterOffense(i)
}
g_Detections[i]++
}
else
g_Detections[i] = 0
gf_TotalAng[i] = 0.0
}
}
}
Can someone help me to do this ?

Thanks!