06.10.2014, 10:07
Yeah, well, you're basically nesting all your if-statements. That's what you get for improper use of braces. It compiles like:
Which means the model has to be ALL of those vehicles. That is of course never the case and thus your code fails. You could fix it by appending the OR operator to each line (||) but the cleanest solution is a simple switch.
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 497)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 487)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 488)
{
// And so on ....
}
}
}
pawn Код:
switch(GetVehicleModel(GetPlayerVehicleID(playerid))
{
case 497, 487 /* etc, etc */:
{
// code
}
}