Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Again what is the difference?

$
0
0
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:
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;


And which would be more efficient the timer one or this or the normal foreach loop? thanks in advance.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>