OnPlayerEnterCheckpoint Not working
#1

Hi,

I'm trying to make simple an RP Fedex job.

I'm creating the SetPlayerCheckpoint, then i want the player to go thorugh the checkpoints and every checkpoint he enter another checkpoint appears and the last dissapears.

But it doesn't appears after entering the first checkpoint.

So here's the code:

Код:
new FedexJob[MAX_PLAYERS];
new FedexStep[MAX_PLAYERS];
Using Enum
Код:
DrivingStep[playerid] = 0; FedexJob[playerid] = 0;
Then Creating Command
Код:
CMD:loadmail(playerid, params[])
{
    FedexJob[playerid] = 1;
    FedexStep[playerid] = 1;
    SetPlayerCheckpoint(playerid,1965.1832,-1992.3107,13.4766,5);
    return 1;
}
Then under public OnPlayerEnterCheckpoint(playerid)
Код:
if(IsFedexVehicle(playerid))
{
	if(FedexJob[playerid] == 1) // Fedex Route
	{
		if(IsPlayerInRangeOfPoint(playerid,5,1965.1832,-1992.3107,13.4766)) // Checkpoint 1
		{
			FedexStep[playerid] = 2;
			SetPlayerCheckpoint(playerid,1932.7761,-1777.1222,13.1099,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1932.7761,-1777.1222,13.1099)) // Checkpoint 2
		{
			FedexStep[playerid] = 3;
			SetPlayerCheckpoint(playerid,2095.7678,-1799.1807,13.1115,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,2095.7678,-1799.1807,13.1115)) // Checkpoint 3
		{
			FedexStep[playerid] = 4;
			SetPlayerCheckpoint(playerid,2245.0481,-1659.6323,15.0141,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,2245.0481,-1659.6323,15.0141)) // Checkpoint 4
		{
			FedexStep[playerid] = 5;
			SetPlayerCheckpoint(playerid,1696.4751,-1505.9568,13.1099,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1696.4751,-1505.9568,13.1099)) // Checkpoint 5
		{
			FedexStep[playerid] = 6;
			SetPlayerCheckpoint(playerid,1533.3690,-1658.0847,13.1099,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1533.3690,-1658.0847,13.1099)) // Checkpoint 6
		{
			FedexStep[playerid] = 7;
			SetPlayerCheckpoint(playerid,1325.7488,-1568.8619,13.0892,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1325.7488,-1568.8619,13.0892)) // Checkpoint 7
		{
			FedexStep[playerid] = 8;
			SetPlayerCheckpoint(playerid,1227.0610,-1826.7629,13.1372,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1227.0610,-1826.7629,13.1372)) // Checkpoint 8
		{
			FedexStep[playerid] = 9;
			SetPlayerCheckpoint(playerid,1357.6099,-1754.7562,13.0843,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1357.6099,-1754.7562,13.0843)) // Checkpoint 9
		{
			FedexStep[playerid] = 10;
			SetPlayerCheckpoint(playerid,1734.1602,-1736.1362,13.1144,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1734.1602,-1736.1362,13.1144)) // Checkpoint 10
		{
			FedexStep[playerid] = 11;
			SetPlayerCheckpoint(playerid,1772.5981,-1736.2996,13.1099,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1772.5981,-1736.2996,13.1099)) // Checkpoint 11
		{
			FedexStep[playerid] = 12;
			SetPlayerCheckpoint(playerid,1958.0129,-1980.9946,13.1177,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1958.0129,-1980.9946,13.1177)) // Checkpoint 12
		{
			FedexStep[playerid] = 13;
			SetPlayerCheckpoint(playerid,1787.9861,-2059.3037,13.3097,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1787.9861,-2059.3037,13.3097)) // Checkpoint DONE
		{
			FedexJob[playerid] = 0;
			FedexStep[playerid] = 0;
			GiveDodMoney(playerid, 5000);
			SendClientMessage(playerid, COLOR_LIGHTGREEN, "Thank you for delivering mails for the businesses. Job is done. Heres Your Paycheck, {FF6347}5000${FFFFFF}.");
		}
	}
}// FEDEX END
So, anyone knows why after entering the first Checkpoint it dissapears and the 2nd checkpoint doesn't appears?
Reply


Messages In This Thread
OnPlayerEnterCheckpoint Not working - by maximthepain - 04.11.2013, 14:53
AW: OnPlayerEnterCheckpoint Not working - by Skimmer - 04.11.2013, 15:10
Re: AW: OnPlayerEnterCheckpoint Not working - by maximthepain - 04.11.2013, 15:16
Re: OnPlayerEnterCheckpoint Not working - by Tagathron - 04.11.2013, 15:18
AW: OnPlayerEnterCheckpoint Not working - by Skimmer - 04.11.2013, 15:21
Re: OnPlayerEnterCheckpoint Not working - by maximthepain - 04.11.2013, 15:23
Re: OnPlayerEnterCheckpoint Not working - by Pottus - 04.11.2013, 15:24

Forum Jump:


Users browsing this thread: 2 Guest(s)