How to know how match player joined the mission?
#8

Example:

Put this under your command which the players use to join the mission:
pawn Код:
SetPVarInt(playerid, "missionJoined", true);
Put this where they leave the mission:
pawn Код:
SetPVarInt(playerid, "missionJoined", false);
This at the end of the script:
pawn Код:
stock TotalPlayersJoined()
{
    new
            i,
            totalPlayers
    ;
    for( ; i != MAX_PLAYERS; ++i)
    {
            if(IsPlayerConnected(i) && !IsPlayerNPC(i) && GetPVarInt(i, "missionJoined"))
            {
                    ++totalPlayers;
            }
    }
    return totalPlayers;
}
Then use it for example like this:
pawn Код:
format(string, sizeof(string), "Total players in the mission: %d", TotalPlayersJoined());
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)