A little question about timers
#1

which of theese is less laggy?

pawn Код:
new timerid[MAX_PLAYERS];
forward function[playerid];

public OnPlayerConnect(playerid)
{
timerid[playerid]=SetTimerEx("Function",150,1,"d",playerid);
return 1;
}

public Function(playerid)
{
//Something here
return 1;
}
pawn Код:
new timerid;
forward Function();

public OnGameModeInit()
{
timerid=SetTimer("Function",150,1);
return 1;
}

public Function()
{
    for (new playerid=0; playerid<MAX_PLAYERS; playerid++)
    {
    //Something here
    }
return 1;
}
Reply
#2

What about in general? I would also like to know if it's better to use timers per player or timers which loop through players (foreach). But not on that kind of interval, just 1000-60000.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)