<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Multi_Theft_Auto:_Wiki:GetVehicleRPM?action=history&amp;feed=atom</id>
	<title>Multi Theft Auto: Wiki:GetVehicleRPM - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Multi_Theft_Auto:_Wiki:GetVehicleRPM?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:GetVehicleRPM&amp;action=history"/>
	<updated>2026-04-11T09:20:57Z</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=Multi_Theft_Auto:_Wiki:GetVehicleRPM&amp;diff=54228&amp;oldid=prev</id>
		<title>Alex7202: Alex7202 moved page Template:GetVehicleRPM to Multi Theft Auto: Wiki:GetVehicleRPM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:GetVehicleRPM&amp;diff=54228&amp;oldid=prev"/>
		<updated>2018-03-29T08:07:01Z</updated>

		<summary type="html">&lt;p&gt;Alex7202 moved page &lt;a href=&quot;/index.php?title=Template:GetVehicleRPM&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template:GetVehicleRPM (page does not exist)&quot;&gt;Template:GetVehicleRPM&lt;/a&gt; to &lt;a href=&quot;/wiki/Multi_Theft_Auto:_Wiki:GetVehicleRPM&quot; title=&quot;Multi Theft Auto: Wiki:GetVehicleRPM&quot;&gt;Multi Theft Auto: Wiki:GetVehicleRPM&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:07, 29 March 2018&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-54227:rev-54228 --&gt;
&lt;/table&gt;</summary>
		<author><name>Alex7202</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:GetVehicleRPM&amp;diff=54227&amp;oldid=prev</id>
		<title>Alex7202: Created page with &quot;__NOTOC__ {{Useful Function}} This function get vehicle engine speed. You will also need a function to getElementSpeed. ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt;vehicle...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:GetVehicleRPM&amp;diff=54227&amp;oldid=prev"/>
		<updated>2018-03-29T08:05:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Useful Function}} This function get &lt;a href=&quot;/wiki/Vehicle&quot; class=&quot;mw-redirect&quot; title=&quot;Vehicle&quot;&gt;vehicle&lt;/a&gt; engine speed. You will also need a function to &lt;a href=&quot;/wiki/GetElementSpeed&quot; title=&quot;GetElementSpeed&quot;&gt;getElementSpeed&lt;/a&gt;. ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;vehicle...&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;
{{Useful Function}}&lt;br /&gt;
This function get [[vehicle]] engine speed. You will also need a function to [[getElementSpeed]].&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;vehicle getVehicleRPM (vehicle)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
It returns a engine speed [[vehicle]] if possible. If not, it returns ''0''.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getVehicleRPM(vehicle)&lt;br /&gt;
local vehicleRPM = 0&lt;br /&gt;
    if (vehicle) then  &lt;br /&gt;
        if (getVehicleEngineState(vehicle) == true) then&lt;br /&gt;
            if getVehicleCurrentGear(vehicle) &amp;gt; 0 then             &lt;br /&gt;
                vehicleRPM = math.floor(((getElementSpeed(vehicle, &amp;quot;kmh&amp;quot;)/getVehicleCurrentGear(vehicle))*160) + 0.5) &lt;br /&gt;
                if (vehicleRPM &amp;lt; 650) then&lt;br /&gt;
                    vehicleRPM = math.random(650, 750)&lt;br /&gt;
                elseif (vehicleRPM &amp;gt;= 9000) then&lt;br /&gt;
                    vehicleRPM = math.random(9000, 9900)&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                vehicleRPM = math.floor((getElementSpeed(vehicle, &amp;quot;kmh&amp;quot;)*160) + 0.5)&lt;br /&gt;
                if (vehicleRPM &amp;lt; 650) then&lt;br /&gt;
                    vehicleRPM = math.random(650, 750)&lt;br /&gt;
                elseif (vehicleRPM &amp;gt;= 9000) then&lt;br /&gt;
                    vehicleRPM = math.random(9000, 9900)&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            vehicleRPM = 0&lt;br /&gt;
        end&lt;br /&gt;
        return tonumber(vehicleRPM)&lt;br /&gt;
    else&lt;br /&gt;
        return 0&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Function made by''': nL~Enzo&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example get engine speed vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler (&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
local veh = getPedOccupiedVehicle (localPlayer)&lt;br /&gt;
if veh then&lt;br /&gt;
    local rpm = getVehicleRPM (veh)&lt;br /&gt;
    dxDrawText (rpm, 500, 500, 100, 100)&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;
==See also==&lt;br /&gt;
{{Useful Functions}}&lt;/div&gt;</summary>
		<author><name>Alex7202</name></author>
	</entry>
</feed>