29.04.2011, 20:59
It's better to use it because it will skip players are not connected and save memory, else it will just set health of a player that's not even connected.
I still and will always recommend foreach, easy and faster than ever loops.
Checking if the player is online is not even needed in that case.
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (!IsPlayerConnected(i)) continue;
SetPlayerPos(i, x, y, z);
}
pawn Код:
foreach(Player, i)
{
SetPlayerPos(i, x, y, z);
}