getBumperDamageLevel

Used to get the vehicle that this vehicle is attached to.

Bumper IDs

{
    FRONT: 0,
    REAR: 1
}

Damage Values

{
    NotDamaged: 0,
    Damaged: 1,
    None: 2
}

Returns a number from the Damage Values section.

Declaration

vehicle.getBumperDamageLevel(bumper: number): number;

Usage

const damageLevel = vehicle.getBumperDamageLevel(0);

Real World Example

const vehicle = new alt.Vehicle('phantom', 0, 0, 0, 0, 0, 0);

// Run into some walls before running this function.
const damageLevel = trailer.getBumperDamageLevel(0);
if (damageLevel === 1) {
    console.log(`Bumper is damaged.`);
}

These examples assume you have vehicle created or available on server-side

results matching ""

    No results matching ""