Предлагаю освежённую версию, по моему мнению, вылизанную донельзя.
К глобальным переменным:
PHP код:
#if MAX_PLAYERS > 255
new players[MAX_PLAYERS];
new index[MAX_PLAYERS];
#else
new players[MAX_PLAYERS char];
new index[MAX_PLAYERS char];
#endif
new num_players;
new buf;
В public OnPlayerConnect:
PHP код:
#if MAX_PLAYERS > 255
players[index[playerid] = num_players++] = playerid;
#else
players{index{playerid} = num_players++} = playerid;
#endif
В public OnPlayerDisconnect:
PHP код:
#if MAX_PLAYERS > 255
players[index[playerid]] = players[--num_players];
#else
players{index{playerid}} = players{--num_players};
#endif
Пример перебора игроков:
PHP код:
buf = num_players;
while (buf--) {
//
}