04.07.2009, 17:09
g-Max Players
Version: 0.2-Fixed
Description: Replace MAX_PLAYERS (200) to gMaxPlayers(Current online Players) pawn Код:
#include <a_samp>
new gMaxPlayers;
public OnFilterScriptInit(){
gMaxPlayers=0;
}
public OnPlayerConnect(playerid)
{
if(gMaxPlayers < playerid) gMaxPlayers = playerid;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(gMaxPlayers == playerid){
for(new i = playerid-1; i >= 0; i--) {
if(IsPlayerConnected(i)) {
gMaxPlayers = i;
break;
}
}
}
return 1;
}
pawn Код:
public Example();
public Example() {
for(new i = 0; i < gMaxPlayers; i++){
return 1;
}
return 1;
}