#1

Hey.
How do i count players that enter in a Checkpoint and players needed to enter in a checkpoint?

For example i got a checkpoint and 5 players are needed to enter in it ,not at the same time.
Let's say 2 entered and its needed 3 more. How can i do that?
Reply
#2

Create a Global variable
pawn Код:
new CountCPplayer;
Use it under OnPlayerEnterCheckpoint callback!

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(//Check for right cp id for the player over here)
   {
       if(CountCPplayer >= 5)
       {
            // Do what you want to do for 5 players here!
       }
       // set this var to +1 everytime a player comes in this checkpoint
      CountCPplayer++;
   }
}
Reply
#3

Thanks testing right now. Idk why i didnt try doing it myself at first.
Reply
#4

Works,thanks.
Sorry for the double post
it's late and im tired
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)