Quote:
Originally Posted by Dolpin
|
Antes de mostrares o link aconselho-te a ler tambem, este pequeno quote chega:
Quote:
Originally Posted by Slice
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.
pawn Код:
for ( new i = 0, l = GetMaxPlayers( ); i < l; i++ ) { if ( IsPlayerConnected( i ) ) { // ... } }
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:
pawn Код:
#undef MAX_PLAYERS #define MAX_PLAYERS (20)
|