SA-MP Forums Archive
0.3z car wheel not burst - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 0.3z car wheel not burst (/showthread.php?tid=488452)



0.3z car wheel not burst - kannak - 18.01.2014

0.3z version car empty car wheel not burst


Re: 0.3z car wheel not burst - MP2 - 18.01.2014

This is nothing new. You could never do this. You can script this with 0.3z's OnPlayerWeaponShot now though.


Re: 0.3z car wheel not burst - kannak - 18.01.2014

car wheel not burst


Re: 0.3z car wheel not burst - Yashas - 18.01.2014

Any form of damage done to an unoccupied vehicle will not affect the vehicle health.

BTW:Is there any I can burst them manually by code?Was thinking of making air filling system for the wheels?


Re: 0.3z car wheel not burst - Riddick94 - 18.01.2014

You mean pop vehicle tyre?

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);
}
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.