SA-MP Forums Archive
Checkpoint - 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 (/showthread.php?tid=622843)



Checkpoint - AnoTek - 27.11.2016

How can i put a checkpoint to show the player where he can start work if he is not in /work area

Код:
CMD:work(playerid, params[])
{
	new rand = random(sizeof(CursaRandomDrug));
    if(PlayerInfo[playerid][pJob] >= 1)
	{
		if(IsPlayerInRangeOfPoint(playerid,10.0,-2546.0862,9.2330,16.4219))
		{
			if(drugdj[playerid] == 1) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}Wait 3 minutes to start another race!");
			{
				new Float:x, Float:y, Float:z, Float:a;
				GetPlayerPos(playerid, x,y,z); 
				GetPlayerFacingAngle(playerid, a);
				new vehicleid = CreateVehicle(459, x+3,y,z, a, -1, -1, -1);
				SetPlayerCheckpoint(playerid, CursaRandomDrug[rand][0], CursaRandomDrug[rand][1], CursaRandomDrug[rand][2], CursaRandomDrug[rand][3]);
				PutPlayerInVehicle(playerid, vehicleid, 0);
				drugdj[playerid] = 1;
				if(rand == 0)
				{
					TextDrawShowForPlayer(playerid, avispa);
				}
				if(rand == 1)
				{
					TextDrawShowForPlayer(playerid, eba);
				}
				if(rand == 2)
				{
					TextDrawShowForPlayer(playerid, btp);
				}
				if(rand == 3)
				{
					TextDrawShowForPlayer(playerid, jzh);
				}
			}
		}
	}
I want the chekpoint to be put if the player is not in /work area after he type /work and press enter


Re: Checkpoint - BrianFaria - 27.11.2016

if (!IsPlayerInRangeOfPoint(playerid, position.......)) return SendClientMessage(playerid, -1, "You're not in the right place");