25.01.2013, 22:13
Make a global variable which you increase when there's a new survivor (or a player connects) and decrease when a survivor dies (or disconnects).
Easy example:
Easy example:
pawn Код:
new TotalSurvivors=0;
public OnPlayerConnect(playerid)
{
TotalSurvivors++;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TotalSurvivors--;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new string[124], PlayerName[MAX_PLAYERNAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName);
TotalSurvivors--;
format(string, sizeof(string), "%s has died, there are %i survivors remaining.", PlayerName, TotalSurvivors);
return 1;
}