Checkpoint problem!
#1

Hi guys I have problem with check points for bus driver job. It looks like player isn't entered in check point. Check point just remain and nothing is going to happend. So can someone look at this code and correct that code please?

Code:
	if (BusrouteEast[playerid][0] != 0)
	{
		if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
		{
			new nextstop[64];
			BusrouteWest[playerid][0] = 0;
		    switch(BusrouteEast[playerid][0])
		    {
		        case 1:
		        {
					nextstop = "Airport";
		            SetPlayerCheckpoint(playerid, 1979.7369,-2171.4861,13.5363, 5.0);
					AdvertiseToPlayersAtBusStop(1979.7369,-2171.4861,13.5363, 0);
				}
				case 2:
				{
					nextstop = "Willowfield Factory";
				    SetPlayerCheckpoint(playerid, 2227.6953,-2201.9053,13.5164, 5.0);
					AdvertiseToPlayersAtBusStop(2227.6953,-2201.9053,13.5164, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 3:
				{
					nextstop = "Loco";
				    SetPlayerCheckpoint(playerid, 2719.9419,-2030.2104,13.5076, 5.0);
					AdvertiseToPlayersAtBusStop(2719.9419,-2030.2104,13.5076, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 4:
				{
					nextstop = "6 Street Plaza";
				    SetPlayerCheckpoint(playerid, 2470.8059,-1926.7136,13.5125, 5.0);
					AdvertiseToPlayersAtBusStop(2470.8059,-1926.7136,13.5125, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 5:
				{
					nextstop = "10 Green Bottles";
				    SetPlayerCheckpoint(playerid, 2348.0249,-1695.8247,13.5286, 5.0);
					AdvertiseToPlayersAtBusStop(2348.0249,-1695.8247,13.5286, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 6:
				{
					nextstop = "Pigpen";
				    SetPlayerCheckpoint(playerid, 2422.4092,-1251.1915,23.9176, 5.0);
					AdvertiseToPlayersAtBusStop(2422.4092,-1251.1915,23.9176, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 7:
				{
					nextstop = "Golden Palm";
				    SetPlayerCheckpoint(playerid, 2717.7463,-1218.8141,64.9276, 5.0);
					AdvertiseToPlayersAtBusStop(2717.7463,-1218.8141,64.9276, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 8:
				{
					nextstop = "Jefferson Motel";
				    SetPlayerCheckpoint(playerid, 2173.1165,-1114.3069,25.4259, 5.0);
					AdvertiseToPlayersAtBusStop(2173.1165,-1114.3069,25.4259, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 9:
				{
					nextstop = "Glen Park";
				    SetPlayerCheckpoint(playerid, 2028.4354,-1259.1379,23.9287, 5.0);
					AdvertiseToPlayersAtBusStop(2028.4354,-1259.1379,23.9287, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 10:
				{
					nextstop = "Bus Stanica";
				    SetPlayerCheckpoint(playerid, 1818.2919,-1873.9821,13.4141, 5.0);
					AdvertiseToPlayersAtBusStop(1818.2919,-1873.9821,13.4141, 0);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 11:
				{
					nextstop = "end";
					TogglePlayerControllable(playerid, 0);
     				new stringa[128];
 		      		format(stringa,sizeof(stringa),"{FFFFFF}Bonus: {B8FF02}%d$\n{FFFFFF}Zarada: {FF0000}%d$",300,1200);
 		      		ShowPlayerDialog(playerid,9999,DIALOG_STYLE_MSGBOX,"{FFFFFF}Posao | {FFFF33}Info",stringa,"U redu","");
				    DisablePlayerCheckpoint(playerid);
				}
			}
			BusrouteEast[playerid][0]++;
			if (strcmp(nextstop, "end", true) != 0)
			{
				format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~r~$3 Bonus~n~~n~~g~Sledece Stajanje: %s", nextstop);
				format(string2, sizeof(string2), "~n~~n~~n~~n~~n~~n~~n~~g~Sledece Stajanje: %s", nextstop);
			}
			else
			{
				string = "~g~Kraj Rute~n~~n~~r~$50 bonus~n~~n~~w~/linija da nastavite rutu";
				string2 = "~n~~g~Kraj Rute~n~~n~~w~Molimo vas napustite bus ili sacekajte sledece stajanje";
				DajNovac (playerid, 47);
			}
			PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
			for (new i=0; i<=MAX_PLAYERS; i++)
			{
				if (IgracLogovan[i] == 1 &&  GetPlayerVehicleID(i) == BusrouteEast[playerid][1])
				{
					if (BusrouteEast[i][0] != 0) GameTextForPlayer(i, string, 10000, 3);
					else GameTextForPlayer(i, string2, 10000, 3);
				}
			}
			DajNovac (playerid, 3);
			return 1;
		}
	}
	else if (BusrouteWest[playerid][0] != 0)
	{
		if (IsPlayerInAnyVehicle(playerid))
		{
			new nextstop[64];
			BusrouteEast[playerid][0] = 0;
		    switch(BusrouteWest[playerid][0])
		    {
		        case 1:
		        {
					nextstop = "Alhambra";
		            SetPlayerCheckpoint(playerid, 1826.8738,-1634.5306,13.5588, 5.0);
					AdvertiseToPlayersAtBusStop(1826.8738,-1634.5306,13.5588, 1);
				}
				case 2:
				{
					nextstop = "Glen Park";
				    SetPlayerCheckpoint(playerid, 1856.7260,-1211.7167,20.3898, 5.0);
					AdvertiseToPlayersAtBusStop(1856.7260,-1211.7167,20.3898, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 3:
				{
					nextstop = "Vinewood Burger";
					PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
				    SetPlayerCheckpoint(playerid, 1208.0479,-929.9481,42.9049, 5.0);
					AdvertiseToPlayersAtBusStop(1208.0479,-929.9481,42.9049, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 4:
				{
					nextstop = "Vice Theater";
				    SetPlayerCheckpoint(playerid, 1119.0096,-1137.8805,23.7597, 5.0);
					AdvertiseToPlayersAtBusStop(1119.0096,-1137.8805,23.7597, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 5:
				{
					nextstop = "BankaNovac";
					SetPlayerCheckpoint(playerid, 1443.0234,-1028.7131,23.8281, 5.0);
					AdvertiseToPlayersAtBusStop(1443.0234,-1028.7131,23.8281, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 6:
				{
					nextstop = "Rodeo";
				    SetPlayerCheckpoint(playerid, 526.6218,-1480.9631,14.5567, 5.0);
					AdvertiseToPlayersAtBusStop(526.6218,-1480.9631,14.5567, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 7:
				{
					nextstop = "Sana Maria Beach";
				    SetPlayerCheckpoint(playerid, 443.9078,-1724.8008,10.0896, 5.0);
					AdvertiseToPlayersAtBusStop(443.9078,-1724.8008,10.0896, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 8:
				{
					nextstop = "Verona Beach";
				    SetPlayerCheckpoint(playerid, 836.2728,-1788.8121,13.9260, 5.0);
					AdvertiseToPlayersAtBusStop(836.2728,-1788.8121,13.9260, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 9:
				{
					nextstop = "Pershing Square";
				    SetPlayerCheckpoint(playerid, 1508.7136,-1735.5184,13.4921, 5.0);
					AdvertiseToPlayersAtBusStop(1508.7136,-1735.5184,13.4921, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 10:
				{
					nextstop = "Bus stanica";
				    SetPlayerCheckpoint(playerid, 1818.2919,-1873.9821,13.4141, 5.0);
					AdvertiseToPlayersAtBusStop(1818.2919,-1873.9821,13.4141, 1);
					SetTimerEx("busroutestoptimer", 10000, false, "i", playerid);
					TogglePlayerControllable(playerid, 0);
					SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "{B8FF02}Morate sacekati 10 sekundi.");
				}
				case 11:
				{
					nextstop = "Kraj";
					TogglePlayerControllable(playerid, 0);
				    DisablePlayerCheckpoint(playerid);
	          	}
			}
			BusrouteWest[playerid][0]++;
			if (strcmp(nextstop, "end", true) != 0)
			{
				format(string2, sizeof(string2), "~n~~n~~n~~n~~n~~n~~n~~g~Sledece Stajanje: %s", nextstop);
			}
			else
			{
				string = "~g~Kraj rute~n~~n~~r~$50 bonus~n~~n~~w~/linija da nastavite rutu";
				string2 = "~n~~g~Kraj rute~n~~n~~w~Molimo vas napustite bus ili sacekajte sledece stajanje";
				//BurouteWest[playerid][0] = 0;
				DajNovac (playerid, 47);
			}
			PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
			for (new i=0; i<=MAX_PLAYERS; i++)
			{
				if (IgracLogovan[i] == 1 &&  GetPlayerVehicleID(i) == BusrouteWest[playerid][1])
				{
					if (BusrouteWest[i][0] != 0) GameTextForPlayer(i, string, 10000, 3);
					else GameTextForPlayer(i, string2, 10000, 3);
				}
			}
			DajNovac (playerid, 3);
			return 1;
		}
	}
	if (BusShowLocationC[playerid] == 1)
	{
		DisablePlayerCheckpoint(playerid);
		BusShowLocationC[playerid] = 0;
		return 1;
	}
Reply
#2

So, please can someone help me!!!
Reply
#3

add this to each one before setplayercheckpoint in the code you showed
pawn Code:
DisablePlayerCheckpoint(playerid);
Reply
#4

Ok, thank you. I'll try it.
Reply
#5

I have added that lines to each checkpoint, but it still doesn't work. What's the problem with this checkpoints? Is there anyone who can fix this issue?
Reply
#6

Try add this to every case command

pawn Code:
case 1:
                {
                    nextstop = "Airport";
                    SetPlayerCheckpoint(playerid, 1979.7369,-2171.4861,13.5363, 5.0);
                    AdvertiseToPlayersAtBusStop(1979.7369,-2171.4861,13.5363, 0);
                    if
                    (IsPlayerInRangeOfPoint(playerid, 1979.7369,-2171.4861,13.5363, 5.0))
                    return        
                    DisablePlayerCheckpoint(playerid);
                }
Reply
#7

OMG, it still doesn't work, i put that lines in every case, but nothing changes.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)