27.05.2015, 20:22
Warning Unreachable Code?
27.05.2015, 20:26
Mind coping that code here? Line 2317 -- 2326 so I can correct it for you?
27.05.2015, 21:07
Код:
if(dialogid == 8) { if(!response){ RemoveDriverFromVehicle(playerid); return 1; } { GameTextForPlayer(playerid, "Please Wait...", 3000, 1); ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Hotwire Vehicle","You don't have the keys to this vehicle, But this can be hotwired!","Hotwire","Cancel"); return 1; } if(engine[GetPlayerVehicleID(playerid)-1] == 0) {
27.05.2015, 21:13
Indentation, identation, identation. What a horrible mess this is. Let's write that out, shall we? This is YOUR code, I have changed nothing, but the formatting.
PHP код:
if(dialogid == 8)
{
if(!response)
{
RemoveDriverFromVehicle(playerid);
return 1;
}
{ // <-- this block is unconditional, so it always gets executed
GameTextForPlayer(playerid, "Please Wait...", 3000, 1);
ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Hotwire Vehicle","You don't have the keys to this vehicle, But this can be hotwired!","Hotwire","Cancel");
return 1; // <-- hence, this return always gets executed
}
if(engine[GetPlayerVehicleID(playerid)-1] == 0) // <-- hence, this code can never be reached
{
28.05.2015, 08:33
Quote:
Indentation, identation, identation. What a horrible mess this is. Let's write that out, shall we? This is YOUR code, I have changed nothing, but the formatting.
PHP код:
|
28.05.2015, 09:22
No, I am trying to show you your mistake and the importance of proper indentation. If I (or someone else) fixes your code now you learn nothing and you'll be back here with another problem before you know it, and that doesn't help you, nor us.
Give a man a fish and you'll feed him for a day. Teach a man to fish and you'll feed him for a lifetime.
Give a man a fish and you'll feed him for a day. Teach a man to fish and you'll feed him for a lifetime.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)