How to fix these warnings?
#1

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(playerid10.02102.71, -103.972.28)) 
Please tel me the solution as soon as possible.
Thanks in Advance,
Rohan Ubhare
Reply
#2

Show me the command, there's a problem with the indentations probably.
Reply
#3

Please show 3 lines above and below that line too.
Reply
#4

Here is that whole thing:

PHP код:
if (IsPlayerInRangeOfPoint(playerid10.02102.71, -103.972.28)) // Matrun 3
    
{
        new 
vehicle GetPlayerVehicleID(playerid);
        if(
IsABoat(vehicle))
        {
            if(
GetPVarInt(playerid"Packages") >= 10) return SendClientMessageEx(playeridCOLOR_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;
    } 
Reply
#5

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;
    }
Reply
#6

Sorry I forgot to put tht but including those brackets i get that warning
Reply
#7

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
}
Reply
#8

Yea, I think he has a Loose Indention somewhere in the code. :/
Reply
#9

The code before this is:

PHP код:
{
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pJob] != && PlayerInfo[playerid][pDonateRank] <= 1)
            {
                
SendClientMessage(playerid,COLOR_GREY,"   something!");
                return 
1;
            }
            if(
IsPlayerInRangeOfPoint(playerid3.01423.6151, -1320.543813.5546))             {
                if(
Packages[playerid] >= 10) { SendClientMessage(playeridCOLOR_GREY"   something!"); return 1; }
                if(
CP[playerid] == 1) { SendClientMessage(playeridCOLOR_GREY"   something !"); return 1; }
                if(
Crates[playerid] > 0) { SendClientMessage(playeridCOLOR_GREY,"   something!"); return 1; }
                if(
GetPlayerVirtualWorld(playerid) != 0) { SendClientMessage(playeridCOLOR_GREY"   something !"); SetPlayerHealth(playerid0.0); return 1; }
                if(
PlayerInfo[playerid][pCash] > 499) { SendClientMessageEx(playeridCOLOR_GREY,"    something !"); return 1;}
                {
                    
GotMats[playerid] = 1;
                    
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-500;
                    
GivePlayerMoney(playerid, -500);
                    
Packages[playerid] = 10;
                    
CP[playerid] = 2;
                    
SetPlayerCheckpoint(playerid3.02172.21, -2263.2513.32); 
                    
SendClientMessage(playeridCOLOR_LIGHTBLUE"* something.");
                    
GameTextForPlayer(playeridsomething", 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"
50001);
                    
PlayerPlaySound(playerid10540.00.00.0);
                    return 
1;
                }
             }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"   something!");
            }
        }
        return 
1;
    } 
Reply
#10

Boy please post the exact lines.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)