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?