Vehicle::explode: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Explodes a selected vehicle.<br><br>Vehicle vehicle = Vehicle you want to explode.<br>BOOL isAudible = If explosion makes a sound.<br>BOOL isInvisible = If the explosion is invisible or not.<br><br>~ISOFX<br><br>First BOOL does not give any visual explosion, the vehicle just falls apart completely but slowly and starts to burn.
__NOTOC__
==Syntax==
{{SharedJsFunction}}
<syntaxhighlight lang="javascript">vehicle.explode(isAudible, isInvisible);</syntaxhighlight>
Explodes the target vehicle.
=== Required Arguments ===
{{JSContainer|
*'''isAudible:''' Boolean
== Syntax ==
*'''isInvisible:''' Boolean
 
===Return value===
<pre>
*'''Undefined'''
vehicle.explode();
==Example==
</pre>
<syntaxhighlight lang="javascript">
 
// todo
== Examples ==
</syntaxhighlight>
Creates a bomb command which sets the car you're sitting in to explode in 10 seconds.
==See also==
{{ServersideCode|
{{Vehicle_function_c}}
<pre>
[[Category:Clientside API]]
mp.events.addCommand('bomb', (player) => {
[[Category:TODO: Example]]
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