What does loop return if not connected?
#1

Hi, i have one question it's what does loop return if player is not connected,does it skip or goes back and try again until finds some player thats connected


Код:
                  {
                     if(GetPlayerTeam(i) == randomorg)
	            {
	              if(IsPlayerConnected(i))
	    	       { 
	               PlayerList[idx] = i;
	                idx++;
	        	}
		     }
                 }
So if there isnt any player in team "randomorg" would script go back and check again or just go on and do like if it has selected player?
If anyone undertood me i would like help Help fellow scripter Thanks in advance!
Reply
#2

If the player isn't connected, the loop would simply do nothing and continue looping through the other players.
Reply
#3

The 'for' statement is very simple.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) {
//code here.
}
Is exactly like.

pawn Код:
new i = 0;

Loop:
if(i < MAX_PLAYERS) {
//code here.

i++;
goto Loop;
}
Reply
#4

i know about for but i like it old style
@Shetch so its like this i have situation where,script selects random team,and selects random player inside that team,what if there are no players online in randomed team,what would then happend would loop go back and look for another team that has players or would it behave like it selected player?
P.S Thanks for reply
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)