Help About Checkpoints
#1

Hi all. I have copied my Driving Test system and made a Pizza Delivering Job.
You should enter to a checkpoint and when you enter that checkpoint, another one seems on map. This is the basic system. But; when Pizza Checkpoint system works; Driving Test checkpoints don't work. When I enter to the first checkpoint, it doesn't show another checkpoints. I have found the wrong but I couldn't solve it. Here the codes;


Код:
Altay.pwn(16812) : error 029: invalid expression, assumed zero
Altay.pwn(16812 -- 16813) : warning 215: expression has no effect
Altay.pwn(16813) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

2 Errors.
16812. line;

Код:
        else
			{
				DisablePlayerCheckpoint(playerid);
				LicenseTest[playerid] = 0;
				CP[playerid] = 0;
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ehliyet Kurulu: Aracınıza зok hasar verdiniz, testi başaramadınız.");
   			}
  		}
 	}
 	else DisablePlayerCheckpoint(playerid);
	)
	if(PP[playerid] == 1) // Pizza taşıma
	{
  		if(IsPlayerInRangeOfPoint(playerid, 2, 2069.2146,-1656.5670,13.5469)) // Checkpoint 1
		{
      		SetPlayerCheckpoint(playerid,1824.7229,-1538.7413,13.5469, 2);
		}
		else if(IsPlayerInRangeOfPoint(playerid, 2, 1824.7229,-1538.7413,13.5469)) // Checkpoint 2
		{
		    SetPlayerCheckpoint(playerid,1467.9995,-1013.2706,26.8438, 2);
		}
		else if(IsPlayerInRangeOfPoint(playerid, 2, 1467.9995,-1013.2706,26.8438)) // Checkpoint 3
		{
			SetPlayerCheckpoint(playerid,2115.6670,-1789.8052,20.5547, 2);
		}
		else if(IsPlayerInRangeOfPoint(playerid, 2, 2115.6670,-1789.8052,20.5547)) // Checkpoint 4
		{
		    new Float:Health;
		    GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
		    if(Health > 700)
			{
				DisablePlayerCheckpoint(playerid);
				PizzaTasima[playerid] = 0;
				PP[playerid] = 0;
                GiveZaiatMoney(playerid, 750);
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Pizzacı Nuri: Aferin evlat, motoru sapasağlam getirmişsin; pizzaları da teslim etmişsin. Buyur 750 doların.");
			}
			else
			{
				DisablePlayerCheckpoint(playerid);
				PizzaTasima[playerid] = 0;
				PP[playerid] = 0;
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Pizzacı Nuri: Ula hayta, motorun anasını ağlatmışsın yok sana para mara!");
			}
		}
	}
	else DisablePlayerCheckpoint(playerid);
	return 1;
}
( This DisablePlayerCheckpoint, works. But the first one, which I made it Green doesn't work and makes error. Please help! )
public OnPlayerLeaveCheckpoint(playerid
Reply
#2

You cannot use else that way. Click this for more info.
Reply
#3

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
You cannot use else that way. Click this for more info.
So sir; how can I make that dark green '' DisableCheckPoint '' thing? If not else?
Reply
#4

Can you show the lines above these lines ? Really you might be using else in the right way but the lines you showed don't show that.
Reply
#5

The All onplayerentercheckpoint system;

Код:
if(CP[playerid] == 1) // Drivers License Test
	{
		if(IsPlayerInRangeOfPoint(playerid,5,2040.7101,-1930.1340,13.4667)) // Checkpoint 1
		{
		    SetPlayerCheckpoint(playerid,1948.1033,-1930.6860,13.4751,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,2074.2095,-1907.4380,13.6393)) // Checkpoint 2
		{
		    new Float:Health;
		    GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
		    if(Health > 900)
			{
				DisablePlayerCheckpoint(playerid);
				PlayerInfo[playerid][pCarLic] = 1;
				LicenseTest[playerid] = 0;
				CP[playerid] = 0;
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ehliyet Kurulu i almaya hak kazandınız.");
			}
			else
			{
				DisablePlayerCheckpoint(playerid);
				LicenseTest[playerid] = 0;
				CP[playerid] = 0;
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ehliyet Kuniz, testi başaramadınız.");
   			}
  		}
 	}
        else DisablePlayerCheckpoint(playerid); ( Problem is at that line)
	if(PP[playerid] == 1) // Pizza taşıma
	{
  		if(IsPlayerInRangeOfPoint(playerid, 2, 2069.2146,-1656.5670,13.5469)) // Checkpoint 1
		{
      		SetPlayerCheckpoint(playerid,1824.7229,-1538.7413,13.5469, 2);
		}
		else if(IsPlayerInRangeOfPoint(playerid, 2, 1824.7229,-1538.7413,13.5469)) // Checkpoint 2
		{
		    SetPlayerCheckpoint(playerid,1467.9995,-1013.2706,26.8438, 2);
		}
		else if(IsPlayerInRangeOfPoint(playerid, 2, 1467.9995,-1013.2706,26.8438)) // Checkpoint 3
		{
			SetPlayerCheckpoint(playerid,2115.6670,-1789.8052,20.5547, 2);
		}
		else if(IsPlayerInRangeOfPoint(playerid, 2, 2115.6670,-1789.8052,20.5547)) // Checkpoint 4
		{
		    new Float:Health;
		    GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
		    if(Health > 700)
			{
				DisablePlayerCheckpoint(playerid);
				PizzaTasima[playerid] = 0;
				PP[playerid] = 0;
                                GiveZaiatMoney(playerid, 750);
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Pizzacı Nuri: Apat temiş 750 doların.");
			}
			else
			{
				DisablePlayerCheckpoint(playerid);
				PizzaTasima[playerid] = 0;
				PP[playerid] = 0;
				SetVehicleToRespawn(GetPlayerVehicleID(playerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Pizzacı Nuri: Ula hayosını sınan mara!");
			}
		}
	}
	else DisablePlayerCheckpoint(playerid);
	return 1;
}
Reply
#6

Oops sorry you were using it right. Can I ask what is the bracket after the semi-colon? I mean this:

pawn Код:
else DisablePlayerCheckpoint(playerid);
    )  // < this. try removing it.
Reply
#7

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
Oops sorry you were using it right. Can I ask what is the bracket after the semi-colon? I mean this:

pawn Код:
else DisablePlayerCheckpoint(playerid);
    )  // < this. try removing it.
When I delete this, it recomplies well but when I start Driving Test in game, it shows just first checkpoint. Another checkpoints are not shown. normally, when I enter to first check point, another one should be shown and another one etc. please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)