SA-MP Forums Archive
Checkpoint answer please 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: Checkpoint answer please help. (/showthread.php?tid=457178)



Checkpoint answer please help. - darkdave - 09.08.2013

Hi, I'm new in pawno and scripting language, I want to create some checkpoints for DMV to have proper coordinates to work checkpointu must give / save when in the car or when you are not in it? Thank you for your help.


Re: Checkpoint answer please help. - Ziyan - 10.08.2013

Add one new
Код:
new CP[MAX_PLAYERS];
Under OnplayerConnect put
Код:
CP[playerid] = 0;
And make command to start a test
Код:
CMD:starttest(playerid, params[])
	{
	    if(IsPlayerInAnyVehicle(playerid))
		{
		    SendClientMessage(playerid, -1, "You have started driving test");
		    CP[playerid] = 1;
		    SetPlayerCheckpoint(playerid, X,Y,Z, checkpoint size);
		}
	}
And under public OnPlayerEnterCheckpoint put something like this
Код:
if(CP[playerid]==1)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	    	DisablePlayerCheckpoint(playerid);
			CP[playerid] = 2;
			SetPlayerCheckpoint(playerid, Next X pos,Next Y pos,Next Z pos, your checkpoint size);
		}
	}
	if(CP[playerid]==2)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	    	DisablePlayerCheckpoint(playerid);
			CP[playerid] = 3;
			SetPlayerCheckpoint(playerid, Next X pos,Next Y pos,Next Z pos, your checkpoint size);
		}
	}
And just add your coordinates and whatever you want.
Rep + if i helped you.