Vehicle::explode

From RAGE Multiplayer Wiki
Revision as of 02:23, 27 April 2020 by MrPancakers2 (talk | contribs) (Updated example and page)

Shared
Function

 JavaScript


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