warning 225: unreachable code - Help and get a REP !!
#1

I got this
pawn Код:
if(newkeys & KEY_SPRINT)
{
    if(GetPVarInt(playerid, "UsingBuyMenu") > 0)
        {// Purchased a vehicle
            new ID = GetPVarInt(playerid, "BuySelection");
            switch (GetPVarInt(playerid, "UsingBuyMenu"))
            {
                case 1:
                {
                    if(PlayerInfo[playerid][pCash] >= NormalVehicleInfo[ID][carprice])
                    {
                        //if(PlayerInfo[playerid][pConnectTime] < NormalVehicleInfo[ID][carlevel])
                        {
                            //SendClientMessage(playerid,COLOR_RED,"[ERROR]: You're time in Los Santos is too low to get this vehicle.");
                            return 1;
                        }
                        PlayerInfo[playerid][pUsingSkin] = 2;
                        TogglePlayerSpectating(playerid, 0);
                        DestroyVehicle(GetPVarInt(playerid, "VehicleID"));
                        SetPVarInt(playerid, "UsingBuyMenu", 0);
                        TextDrawHideForPlayer(playerid,VehicleBuy[playerid]);
                        SetPVarInt(playerid, "VehicleType", 1);
                    }
                    else
                    {
                        SendClientMessage(playerid,COLOR_RED,"[ERROR]: You cannot afford this vehicle.");
                    }
                }
            }
        }

}
When I compile I get his

Код:
RP.pwn(8559) : warning 225: unreachable code
Reply
#2

It's pretty obvious, really. You commented out your condition so the code in that block will always be executed.
Reply
#3

thats why i mostly use the /* */ comment style hehe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)