Vehicle::explode
Explodes the target vehicle.
JavaScript Syntax
Syntax
vehicle.explode();
Examples
Creates a bomb command which sets the car you're sitting in to explode in 10 seconds.
Server-Side
mp.events.addCommand('bomb', (player) => {
if(player.vehicle){
let veh_id = player.vehicle.id;
player.outputChatBox('Bomb activated, vehicle will blow in 10 seconds.')
setTimeout(() => {
mp.vehicles.at(veh_id).explode();
}, 10000);
}
});
See Also
- Functions
- Vehicle::Vehicle
- Vehicle::repair
- Vehicle::destroy
- Vehicle::setNeonColour
- Vehicle::getNeonColour
- Vehicle::setMod
- Vehicle::getMod
- Vehicle::setColour
- Vehicle::setColourRGB
- Vehicle::setPaint
- Vehicle::getColour
- Vehicle::getColourRGB
- Vehicle::getPaint
- Vehicle::getOccupant
- Vehicle::setOccupant
- Vehicle::getOccupants
- Vehicle::explode
- Vehicle::spawn
- Properties
- Entity::id
- Entity::dimension
- Entity::type
- Vehicle::model
- Vehicle::alpha
- Vehicle::position
- Vehicle::rotation
- Vehicle::velocity
- Vehicle::siren
- Vehicle::horn
- Vehicle::engine
- Vehicle::highbeams
- Vehicle::engineHealth
- Vehicle::bodyHealth
- Vehicle::steerAngle
- Vehicle::rocketBoost
- Vehicle::brake
- Vehicle::locked
- Vehicle::numberPlate
- Vehicle::neonEnabled
- Vehicle::dead
- Vehicle::wheelType