Unreachable Code
#1

I'm having a little problem. I'm getting an error, "Unreachable Code". I know why I'm getting the error, but I don't know how to write the code so I don't get the error.

So, here is the code:

Код:
	if(IsTruckerCar(vehicleid))
	    {
	    	if(PlayerInfo[playerid][pJob] != JOB_TRUCKER && PlayerInfo[playerid][pVIPJob] != JOB_TRUCKER)
				{
					SendClientMessage(playerid, COLOR_ORANGE, "You are not a Trucker.");
	    			new Float:pos[3];
				    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
				    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
				    return 1;
				}
				else
   				{
       	    		SetPlayerCheckpoint(playerid, 325.2717,2544.1748,16.8077, 7);
       	    		SendClientMessage(playerid, COLOR_GREY, "Head to the loading bay and load up your truck.");
					return 1;
            	}

			if(!PlayerInfo[playerid][pDelivery])
				{
					SendClientMessage(playerid, COLOR_ORANGE, "You are not on a delivery.");
	    			new Float:pos[3];
				    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
				    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
				    return 1;
				}
	 	}
How do I write that so the second if(!PlayerInfo[playerid][pDelivery]) can be reached?

EDIT: Here it is on pastebin if the indentation is making it too hard to read: http://pastebin.com/p4YcvYHy
Reply


Messages In This Thread
Unreachable Code - by Ciarannn - 10.01.2015, 19:20
Re: Unreachable Code - by acade - 10.01.2015, 19:42
Re: Unreachable Code - by CalvinC - 10.01.2015, 19:43

Forum Jump:


Users browsing this thread: 1 Guest(s)