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

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
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(playerid, "missionJoined"))
            {
                    ++totalPlayers;
            }
    }
    return totalPlayers;
}
Then use it for example like this:
pawn Код:
format(string, sizeof(string), "Total players in the mission: %d", TotalPlayersJoined());
pawn Код:
GetPVarInt(playerid, "missionJoined"))// This should not be player id but "i"
How to do so if atleast 3 players won't join the mission it will be canceled?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)