Help With Checkpoints
#1

Hello,
so if i want 5 people to enter the checkpoint before i execute another action, how do i do that?

Ive got something but i want to enter a code to make there be 5 people who have to go in the checkpoint so i can execute another action.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	GameTextForPlayer(playerid,"~R~You have reached the control centre",4000,3);
	SendClientMessageToAll(COLOR_RED,"One of the Attackers has Reached The Control Centre");
	GivePlayerMoney(playerid, 0);
 	DisablePlayerCheckpoint(playerid);
 	return 1;
}
Does anyone know? thanks
Reply
#2

Try something like this
pawn Код:
new players_in_checkpoint;
public OnPlayerEnterCheckpoint(playerid)
{
    GameTextForPlayer(playerid,"~R~You have reached the control centre",4000,3);
    SendClientMessageToAll(COLOR_RED,"One of the Attackers has Reached The Control Centre");
    GivePlayerMoney(playerid, 0);
    DisablePlayerCheckpoint(playerid);

    if (++players_in_checkpoint == 5)
        //there are 5 players in checkpoint, do your next action

     return 1;
}
Reply
#3

pawn Код:
new CheckpointVisitors;

public OnPlayerEnterCheckpoint(playerid)
{
  GameTextForPlayer(playerid,"~R~You have reached the control centre",4000,3);
  SendClientMessageToAll(COLOR_RED,"One of the Attackers has Reached The Control Centre");
  GivePlayerMoney(playerid, 0);
  DisablePlayerCheckpoint(playerid);
  CheckpointVisitors++;
  if(CheckpointVisitors == 5)
  {
    //Do what you wan't
  }
  return 1;
}
Reply
#4

I thank you both thourghily, sorry for the newbness.

:P

SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)