<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/RU/blowVehicle?action=history&amp;feed=atom</id>
	<title>RU/blowVehicle - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/RU/blowVehicle?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/blowVehicle&amp;action=history"/>
	<updated>2026-04-11T08:45:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/blowVehicle&amp;diff=50693&amp;oldid=prev</id>
		<title>Fabervox: Created page with &quot;__NOTOC__  {{RU/Server client function}} Эта функция взрывает машину. Взрыв убивает водителя и пассажиров, и может...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/blowVehicle&amp;diff=50693&amp;oldid=prev"/>
		<updated>2017-04-16T10:21:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__  {{RU/Server client function}} Эта функция взрывает машину. Взрыв убивает водителя и пассажиров, и может...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{RU/Server client function}}&lt;br /&gt;
Эта функция взрывает машину. Взрыв убивает водителя и пассажиров, и может нанести урон находящимся близко к машине.&lt;br /&gt;
&lt;br /&gt;
==Синтаксис== &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;
{{RU/OOP||[[vehicle]]:blow|blown|isVehicleBlown}}&lt;br /&gt;
===Обязательные аргументы=== &lt;br /&gt;
*'''vehicleToBlow:''' машина которая будет взорвана.&lt;br /&gt;
===Необязательные аргументы=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''explode:''' если установлено ''true'' машина взорвется, в противном случае(''false'' или не указан) произойдет тихий взрыв.&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;
{{RU/OOP||[[vehicle]]:blow}}&lt;br /&gt;
===Обязательные аргументы=== &lt;br /&gt;
*'''vehicleToBlow:''' машина которая будет взорвана.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
===Возвращает===&lt;br /&gt;
Возвращает ''true'' в случае успеха, ''false'' если указаны неправильные аргументы.&lt;br /&gt;
&lt;br /&gt;
==Примеры== &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;
blowVehicle ( root ) -- root (getRootElement) is a built in MTA variable and therefore we do not have to define it.&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;
==Пример клиентского класса==&lt;br /&gt;
'''Heads up!''' Client classes only work on '''MTA 1.4''', therefore we highly recommend you to visit [[Client_Scripting_Classes|Client Scripting Classes]] first.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1: Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script will create an Infernus at the center (0, 0, 3) of San Andreas upon execution.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        infernus = Vehicle.create( 411, Vector3( 0, 0, 3 ) ); -- Create an Infernus and spawn it at the middle of SA.&lt;br /&gt;
        infernus:setColor( 0, 0, 0 ); -- Set its color to black.&lt;br /&gt;
    end)&lt;br /&gt;
	&lt;br /&gt;
addCommandHandler( &amp;quot;blowinfernus&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not infernus.blown then -- Check if the Infernus is blown up or not.&lt;br /&gt;
            infernus:blow();&lt;br /&gt;
        else -- Ouch, it's blown up, let's output an error to the client.&lt;br /&gt;
            outputChatBox( &amp;quot;The Infernus has already been blown up by you.&amp;quot;, 255, 0, 0, false );&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Смотрите также==&lt;br /&gt;
{{RU/Vehicle_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:blowVehicle]]&lt;/div&gt;</summary>
		<author><name>Fabervox</name></author>
	</entry>
</feed>