How to fix these warnings? -
Rohan_Ubhare - 12.05.2012
When I try to compile my script I get these warnings:
Код:
C:\Users\rohan\Desktop\Xtreme Roleplay 0.3e\gamemodes\x-rp.pwn(64019) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
Here is Line 64019:
PHP код:
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2102.71, -103.97, 2.28))
Please tel me the solution as soon as possible.
Thanks in Advance,
Rohan Ubhare
Re: How to fix these warnings? -
D-12 - 12.05.2012
Show me the command, there's a problem with the indentations probably.
Re: How to fix these warnings? -
iGetty - 12.05.2012
Please show 3 lines above and below that line too.
Re: How to fix these warnings? -
Rohan_Ubhare - 12.05.2012
Here is that whole thing:
PHP код:
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2102.71, -103.97, 2.28)) // Matrun 3
{
new vehicle = GetPlayerVehicleID(playerid);
if(IsABoat(vehicle))
{
if(GetPVarInt(playerid, "Packages") >= 10) return SendClientMessageEx(playerid, COLOR_GRAD2, "something
if(PlayerInfo[playerid][pDonateRank] == 1)
{
if(GetPlayerCash(playerid) > 1124)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -1125);
SetPVarInt(playerid, "Packages", 23);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"something");
SendClientMessageEx(playerid, COLOR_YELLOW,"something.");
}
else if(PlayerInfo[playerid][pDonateRank] == 2 || PlayerInfo[playerid][pDonateRank] == 3)
{
if(GetPlayerCash(playerid) > 1499)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -1500);
SetPVarInt(playerid, "Packages", 30);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* something.");
SendClientMessageEx(playerid, COLOR_YELLOW,"something.");
}
else if(PlayerInfo[playerid][pDonateRank] >= 4)
{
if(GetPlayerCash(playerid) < 1875)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -1875);
SetPVarInt(playerid, "Packages", 38);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"somethin.");
SendClientMessageEx(playerid, COLOR_YELLOW,"something.");
}
else
{
if(GetPlayerCash(playerid) < 750)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -750);
SetPVarInt(playerid, "Packages", 15);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"something");
}
SendClientMessageEx(playerid, COLOR_WHITE, "something.");
SetPVarInt(playerid, "MatDeliver", 333);
SetPVarInt(playerid, "tpMatRunTimer", 15);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPMATRUNTIMER);
SetPlayerCheckpoint(playerid, -330.44, -467.54, 0.85, 5);
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY," something");
}
return 1;
}
Re: How to fix these warnings? -
Pinguinn - 12.05.2012
You forgot to close a line.
pawn Код:
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2102.71, -103.97, 2.28)) // Matrun 3
{
new vehicle = GetPlayerVehicleID(playerid);
if(IsABoat(vehicle))
{
if(GetPVarInt(playerid, "Packages") >= 10) return SendClientMessageEx(playerid, COLOR_GRAD2, "something"); // this line
if(PlayerInfo[playerid][pDonateRank] == 1)
{
if(GetPlayerCash(playerid) > 1124)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -1125);
SetPVarInt(playerid, "Packages", 23);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"something");
SendClientMessageEx(playerid, COLOR_YELLOW,"something.");
}
else if(PlayerInfo[playerid][pDonateRank] == 2 || PlayerInfo[playerid][pDonateRank] == 3)
{
if(GetPlayerCash(playerid) > 1499)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -1500);
SetPVarInt(playerid, "Packages", 30);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* something.");
SendClientMessageEx(playerid, COLOR_YELLOW,"something.");
}
else if(PlayerInfo[playerid][pDonateRank] >= 4)
{
if(GetPlayerCash(playerid) < 1875)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -1875);
SetPVarInt(playerid, "Packages", 38);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"somethin.");
SendClientMessageEx(playerid, COLOR_YELLOW,"something.");
}
else
{
if(GetPlayerCash(playerid) < 750)
{
SendClientMessageEx(playerid, COLOR_GREY," something!");
return 1;
}
GivePlayerCash(playerid, -750);
SetPVarInt(playerid, "Packages", 15);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"something");
}
SendClientMessageEx(playerid, COLOR_WHITE, "something.");
SetPVarInt(playerid, "MatDeliver", 333);
SetPVarInt(playerid, "tpMatRunTimer", 15);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPMATRUNTIMER);
SetPlayerCheckpoint(playerid, -330.44, -467.54, 0.85, 5);
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY," something");
}
return 1;
}
Re: How to fix these warnings? -
Rohan_Ubhare - 12.05.2012
Sorry I forgot to put tht but including those brackets i get that warning
Re: How to fix these warnings? -
AndreT - 12.05.2012
You probably need to show the code that comes before the code block you just posted as well. Unreachable code is often caused by code like this:
pawn Код:
stock function()
{
if(conditional == 1)
return 1;
else
return 0;
// code which will never be reached, and it makes sense
}
Re: How to fix these warnings? -
RedWingz - 12.05.2012
Yea, I think he has a Loose Indention somewhere in the code. :/
Re: How to fix these warnings? -
Rohan_Ubhare - 13.05.2012
The code before this is:
PHP код:
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 9 && PlayerInfo[playerid][pDonateRank] <= 1)
{
SendClientMessage(playerid,COLOR_GREY," something!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1423.6151, -1320.5438, 13.5546)) {
if(Packages[playerid] >= 10) { SendClientMessage(playerid, COLOR_GREY, " something!"); return 1; }
if(CP[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, " something !"); return 1; }
if(Crates[playerid] > 0) { SendClientMessage(playerid, COLOR_GREY," something!"); return 1; }
if(GetPlayerVirtualWorld(playerid) != 0) { SendClientMessage(playerid, COLOR_GREY, " something !"); SetPlayerHealth(playerid, 0.0); return 1; }
if(PlayerInfo[playerid][pCash] > 499) { SendClientMessageEx(playerid, COLOR_GREY," something !"); return 1;}
{
GotMats[playerid] = 1;
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-500;
GivePlayerMoney(playerid, -500);
Packages[playerid] = 10;
CP[playerid] = 2;
SetPlayerCheckpoint(playerid, 3.0, 2172.21, -2263.25, 13.32);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* something.");
GameTextForPlayer(playerid, something", 5000, 1);
PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
return 1;
}
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2390.4053, -2008.2618, 13.5537))
{
if(Packages[playerid] >= 10) { SendClientMessage(playerid, COLOR_GREY, " something!"); return 1; }
if(CP[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, " something !"); return 1; }
if(Crates[playerid] > 0) { SendClientMessage(playerid, COLOR_GREY," something!"); return 1; }
if(GetPlayerVirtualWorld(playerid) != 0) { SendClientMessage(playerid, COLOR_GREY, " something !"); SetPlayerHealth(playerid, 0.0); return 1; }
if(PlayerInfo[playerid][pCash] > 499) { SendClientMessageEx(playerid, COLOR_GREY," something !"); return 1;}
{
GotMats[playerid] = 1;
GivePlayerMoney(playerid, -500);
Packages[playerid] = 10;
CP[playerid] = 3;
SetPlayerCheckpoint(playerid, 2288.0730, -1105.4535, 37.9766, 3.0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* something");
GameTextForPlayer(playerid, something", 5000, 1);
PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " something!");
}
}
return 1;
}
Re: How to fix these warnings? -
Faisal_khan - 13.05.2012
Boy please post the exact lines.