30.09.2010, 08:22
(
Последний раз редактировалось Slice; 30.09.2010 в 08:33.
)
Looping with GetMaxPlayers is slower than MAX_PLAYERS. Also, you can't declare arrays with dynamic sizes.
https://sampforum.blast.hk/showthread.php?tid=65567
Edit:
There is one way you can use GetMaxPlayers, however.
Or you could make a new global variable called g_MaxPlayers and set it to GetMaxPlayers( ) in OnGameModeInit then use that for looping.
However, I would sugget simply re-defining MAX_PLAYERS:
https://sampforum.blast.hk/showthread.php?tid=65567
Edit:
There is one way you can use GetMaxPlayers, however.
pawn Код:
for ( new i = 0, l = GetMaxPlayers( ); i < l; i++ )
{
if ( IsPlayerConnected( i ) )
{
// ...
}
}
However, I would sugget simply re-defining MAX_PLAYERS:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS (20)