Question with this checkpoint
#1

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498)
 	{
		if(PlayerJobInfo[playerid][UPSduty] == 2)
		{
		    DisablePlayerCheckpoint(playerid);
			PlayerJobInfo[playerid][UPSduty] = 8;
			SetPlayerCheckpoint(playerid,2391.0957,-2095.6282,13.5538,5.0);
			SendClientMessage(playerid, -1, "*Get back to the trucker job area in order to get your paycheck!");
			PlayerJobInfo[playerid][UPScargo] = 0;
			return 1;
   		}
   		else if(PlayerJobInfo[playerid][UPSduty] == 3)
   		{
		    DisablePlayerCheckpoint(playerid);
			PlayerJobInfo[playerid][UPSduty] = 8;
			SetPlayerCheckpoint(playerid,2391.0957,-2095.6282,13.5538,5.0);
			SendClientMessage(playerid, -1, "*Get back to the trucker job area in order to get your paycheck!");
			PlayerJobInfo[playerid][UPScargo] = 0;
			return 1;
   		}
   		else if(PlayerJobInfo[playerid][UPSduty] == 4)
   		{
		    DisablePlayerCheckpoint(playerid);
			PlayerJobInfo[playerid][UPSduty] = 8;
			SetPlayerCheckpoint(playerid,2391.0957,-2095.6282,13.5538,5.0);
			SendClientMessage(playerid, -1, "*Get back to the trucker job area in order to get your paycheck!");
			PlayerJobInfo[playerid][UPScargo] = 0;
			return 1;
   		}
   		else if(PlayerJobInfo[playerid][UPSduty] == 5)
   		{
		    DisablePlayerCheckpoint(playerid);
			PlayerJobInfo[playerid][UPSduty] = 8;
			SetPlayerCheckpoint(playerid,2391.0957,-2095.6282,13.5538,5.0);
			SendClientMessage(playerid, -1, "*Get back to the trucker job area in order to get your paycheck!");
			PlayerJobInfo[playerid][UPScargo] = 0;
			return 1;
   		}
   		else if(PlayerJobInfo[playerid][UPSduty] == 6)
   		{
		    DisablePlayerCheckpoint(playerid);
			PlayerJobInfo[playerid][UPSduty] = 8;
			SetPlayerCheckpoint(playerid,2391.0957,-2095.6282,13.5538,5.0);
			SendClientMessage(playerid, -1, "*Get back to the trucker job area in order to get your paycheck!");
			PlayerJobInfo[playerid][UPScargo] = 0;
			return 1;
   		}
   		else if(PlayerJobInfo[playerid][UPSduty] == 7)
   		{
		    DisablePlayerCheckpoint(playerid);
			PlayerJobInfo[playerid][UPSduty] = 8;
			SetPlayerCheckpoint(playerid,2391.0957,-2095.6282,13.5538,5.0);
			SendClientMessage(playerid, -1, "*Get back to the trucker job area in order to get your paycheck!");
			PlayerJobInfo[playerid][UPScargo] = 0;
			return 1;
   		}
   		else if(PlayerJobInfo[playerid][UPSduty] == 8)
   		{
   		    if(PlayerJobInfo[playerid][UPSjoblevel] == 1)
   		    {
   		        GivePlayerMoney(playerid, 10);
   		        DisablePlayerCheckpoint(playerid);
   		        PlayerJobInfo[playerid][UPSlevel]++;
   		    }
   		    else if(PlayerJobInfo[playerid][UPSjoblevel] == 2)
   		    {
   		        GivePlayerMoney(playerid, 20);
   		        DisablePlayerCheckpoint(playerid);
   		        PlayerJobInfo[playerid][UPSlevel]++;
   		    }
			else if(PlayerJobInfo[playerid][UPSjoblevel] == 3)
			{
			    GivePlayerMoney(playerid, 30);
			    DisablePlayerCheckpoint(playerid);
			    PlayerJobInfo[playerid][UPSlevel]++;
			}
			else if(PlayerJobInfo[playerid][UPSjoblevel] == 4)
			{
			    GivePlayerMoney(playerid, 40);
			    DisablePlayerCheckpoint(playerid);
			    PlayerJobInfo[playerid][UPSlevel]++;
			}
			else if(PlayerJobInfo[playerid][UPSjoblevel] == 5)
			{
			    GivePlayerMoney(playerid, 50);
			    DisablePlayerCheckpoint(playerid);
			    PlayerJobInfo[playerid][UPSlevel]++;
			}
			else if(PlayerJobInfo[playerid][UPSjoblevel] == 6)
			{
			    GivePlayerMoney(playerid, 60);
			    DisablePlayerCheckpoint(playerid);
			    PlayerJobInfo[playerid][UPSlevel]++;
			}
			else if(PlayerJobInfo[playerid][UPSjoblevel] == 7)
			{
			    GivePlayerMoney(playerid, 70);
			    DisablePlayerCheckpoint(playerid);
			    PlayerJobInfo[playerid][UPSlevel]++;
			}
			else if(PlayerJobInfo[playerid][UPSjoblevel] == 8)
			{
			    GivePlayerMoney(playerid, 250);
			    DisablePlayerCheckpoint(playerid);
			    PlayerJobInfo[playerid][UPSlevel]++;
			}
   		}
	}
	return 1;
}
I'm having a problem with this checkpoint system. In the beginning (the checkpoints that get set via /getcargo) work 100 percent and disable when they're supposed to, and then tell them they have to go collect their pay from the truck place. However, the checkpoint doesn't pay you and then doesn't disable right after. Does anyone know what I did wrong from looking at this?
Reply
#2

Well, what you could do, is when you are using the command /getcargo, do something like this:
pawn Код:
CP[playerid] = 1; //or whatever ID it is, similiar to dialog ID systems then do a switch(CP[playerid]); in your OnPlayerEnterCheckpoint.
Be sure you create the CP variable towards the top of your script.
Reply
#3

Quote:
Originally Posted by nmader
Посмотреть сообщение
Well, what you could do, is when you are using the command /getcargo, do something like this:
pawn Код:
CP[playerid] = 1; //or whatever ID it is, similiar to dialog ID systems then do a switch(CP[playerid]); in your OnPlayerEnterCheckpoint.
Be sure you create the CP variable towards the top of your script.
Thank you for your response, I fixed it a while ago but I didn't want to bump my topic. I ended up doing something similar to that, and it worked well.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)