15.03.2015, 19:50
This is wrong:
You aren't looping through connected players, you are just looping 500 times, and then checks and continues if there's a playerid with that number (0-500)
As seen in the a_samp.inc:
Using MAX_PLAYERS is just the same as using 500.
That's what the foreach loop is good for, as it only loops through connected players.
Although if you want, you can re-define MAX_PLAYERS in your script, by doing this:
Will define MAX_PLAYERS as 200 instead, which is a good method if your server doesn't have 500 slots.
pawn Код:
for (new ii = 0; ii < MAX_PLAYERS; ii++) { // we loop through all connected players - could use foreach for faster processing
As seen in the a_samp.inc:
pawn Код:
#define MAX_PLAYERS (500)
That's what the foreach loop is good for, as it only loops through connected players.
Although if you want, you can re-define MAX_PLAYERS in your script, by doing this:
pawn Код:
#undefine MAX_PLAYERS
#define MAX_PLAYERS 200

