18.01.2014, 12:29
You mean pop vehicle tyre?
That's what I've made so far, but I don't have time to finish it, because College and work are calling me. You can edit it, if you want. For now that function checks both front & rear wheels positions, but it's not possible to shoot them, because your position must be EXACTLY the same as wheels position. Just make a range of shooted position, and check is it around wheels.
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(hittype)
{
case BULLET_HIT_TYPE_VEHICLE:
{
/*new Float:X, Float:Y, Float:Z;
GetVehicleModelInfo(hitid, VEHICLE_MODEL_INFO_PETROLCAP, X, Y, Z);*/
new Float:Offset[6];
GetVehicleModelInfo(hitid, VEHICLE_MODEL_INFO_WHEELSFRONT, Offset[0], Offset[1], Offset[2]);
GetVehicleModelInfo(hitid, VEHICLE_MODEL_INFO_WHEELSREAR, Offset[3], Offset[4], Offset[5]);
if(fX == Offset[0] && fY == Offset[1] && fZ == Offset[2]) // Around shooted offsets (to do)
{
PopVehicleTire(hitid, 10);
}
else if(fX == Offset[3] && fY == Offset[4] && fZ == Offset[5]) // Around shooted offsets (to do)
{
PopVehicleTire(hitid, 5);
}
}
}
return 1;
}
stock PopVehicleTire(vehicleid, tire)
{
static panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tire);
}