SA-MP Forums Archive
How can I make series of checkpoints with timer? - 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: How can I make series of checkpoints with timer? (/showthread.php?tid=429271)



How can I make series of checkpoints with timer? - Daledos - 08.04.2013

Hello,
I want to put a script in my gamemode with 10 coords, that as soon as the player enters the first checkpoint and after 5 seconds it remains inside, the sect coordinate the second checkpoint to the second and so on...

Can anyone help me?
Sorry for my bad english... Thank's!


Re: How can I make series of checkpoints with timer? - Daledos - 08.04.2013

I'M SOLVED! Thank


Re: How can I make series of checkpoints with timer? - Pawnie - 08.04.2013

Код:
new CheckPointEntered;

forward CheckPointChange(playerid);
public CheckPointChange(playerid)
{
	if(CheckPointEntered[playerid] == 1)
	{
	    if(IsPlayerInCheckpoint(playerid) == true) //Checking if he/she is in checkpoint
	    {
			DisablePlayerCheckPoint(playerid);
			SetPlayerCheckPoint(); //add your checkpoints here
			CheckPointEntered[playerid] = 2; //Switching the checkpoint to number 2
		}
	}
	return 1;
}
	
public OnPlayerEnterCheckpoint(playerid)
{
    if(CheckPointEntered[playerid] == 1) //If they entered the first checkpoint
    {
        SetTimerEx("CheckPointChange", 10000, false, "i", playerid); //Setting the 10 seconds timer
	}
	return 1;
}
Edit: too late