bodyAdditionalHealth
Used to set
or get
additional body health on the vehicle.
Returns a number
.
Declaration
vehicle.bodyAdditionalHealth: number
Usage
const additionalBodyHealth = vehicle.bodyAdditionalHealth;
// OR
vehicle.bodyAdditionalHealth = 255;
Real World Example
Adds additional body health when entering the vehicle.
function enteredVehicle(player, vehicle, seat) {
vehicle.bodyAdditionalHealth = 255;
console.log(`Additional Body Health set to ${vehicle.bodyAdditionalHealth}`);
}
alt.on('playerEnteredVehicle', enteredVehicle);
These examples assume you have vehicle created or available on server-side