Checkpoint
#1

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
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)