06.10.2011, 19:41
Quote:
Hey,
Код:
for(new i = 0; i < MAX_PLAYERS; i++) |
eg:-
ur loop has started NOW
i = 0
it checks if 0< Max players.. if true
then i++
now i = 1
check again.. if true
i++
in short this loop will go on till 'i' = Max Players
u can use this at many places in pawno like if you want check for player being admin u run this loop.. since i<maxplayers.. Ids of players start from 0 will go on till Maxplayers.. that is total players on ur server..
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i)) SendClientMessage(blhablha);
}
i = 0 goes to id 0 checks if hes admin.. answer no but i is < maxplayers is true so i++
i=1 goest to id 1 checks if hes admin.. answer yes,, send client message , i < maxplayers is true so i++
in short this is a 'LOOP'
i = starting point
i<'x' = limit of loop
i++ = increase counter