SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/05/2014, 12:21 AM   #1
Kingofthering
Little Clucker
 
Join Date: May 2014
Posts: 9
Reputation: 0
Default Checkpoint problem!

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;
	}
Kingofthering is offline   Reply With Quote
Old 26/05/2014, 06:46 PM   #2
Kingofthering
Little Clucker
 
Join Date: May 2014
Posts: 9
Reputation: 0
Default Re: Checkpoint problem!

So, please can someone help me!!!
Kingofthering is offline   Reply With Quote
Old 26/05/2014, 07:28 PM   #3
XK
Huge Clucker
 
XK's Avatar
 
Join Date: Mar 2014
Location: A Rare Place
Posts: 242
Reputation: 30
Default Re: Checkpoint problem!

add this to each one before setplayercheckpoint in the code you showed
pawn Code:
DisablePlayerCheckpoint(playerid);
__________________
By XK:
And are we meant to guess your Request?

XK is offline   Reply With Quote
Old 26/05/2014, 09:49 PM   #4
Kingofthering
Little Clucker
 
Join Date: May 2014
Posts: 9
Reputation: 0
Default Re: Checkpoint problem!

Ok, thank you. I'll try it.
Kingofthering is offline   Reply With Quote
Old 28/05/2014, 10:05 PM   #5
Kingofthering
Little Clucker
 
Join Date: May 2014
Posts: 9
Reputation: 0
Default Re: Checkpoint problem!

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?
Kingofthering is offline   Reply With Quote
Old 29/05/2014, 12:01 AM   #6
Josh_Main
Huge Clucker
 
Join Date: Mar 2012
Location: Main-Hosts.com
Posts: 446
Reputation: 12
Default Re: Checkpoint problem!

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);
                }
Josh_Main is offline   Reply With Quote
Old 31/05/2014, 09:53 PM   #7
Kingofthering
Little Clucker
 
Join Date: May 2014
Posts: 9
Reputation: 0
Default Re: Checkpoint problem!

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkpoint Problem :\ ray93 Scripting Help 2 10/09/2013 11:41 AM
[HELP]Checkpoint Problem! Veeco Scripting Help 3 03/12/2012 08:42 PM
Checkpoint Problem .v Scripting Help 1 01/10/2012 01:15 PM
Checkpoint problem ajwar Help Archive 3 25/04/2011 06:58 AM
CheckPoint Problem Onyx09 Help Archive 1 21/01/2010 12:20 AM


All times are GMT. The time now is 02:13 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.