20.06.2013, 12:07
That is not the correct way to do this at all. You need to loop through each truck ID and check if they are in it. You can't just assume the IDs are consecutive (i.e. 4, 5, 6, 7 and
. Your if/else structure is also wrong.

pawn Code:
new vehicleid = GetPlayerVehicleID(playerid);
for(new i=0; i < sizeof(ComTruck); i++)
{
if(vehicleid == ComTruck[i])
{
// They are in truck 'i', code here
break;
}
}
// Not in a truck