/me command explanation
#5

This is wrong:
pawn Код:
for (new ii = 0; ii < MAX_PLAYERS; ii++) { // we loop through all connected players - could use foreach for faster processing
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:
pawn Код:
#define MAX_PLAYERS  (500)
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:
pawn Код:
#undefine MAX_PLAYERS
#define MAX_PLAYERS 200
Will define MAX_PLAYERS as 200 instead, which is a good method if your server doesn't have 500 slots.
Reply


Messages In This Thread
/me command explanation - by Denis1 - 15.03.2015, 19:25
Re: /me command explanation - by Blademaster680 - 15.03.2015, 19:33
Re: /me command explanation - by Denis1 - 15.03.2015, 19:37
Respuesta: /me command explanation - by alexus - 15.03.2015, 19:42
Re: /me command explanation - by CalvinC - 15.03.2015, 19:50
Re: /me command explanation - by Denis1 - 15.03.2015, 19:51
Re: /me command explanation - by Luis- - 15.03.2015, 19:58
Re: /me command explanation - by Denis1 - 16.03.2015, 05:52

Forum Jump:


Users browsing this thread: 1 Guest(s)