How to fix this warning ?
#2

that function only returns a value (1) when that control structure equals true.
But what if that's not the case?
pawn doesen't know what to do.

do it like this:

pawn Код:
stock IsPlayerInCopVehicle(playerid)
{
    if(IsPlayerInVehicle(playerid, 427) || IsPlayerInVehicle(playerid, 490) ||
    IsPlayerInVehicle(playerid, 497) || IsPlayerInVehicle(playerid, 523) ||
    IsPlayerInVehicle(playerid, 596) || IsPlayerInVehicle(playerid, 597) ||
    IsPlayerInVehicle(playerid, 598) || IsPlayerInVehicle(playerid, 599))
        return 1;
    else return 0;
}
btw. relying on assumptions is the worst thing you could ever do.
it could easily mess up stuff. use an array to store the id's

like, when you create the vehicle:
pawn Код:
//globally
new copCar[8];//space for 8 id's (idx from 0 - 7)

//then when creating the cars:
    copCar[0] = CreateVeh....
    copCar[1] = CreateVeh....
    //and so on
Reply


Messages In This Thread
How to fix this warning ? - by AnonScripter - 08.04.2014, 11:33
Re: How to fix this warning ? - by CutX - 08.04.2014, 11:36
Re: How to fix this warning ? - by xVIP3Rx - 08.04.2014, 11:49
Re: How to fix this warning ? - by AnonScripter - 08.04.2014, 11:57

Forum Jump:


Users browsing this thread: 2 Guest(s)