Vehicle::explode: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Explodes a selected vehicle.<br>
__NOTOC__
==Syntax==
{{SharedJsFunction}}
<syntaxhighlight lang="javascript">vehicle.explode();</syntaxhighlight>
Explodes the target vehicle.
=== Required Arguments ===
{{JSContainer|
===Return value===
== Syntax ==
*'''Undefined'''
 
==Example==
<pre>
<syntaxhighlight lang="javascript">
vehicle.explode();
// todo
</pre>
</syntaxhighlight>
 
==See also==
== Examples ==
{{Vehicle_function_c}}
Creates a bomb command which sets the car you're sitting in to explode in 10 seconds.
[[Category:Clientside API]]
{{ServersideCode|
[[Category:TODO: Example]]
<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}}
{{Vehicle_definition_c}}
[[Category:Shared API]]
[[Category:Shared Function]]
[[Category:Vehicle API]]

Latest revision as of 11:31, 9 May 2024

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