Foreach and for loops
#2

They work fine together. You should only use foreach when you want to do someone to connected players. If you want to, for example set the values of an array for every slot you need to use for().

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    somevar[i] = -1;
}
Reply


Messages In This Thread
Foreach and for loops - by CONTROLA - 29.05.2012, 07:42
Re: Foreach and for loops - by MP2 - 29.05.2012, 09:07
Re: Foreach and for loops - by CONTROLA - 29.05.2012, 09:35
Re: Foreach and for loops - by CONTROLA - 29.05.2012, 09:42
Re: Foreach and for loops - by CONTROLA - 29.05.2012, 09:55
Re: Foreach and for loops - by iggy1 - 29.05.2012, 09:56
Re: Foreach and for loops - by CONTROLA - 29.05.2012, 09:59
Re: Foreach and for loops - by iggy1 - 29.05.2012, 10:03

Forum Jump:


Users browsing this thread: 2 Guest(s)