/armorall and /healall
#10

Quote:
Originally Posted by FalconX
Посмотреть сообщение
It is always better to use foreach instead of using "for" (normal) loop.

-FalconX
Wrong, using single statements in a regular 'for' loop is considerably better than using foreach. Also, if you're gonna check for a SA:MP 'variable' in a loop, it's better to use foreach. Examples of where 'for' is better:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerAdmin(i))
    {
        // code
    }
}
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    variable[i] = 0;
}
Reply


Messages In This Thread
/armorall and /healall - by imnoob - 04.06.2012, 14:47
Re: /armorall and /healall - by dannyk0ed - 04.06.2012, 14:49
Re: /armorall and /healall - by doreto - 04.06.2012, 14:50
AW: /armorall and /healall - by Drebin - 04.06.2012, 14:51
Re: AW: /armorall and /healall - by dannyk0ed - 04.06.2012, 14:52
Re: AW: /armorall and /healall - by imnoob - 04.06.2012, 20:00
Re: AW: /armorall and /healall - by DaRealShazz - 04.06.2012, 20:08
Re: /armorall and /healall - by AbO.SbRe - 04.06.2012, 20:13
Re: /armorall and /healall - by FalconX - 04.06.2012, 20:17
Re: /armorall and /healall - by SuperViper - 04.06.2012, 20:23

Forum Jump:


Users browsing this thread: 1 Guest(s)