Unreachable Code
#3

pawn Код:
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]);
            }
            else
            {
                SetPlayerCheckpoint(playerid, 325.2717,2544.1748,16.8077, 7);
                SendClientMessage(playerid, COLOR_GREY, "Head to the loading bay and load up your truck.");
            }
            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;
Instead of using 2 returns in each function, use 1 in the end like above.
Otherwise you will get the unreachable code warning.
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)