<?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=TC+amir</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=TC+amir"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/TC_amir"/>
	<updated>2026-04-08T20:25:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementMoving&amp;diff=75460</id>
		<title>IsElementMoving</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementMoving&amp;diff=75460"/>
		<updated>2022-09-01T19:18:19Z</updated>

		<summary type="html">&lt;p&gt;TC amir: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function checks if an element is moving.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool isElementMoving ( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the element is moving, false otherwise.&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 isElementMoving (theElement )&lt;br /&gt;
   if isElement ( theElement ) then                                   -- First check if the given argument is an element&lt;br /&gt;
      return Vector3( getElementVelocity( theElement ) ).length ~= 0&lt;br /&gt;
   end&lt;br /&gt;
   return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&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;
This script tells the moving state to the client on the bottom left of their screen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)&lt;br /&gt;
&lt;br /&gt;
function idleCheck ()&lt;br /&gt;
    -- Write our state string to the lower left corner of the screen&lt;br /&gt;
    -- What I've used here is called 'control flow'(and, or). Its just a simplified If statement, but its marginally faster.&lt;br /&gt;
    dxDrawText ( &amp;quot;You are &amp;quot; .. (isElementMoving(getPedOccupiedVehicle(localPlayer) or localPlayer) and &amp;quot;moving&amp;quot;) or (&amp;quot;idling&amp;quot;).. &amp;quot;!&amp;quot;, 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, &amp;quot;default&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Keep the text visible with onClientRender.&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root, idleCheck )&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>TC amir</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementMoving&amp;diff=75459</id>
		<title>IsElementMoving</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementMoving&amp;diff=75459"/>
		<updated>2022-09-01T19:18:07Z</updated>

		<summary type="html">&lt;p&gt;TC amir: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function checks if an element is moving.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool isElementMoving ( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the element is moving, false otherwise.&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 isElementMoving (theElement )&lt;br /&gt;
   if isElement ( ffnt ) then                                   -- First check if the given argument is an element&lt;br /&gt;
      return Vector3( getElementVelocity( theElement ) ).length ~= 0&lt;br /&gt;
   end&lt;br /&gt;
   return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&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;
This script tells the moving state to the client on the bottom left of their screen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution (width and height)&lt;br /&gt;
&lt;br /&gt;
function idleCheck ()&lt;br /&gt;
    -- Write our state string to the lower left corner of the screen&lt;br /&gt;
    -- What I've used here is called 'control flow'(and, or). Its just a simplified If statement, but its marginally faster.&lt;br /&gt;
    dxDrawText ( &amp;quot;You are &amp;quot; .. (isElementMoving(getPedOccupiedVehicle(localPlayer) or localPlayer) and &amp;quot;moving&amp;quot;) or (&amp;quot;idling&amp;quot;).. &amp;quot;!&amp;quot;, 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, &amp;quot;default&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Keep the text visible with onClientRender.&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root, idleCheck )&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>TC amir</name></author>
	</entry>
</feed>