open.mp | OnVehicleDamageStatusUpdate
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文
warning Not Translated

This page has not been translated into the language that your browser requested. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

OnVehicleDamageStatusUpdate

warning

This callback was added in SA-MP 0.3a and will not work in earlier versions!

tip

For some useful functions for working with vehicle damage values, see here.

Description

This callback is called when a vehicle element such as doors, tires, panels, or lights change their damage status.

NameDescription
vehicleidThe ID of the vehicle that was changed its damage status.
playeridThe ID of the player who synced the change in the damage status (who had the car damaged or repaired).

Returns

1 - Will prevent other filterscripts from receiving this callback.

0 - Indicates that this callback will be passed to the next filterscript.

It is always called first in filterscripts.

Examples

public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    // Get the damage status of all the components
    new panels, doors, lights, tires;
    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);

    // Set the tires to 0, which means none are popped
    tires = 0;

    // Update the vehicle's damage status with unpopped tires
    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
    return 1;
}

Notes

tip

This does not include vehicle health changes.

Related Functions

  • GetVehicleDamageStatus: Get the vehicle damage state for each part individually.
  • UpdateVehicleDamageStatus: Update the vehicle damage.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub