Help needed. Don`t understand why the checkpoint is not working?!
#1

Okay, I`m working on a little Garbage Truck Driving job and I wonder why when I enter the checkpoint, I don`t get 10 dollars, the check. it`s not destroyed and the next one it`s not appearing .. The code is here

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetVehicleModel(vehicleid) == 408)
	{
	  SendClientMessage(playerid, COLOR_GOLD, "A marker should appear on your GPS with the first location! Go get the junk!");
		SetPlayerCheckpoint(playerid, 2286.6111, 2337.5051, 10.6719, 5);
		if(IsPlayerInCheckpoint(playerid))
		{
 			SendClientMessage(playerid, COLOR_GOLD, "Good! You have just earned 10$! Continue your job until this city is clean.");
			GivePlayerMoney(playerid, 10);
			DisablePlayerCheckpoint(playerid);
 			SetPlayerCheckpoint(playerid, 2524.8174, 2318.0769, 10.6719, 5);
 			if(IsPlayerInCheckpoint(playerid))
  			{
  			SendClientMessage(playerid, COLOR_GOLD, "Checkpoint reached, proceed to the next one!");
		    GivePlayerMoney(playerid, 10);
		    DisablePlayerCheckpoint(playerid);
		    return 1;
			}
		return 1;
		}
	return 1;
	}
else SendClientMessage(playerid, COLOR_GOLD, "You must use a Garbage Truck! Go get one!");
return 1;
}
Reply
#2

i actually dont see a mistake..
I would try to delete the if(IsPlayerInCheckpoint) and add that atublic OnPlayerEnterCheckpoint
Reply
#3

ok. thanks for advice xD
Reply
#4

You're only checking if the player is in the checkpoint when he enters the vehicle. That's why nothing happens. Use OnPlayerEnterCheckpoint() to check if a player is in a checkpoint
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)