There is a much better way to detect gas tank shots and tires.
Note that you'll need to do a few corrections for some vehicles tires such as the trashmaster.
pawn Код:
new Float:dist;
new Float:width;
new line[128];
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_SIZE, width, Float:y, Float:z);
format(line, sizeof(line), "Vehicle width: %f", width);
SendClientMessage(playerid, -1, line);
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_PETROLCAP, Float:x, Float:y, Float:z);
dist=GetDistance(x,y,z,fX,fY,fZ);
format(line, sizeof(line), "Fuel tank Distance: %f", dist);
SendClientMessage(playerid, -1, line);
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_WHEELSFRONT, Float:x, Float:y, Float:z);
new Float:FrontRight = x;
new Float:FrontLeft = x-width;
dist=GetDistance(FrontRight,y,z,fX,fY,fZ);
format(line, sizeof(line), "Front Right Distance: %f", dist);
SendClientMessage(playerid, -1, line);
dist=GetDistance(FrontLeft,y,z,fX,fY,fZ);
format(line, sizeof(line), "Front Left Distance: %f", dist);
SendClientMessage(playerid, -1, line);
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_WHEELSREAR, Float:x, Float:y, Float:z);
new Float:RearRight = x;
new Float:RearLeft = x-width;
dist=GetDistance(RearRight,y,z,fX,fY,fZ);
format(line, sizeof(line), "Read Right Distance: %f", dist);
SendClientMessage(playerid, -1, line);
dist=GetDistance(RearLeft,y,z,fX,fY,fZ);
format(line, sizeof(line), "Rear Left Distance: %f", dist);
SendClientMessage(playerid, -1, line);