<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MrHankey</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MrHankey"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/MrHankey"/>
	<updated>2026-04-13T08:06:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BlowVehicle&amp;diff=26629</id>
		<title>BlowVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BlowVehicle&amp;diff=26629"/>
		<updated>2011-08-07T15:44:41Z</updated>

		<summary type="html">&lt;p&gt;MrHankey: updated syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will blow up a vehicle. This will cause an explosion and will kill the driver and any passengers inside it.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool blowVehicle ( vehicle vehicleToBlow, [ bool explode=true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''vehicleToBlow:''' The vehicle that you wish to blow up.&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''explode:''' If this argument is ''true'' then the vehicle will explode, otherwise it will just be blown up silently.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool blowVehicle ( vehicle vehicleToBlow )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''vehicleToBlow:''' The vehicle that you wish to blow up.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle was blown up, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1: Server and client&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will blow up every vehicle in the game.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicles = getElementsByType ( &amp;quot;vehicle&amp;quot; )&lt;br /&gt;
for vehicleKey, vehicleValue in ipairs(vehicles) do&lt;br /&gt;
	blowVehicle ( vehicleValue )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the same could be achieved with the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
root = getRootElement ()&lt;br /&gt;
blowVehicle ( root )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will blow a player's vehicle when he enters the car, like a carbomb.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
riggedVehicle = createVehicle(445, 0, 0, 5)&lt;br /&gt;
function blowVehicleEnter ( thePlayer, seat, jacked )&lt;br /&gt;
	--ENGINE START BOMB. &lt;br /&gt;
	if seat == 0 then --check if the seat the player got into was id 0 - i.e. driver seat&lt;br /&gt;
		blowVehicle ( source ) --if it was, toast him&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onVehicleEnter&amp;quot;, riggedVehicle, blowVehicleEnter ) --trigger the function when a certain vehicle is entered&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>MrHankey</name></author>
	</entry>
</feed>