How to know how match player joined the mission? -
ZamaXor - 05.11.2010
I have a mission command. I want to know after 30 seconds how match players has joined the mission.
pawn Код:
dcmd_join(playerid, params[])
{
SendClientMessage(playerid, Color, "You joined the mission " Get or die"");
SetTimerEx("SpawnInMission",30000,0,"d",playerid);
return 1;
}
public SpawnInMission()
{
//How players joined the mission.
//My other stuff that i dont want to show.
}
Re: How to know how match player joined the mission? -
Retardedwolf - 05.11.2010
pawn Код:
new MissionPlayers;
public SpawnInMission ( playerid )
{
MissionPlayers++;
}
Re: How to know how match player joined the mission? -
Kitten - 05.11.2010
Quote:
Originally Posted by ZamaXor
I have a mission command. I want to know after 30 seconds how match players has joined the mission.
pawn Код:
dcmd_join(playerid, params[]) { SendClientMessage(playerid, Color, "You joined the mission " Get or die""); SetTimerEx("SpawnInMission",30000,0,"d",playerid); return 1; }
public SpawnInMission() { //How players joined the mission. //My other stuff that i dont want to show. }
|
EDIT: Retardedwolf posted it.
Re: How to know how match player joined the mission? -
ZamaXor - 05.11.2010
Quote:
Originally Posted by Kitten
i could not understand u much but i think this is what u mean
pawn Код:
public SpawnInMission() { new name[MAX_PLAYER_NAME], string[100]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "[MISSION] %s has gone to /mission", name ); SendClientMessageToAll(your color, string); return 1; }
|
No i mean something like that
pawn Код:
public SpawnInMission()
{
new name[MAX_PLAYER_NAME], string[100];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Mission started. Player in mission (GET THE NUMBER OF PLAYERS THAT JOINED THE MISSION)",name );
SendClientMessageToAll(your color, string);
return 1;
}
Re: How to know how match player joined the mission? -
Kitten - 05.11.2010
Quote:
Originally Posted by ZamaXor
No i mean something like that
pawn Код:
public SpawnInMission() { new name[MAX_PLAYER_NAME], string[100]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "Mission started. Player in mission (GET THE NUMBER OF PLAYERS THAT JOINED THE MMISSION)", name ); SendClientMessageToAll(your color, string); return 1; }
|
Oh. SO is that what u needed?
EDIT: if u are not using name just use SendClientMessage(playerid,color,"Mission Started. Player in mission");
Re: How to know how match player joined the mission? -
ZamaXor - 05.11.2010
Quote:
Originally Posted by Kitten
Oh. SO is that what u needed?
|
I don't know how to do it. example "Mission has Started: Players (HOW MANY PLAYERS HAS JOINED THE MISSION)"
example "Mission has Started: Players (10)"
Re: How to know how match player joined the mission? -
Kitten - 05.11.2010
use retardedwolf code
pawn Код:
new MissionPlayers;
public SpawnInMission ( playerid )
{
MissionPlayers++;
format(string, sizeof(string), "Mission started. Player in mission (%d)", MissionPlayers );
SendClientMessageToAll(your color, string);
}
im not sure
Re: How to know how match player joined the mission? -
RyDeR` - 05.11.2010
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());
Re: How to know how match player joined the mission? -
ZamaXor - 05.11.2010
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?
Re: How to know how match player joined the mission? -
(SF)Noobanatior - 05.11.2010
wrong post