Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (
/showthread.php?tid=391912)
Help -
[rG]Cold - 12.11.2012
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?
Re: Help -
Ballu Miaa - 12.11.2012
Create a Global variable
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++;
}
}
Re: Help -
[rG]Cold - 12.11.2012
Thanks testing right now. Idk why i didnt try doing it myself at first.
Re: Help -
[rG]Cold - 12.11.2012
Works,thanks.
Sorry for the double post
![Sad](images/smilies/sad.gif)
it's late and im tired