Pawn error (225) Unreachable Code error , Please help!
#1

Код:
if (strcmp("/REPAIR", cmdtext, true, 10) == 0)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
    	SetVehicleHealth(vehicleid, 1000.0);
    	SendClientMessage(playerid, COLOR_GREEN, "-VEHICLE INFO- The vehicles engine has been fully repaired.");
	    return 1;
		}
}
		return 0;
		}
Thats what i have , i wwanna make a simple car repair command , and i get the error unreachable code plz help!
Reply
#2

I fixed it this way.

pawn Код:
if (strcmp("/REPAIR", cmdtext, true, 10) == 0)
    {
       new vehicleid = GetPlayerVehicleID(playerid);
              SetVehicleHealth(vehicleid, 1000.0);
           SendClientMessage(playerid, COLOR_GREEN, "-VEHICLE INFO- The vehicles engine has been fully repaired.");
       return 1;
            }
            return 1;
}
Sorry for the lines but it changes it when i post it here.
Reply
#3

but the final line needs return 0; } right?
Reply
#4

no not really.
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/repair", cmdtext, true, 7) == 0) {
        new vehicleid = GetPlayerVehicleID(playerid);
        SetVehicleHealth(vehicleid, 1000.0);
        SendClientMessage(playerid, COLOR_GREEN, "-VEHICLE INFO- The vehicles engine has been fully repaired.");
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)