Posts: 2,799
Threads: 95
Joined: Jun 2006
Reputation:
0
new i = 0; << creates a new variable named "i" and initializes it to 0
i < MAX_PLAYERS; << keep running through the loop while the value of i is less than the maximum number of players
i++ << increment the variable i by 1 each time the loop recycles. This is done until i equals the maximum number of players
Anything inside the first { and last } is executed each time the loop makes a pass. We added IsPlayerConnected to ensure that the server doesn't attempt to run code on a playerid that doesn't exist. At the least this will cause the loop to take longer than it should, and at the worst it will crash the server as it tries to run code on someone who isnt there.