06.04.2013, 13:56
Well foreach basically does the following for you:
is the same as:
It's quicker to use foreach, and much more efficient, hence its wide usage throughout sa-mp servers. There's a full thread explaining its uses. Also, I would have to say that creating a loop within OnPlayerUpdate for EVERY player connected, would have to cause much more usage when compared to using the simple 'playerid'. That's general knowledge I am speaking of, although I have no sufficient evidence to actually back up my claim such as how usage is generated etc.
pawn Код:
foreach(Player, i)
{
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{