Thread: Useful Snippets
View Single Post
Old 28/01/2007, 02:18 PM   #4
Sacky
Big Clucker
 
Join Date: Aug 2006
Posts: 78
Reputation: 0
Default Re: Useful Snippets

Quote:
That won't work, you're assuming that all players are consecutive, which is rarely the case, you could have 10 players max, but only players 1, 4, 7 and 9 connected, which would make the max thing 9, saving almost nothing, and you would still need to check for connection.
No I'm not assuming there consecutive, check my code again, i find the highest playerid according to OnPlayerConnect and make the max loop that, then when a player disconnects i reevaluate the highest playerid

since basically all MAX_PLAYERS loops try to loop according to playerids you only need the highest one, hence this is more efficient
Sacky is offline   Reply With Quote