I realize i posted something similar to this before it was about a normal loop and a loop called by a timer increasing a variable continuously until it reaches max players then it kills timer and resets variable value BUT you guys said that timers were only used in some cases and what not so what i wanna know now is the difference between a normal loop, the timer loop i mentioned, link : HERE
and this:
And which would be more efficient the timer one or this or the normal foreach loop? thanks in advance.
and this:
PHP Code:
CMD:healall(playerid,params[])
{
Loop();
SendClientMessage(playerid,-1,"Healed all players!");
return 1;
}
forward Loop();
public Loop()
{
new players;
if(players<MAX_PLAYERS)
{
if(IsPlayerConnected(players))
{
SetPlayerHealth(players,100);
}
players++;
}
if(players == MAX_PLAYERS)
{
players =0;
}
if(players!=0)
{
Loop();
}
return 1;
}