13.10.2015, 16:53
Quote:
Код:
new Alives; public OnPlayerConnect(playerid) { Alives++; return 1; } public OnPlayerDisconnect(playerid, reason) { Alives--; return 1; } public OnPlayerDeath(playerid, killerid, reason) { Alives--; return 1; } |
Buddy, you should make something like
PHP код:
new Alive[MAX_PLAYERS];
PHP код:
OnPlayerConnect Alive[playerid]=0;
OnPlayerDisconnect Alive[playerid]=0;
OnPlayerDeath Alive[playerid]=0;
OnPlayerSpawn Alive[playerid]=1;
PHP код:
GetPlayersOnServer()
{
new count;
Alives=0;
for(new x=0; x< MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x)))
{
count++;
if(Alive[playerid]==1) Alives++;
}
}
return count;
}