on all players death once restart game mode?
#2

pawn Код:
forward Restart();

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPVarInt(playerid, "HasDied", 1);
   
    if(DeadPlayers == TotalPlayers)
    {
        SetTimer("Restart", 5000, 0);
        SendClientMessageToAll(0xFFFAFA, "All the players have died, server will restart in 5 seconds!");
    }
    return 1;
}

public Restart()
{
    SendRconCommand("gmx");
    return 1;
}

stock DeadPlayers()
{
    new deadplayers;
    for(new x=0; x<MAX_PLAYERS; x++)
    {
        if(GetPVarInt(x, "HasDied") == 1)
        {
            deadplayers++;
        }
    }
    return deadplayers;
}

stock TotalPlayers()
{
    new players;
    for(new x=0; x<MAX_PLAYERS; x++)
    {
        players++;
    }
    return players;
}
Reply


Messages In This Thread
on all players death once restart game mode? - by lSCARl - 11.08.2010, 04:54
Re: on all players death once restart game mode? - by PotH3Ad - 11.08.2010, 05:04
Re: on all players death once restart game mode? - by lSCARl - 12.08.2010, 20:39
Re: on all players death once restart game mode? - by lSCARl - 12.08.2010, 20:49
Re: on all players death once restart game mode? - by wups - 12.08.2010, 20:51
Re: on all players death once restart game mode? - by lSCARl - 12.08.2010, 20:59
Re: on all players death once restart game mode? - by lSCARl - 12.08.2010, 21:19
Re: on all players death once restart game mode? - by wups - 14.08.2010, 07:11

Forum Jump:


Users browsing this thread: 1 Guest(s)