<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Vehicle%3A%3Adestroy</id>
	<title>Vehicle::destroy - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Vehicle%3A%3Adestroy"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Vehicle::destroy&amp;action=history"/>
	<updated>2026-07-25T00:46:05Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Vehicle::destroy&amp;diff=15681&amp;oldid=prev</id>
		<title>imported&gt;SugarD-x: Fixed numerous &quot;outputChatBox&quot; typographical errors that would break the code example.</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Vehicle::destroy&amp;diff=15681&amp;oldid=prev"/>
		<updated>2024-07-26T11:04:52Z</updated>

		<summary type="html">&lt;p&gt;Fixed numerous &amp;quot;outputChatBox&amp;quot; typographical errors that would break the code example.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{{ServersideJsFunction}}&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
This method will destroy (delete) a vehicle completely.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
vehicle.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
In this example we add two commands, one to spawn a vehicle and one to destroy them.&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//Create a command that creates a vehicle.&lt;br /&gt;
mp.events.addCommand(&amp;quot;vehicle&amp;quot;, (player, fulltext, model) =&amp;gt; {&lt;br /&gt;
	if (!fulltext.length || !model.length) return player.outputChatBox(&amp;quot;Usage: /vehicle [model]&amp;quot;)&lt;br /&gt;
    const { position, heading, dimension } = player;&lt;br /&gt;
	const vehicle = mp.vehicles.new(mp.joaat(model), position, {&lt;br /&gt;
        heading,&lt;br /&gt;
		numberPlate: &amp;quot;CAR&amp;quot;,&lt;br /&gt;
		locked: false,&lt;br /&gt;
		engine: false,&lt;br /&gt;
		dimension,&lt;br /&gt;
    })&lt;br /&gt;
	player.outputChatBox(`You have successfully spawned a ${model} as id: ${vehicle.id}`);&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
//Create a command that destroys a vehicle by id.&lt;br /&gt;
mp.events.addCommand(&amp;quot;destroyvehicle&amp;quot;, (player, fulltext, vid) =&amp;gt; {&lt;br /&gt;
	if (!fulltext.length || !vid.length) return player.outputChatBox(&amp;quot;Usage: /destroyvehicle [id]&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	const vehicleid = parseInt(vid);&lt;br /&gt;
	if (isNaN(vehicleid)) return player.outputChatBox(&amp;quot;Usage: /destroyvehicle [id]&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	const vehicle = mp.vehicles.at(vehicleid);&lt;br /&gt;
	if (!vehicle || !mp.vehicles.exists(vehicle)) {&lt;br /&gt;
		return player.outputChatBox(&amp;quot;We couldn&amp;#039;t find any vehicle with that id.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	player.outputChatBox(`You have successfully deleted vehicle id ${vehicleid}`);&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle_definition}}&lt;/div&gt;</summary>
		<author><name>imported&gt;SugarD-x</name></author>
	</entry>
</feed>