30.07.2009, 05:22
Quote:
Originally Posted by kazai
but i assume that means it would leave out the last player.
|
When you create an array of MAX_PLAYERS cells, say 200, then the valid cells are from 0 to 199. And the max playerid that a player can be is 199.
When you use i <= MAX_PLAYERS, the last iteration will 'call' cell 200 (IsPlayerWorking[200]), which is an invalid cell, and will most likely crash your script.
That is the correct loop:
pawn Код:
for( new i = 0; i < MAX_PLAYERS; i ++ )