08.06.2014, 19:27
Quote:
If the value of "cmdplayers[++i]" is not -1 (has an ID of player), the expression is false and thus the loop will stop.
|

pawn Код:
while(cmdplayers[++i]!=-1 && i<MAX_PLAYERS) //change for each playerid you introduced
{
//do what you have to do with the playerid
}
cmdplayers[50];
cmdplayers[0]=12; //the while will execute for this
cmdplayers[1]=23; //the while will execute for this
cmdplayers[2]=42; //the while will execute for this
cmdplayers[3]=-1; //the while will stop
cmdplayers[4]=-1;
.
.
.
cmdplayers[49]=-1;
