Vehicle::explode: Difference between revisions
No edit summary |
MrPancakers2 (talk | contribs) (Updated example and page) |
||
| Line 1: | Line 1: | ||
__NOTOC__ | |||
{{SharedJsFunction}} | |||
Explodes the target vehicle. | |||
{{JSContainer| | |||
=== | == Syntax == | ||
<pre> | |||
< | |||
vehicle.explode(); | vehicle.explode(); | ||
</ | </pre> | ||
==See | |||
{{ | == Examples == | ||
[[Category: | Creates a bomb command which sets the car you're sitting in to explode in 10 seconds. | ||
[[Category: | {{ServersideCode| | ||
<pre> | |||
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); | |||
} | |||
}); | |||
</pre> | |||
}} | |||
}} | |||
== See Also == | |||
{{Vehicle_function}} | |||
[[Category:Shared API]] | |||
[[Category:Shared Function]] | |||
[[Category:Vehicle API]] | |||
Revision as of 02:23, 27 April 2020
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