<?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%3AgetClosestVehicle</id>
	<title>Vehicle::getClosestVehicle - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Vehicle%3A%3AgetClosestVehicle"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Vehicle::getClosestVehicle&amp;action=history"/>
	<updated>2026-07-24T19:20:27Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Vehicle::getClosestVehicle&amp;diff=15751&amp;oldid=prev</id>
		<title>imported&gt;Marty uploader: yay</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Vehicle::getClosestVehicle&amp;diff=15751&amp;oldid=prev"/>
		<updated>2017-05-06T21:35:15Z</updated>

		<summary type="html">&lt;p&gt;yay&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Example usage&amp;lt;br&amp;gt;VEHICLE::GET_CLOSEST_VEHICLE(x, y, z, radius, hash, unknown leave at 70) &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;x, y, z: Position to get closest vehicle to.&amp;lt;br&amp;gt;radius: Max radius to get a vehicle.&amp;lt;br&amp;gt;modelHash: Limit to vehicles with this model. 0 for any.&amp;lt;br&amp;gt;flags: The bitwise flags altering the function&amp;#039;s behaviour.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Does not return police cars or helicopters.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;It seems to return police cars for me, does not seem to return helicopters, planes or boats for some reason&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Only returns non police cars and motorbikes with the flag set to 70 and modelHash to 0. ModelHash seems to always be 0 when not a modelHash in the scripts, as stated above. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;These flags were found in the b617d scripts: 0,2,4,6,7,23,127,260,2146,2175,12294,16384,16386,20503,32768,67590,67711,98309,100359.&amp;lt;br&amp;gt;Converted to binary, each bit probably represents a flag as explained regarding another native here: gtaforums.com/topic/822314-guide-driving-styles&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Conversion of found flags to binary: pastebin.com/kghNFkRi&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;At exactly 16384 which is 0100000000000000 in binary and 4000 in hexadecimal only planes are returned. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;It&amp;#039;s probably more convenient to use worldGetAllVehicles(int *arr, int arrSize) and check the shortest distance yourself and sort if you want by checking the vehicle type with for example VEHICLE::IS_THIS_MODEL_A_BOAT&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;-------------------------------------------------------------------------&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Conclusion: This native is not worth trying to use. Use something like this instead: pastebin.com/xiFdXa7h&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;mp.game.vehicle.getClosestVehicle(x, y, z, radius, modelHash, flags);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Required Arguments ===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;x:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;y:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;z:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;radius:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;modelHash:&amp;#039;&amp;#039;&amp;#039; Model hash or name&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;flags:&amp;#039;&amp;#039;&amp;#039; int&lt;br /&gt;
===Return value===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Vehicle handle or object&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
// todo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==See also==&lt;br /&gt;
{{Vehicle_s_function_c}}&lt;br /&gt;
[[Category:Clientside API]]&lt;br /&gt;
[[Category:TODO: Example]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Marty uploader</name></author>
	</entry>
</feed>