<?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=JeViCo</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=JeViCo"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/JeViCo"/>
	<updated>2026-04-20T00:15:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=76317</id>
		<title>User:JeViCo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=76317"/>
		<updated>2023-03-27T14:19:33Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feel free to ask questions&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Discord.png |&lt;br /&gt;
   imageSize = 30px|&lt;br /&gt;
   title = Discord |&lt;br /&gt;
   message = JeViCo#5147&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Github.png |&lt;br /&gt;
   imageSize = 28px|&lt;br /&gt;
   title = Github |&lt;br /&gt;
   message = https://github.com/jevico&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:VK.png |&lt;br /&gt;
   imageSize = 30px|&lt;br /&gt;
   title = Вконтакте |&lt;br /&gt;
   message = https://vk.com/jevico&lt;br /&gt;
   &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FormatNumber&amp;diff=76316</id>
		<title>FormatNumber</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FormatNumber&amp;diff=76316"/>
		<updated>2023-03-27T14:18:44Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Removed incorrect 2nd approach&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
This function formats large numbers by adding commas to it. For example, 100000 becomes 100.000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string formatNumber( int/string number, [ string sep = &amp;quot;.&amp;quot; ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''number''': The number to be converted.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''sep''': A string of the character you want to split&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the converted number.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1: Shared&amp;quot; class=&amp;quot;both&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;
function formatNumber(number, sep)&lt;br /&gt;
	assert(type(tonumber(number))==&amp;quot;number&amp;quot;, &amp;quot;Bad argument @'formatNumber' [Expected number at argument 1 got &amp;quot;..type(number)..&amp;quot;]&amp;quot;)&lt;br /&gt;
	assert(not sep or type(sep)==&amp;quot;string&amp;quot;, &amp;quot;Bad argument @'formatNumber' [Expected string at argument 2 got &amp;quot;..type(sep)..&amp;quot;]&amp;quot;)&lt;br /&gt;
	local money = number&lt;br /&gt;
	for i = 1, tostring(money):len()/3 do&lt;br /&gt;
		money = string.gsub(money, &amp;quot;^(-?%d+)(%d%d%d)&amp;quot;, &amp;quot;%1&amp;quot;..sep..&amp;quot;%2&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	return money&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;
==Example==&lt;br /&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;
This example converts a player's money, and outputs it to the chatbox when they type 'money' into the console:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function convertPlayerMoney()&lt;br /&gt;
	local pMoney = getPlayerMoney()&lt;br /&gt;
	local convertedMoney = formatNumber(pMoney)&lt;br /&gt;
	outputChatBox(convertedMoney)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;money&amp;quot;, convertPlayerMoney)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User_talk:JeViCo&amp;diff=75678</id>
		<title>User talk:JeViCo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User_talk:JeViCo&amp;diff=75678"/>
		<updated>2022-11-16T10:00:52Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Created page with &amp;quot;Wiki-related only discussions below&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wiki-related only discussions below&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=75677</id>
		<title>User:JeViCo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=75677"/>
		<updated>2022-11-16T09:59:44Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: vk.com added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feel free ask questions&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Discord.png |&lt;br /&gt;
   imageSize = 30px|&lt;br /&gt;
   title = Discord |&lt;br /&gt;
   message = JeViCo#5147&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Github.png |&lt;br /&gt;
   imageSize = 28px|&lt;br /&gt;
   title = Github |&lt;br /&gt;
   message = https://github.com/jevico&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:VK.png |&lt;br /&gt;
   imageSize = 30px|&lt;br /&gt;
   title = Вконтакте |&lt;br /&gt;
   message = https://vk.com/jevico&lt;br /&gt;
   &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=75676</id>
		<title>User:JeViCo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=75676"/>
		<updated>2022-11-16T09:45:31Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Space removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feel free ask questions&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Discord.png |&lt;br /&gt;
   imageSize = 30px|&lt;br /&gt;
   title = Discord |&lt;br /&gt;
   message = JeViCo#5147&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Github.png |&lt;br /&gt;
   imageSize = 26px|&lt;br /&gt;
   title = Github |&lt;br /&gt;
   message = https://github.com/jevico&lt;br /&gt;
   &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=75675</id>
		<title>User:JeViCo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:JeViCo&amp;diff=75675"/>
		<updated>2022-11-16T09:45:18Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Basic info added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feel free ask questions&lt;br /&gt;
&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Discord.png |&lt;br /&gt;
   imageSize = 30px|&lt;br /&gt;
   title = Discord |&lt;br /&gt;
   message = JeViCo#5147&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 98fb98 |&lt;br /&gt;
   image = File:Github.png |&lt;br /&gt;
   imageSize = 26px|&lt;br /&gt;
   title = Github |&lt;br /&gt;
   message = https://github.com/jevico&lt;br /&gt;
   &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=File:Discord.png&amp;diff=75674</id>
		<title>File:Discord.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=File:Discord.png&amp;diff=75674"/>
		<updated>2022-11-16T09:37:03Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: JeViCo uploaded a new version of File:Discord.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Official discord logo&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=File:Discord.png&amp;diff=75673</id>
		<title>File:Discord.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=File:Discord.png&amp;diff=75673"/>
		<updated>2022-11-16T09:34:56Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Official discord logo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Official discord logo&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=75672</id>
		<title>BindKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=75672"/>
		<updated>2022-11-16T09:19:16Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Note added about non working escape button&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Binds a player's key to a handler function or command, which will be called when the key is pressed.&lt;br /&gt;
&lt;br /&gt;
{{Note|Using escape key will always return false. Use [[onClientKey]] event instead.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server - Syntax 1&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;bool bindKey ( player thePlayer, string key, string keyState, function handlerFunction,  [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''handlerFunction:''' The function that will be triggered when the player's key is pressed. This function should have the form:&lt;br /&gt;
:&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function functionName ( player keyPresser, string key, string keyState, [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:The values passed to this function are:&lt;br /&gt;
:*'''keyPresser:''' The player who pressed the key&lt;br /&gt;
:*'''key:''' The key that was pressed&lt;br /&gt;
:*'''keyState:''' The state of the key that was pressed, ''down'' if it was pressed, ''up'' if it was released.&lt;br /&gt;
:*'''arguments''' The optional arguments you specified when calling [[bindKey]] (see below).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server - Syntax 2&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This alternative syntax allows you to bind a key with a command.  This will also allow users to customize the control in their Settings menu.  Use in conjunction with [[addCommandHandler]] to add handler functions to the keybind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool bindKey ( player thePlayer, string key, string keyState, string commandName, [ string arguments ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''commandName:''' The name of the command that the key should be binded to.  &lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''arguments''' Space delimited arguments that are entered as if one was typing the command.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client - Syntax 1&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;bool bindKey ( string key, string keyState, function handlerFunction,  [ var arguments, ... ] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
&amp;lt;!--*'''bindName:''' The name for this key bind when it appears in the client's settings dialog.--&amp;gt;&lt;br /&gt;
*'''handlerFunction:''' The function that will be triggered when the player's key is pressed. This function should have the form:&lt;br /&gt;
:&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function functionName ( string key, string keyState, [ var arguments, ... ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:The values passed to this function are:&lt;br /&gt;
:*'''key:''' The key that was pressed&lt;br /&gt;
:*'''keyState:''' The state of the key that was pressed, ''down'' if it was pressed, ''up'' if it was released.&lt;br /&gt;
:*'''arguments''' The optional arguments you specified when calling [[bindKey]] (see below).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client - Syntax 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This alternative syntax allows you to bind a key with a command.  This will also allow users to customize the control in their Settings menu.  Use in conjunction with [[addCommandHandler]] to add handler functions to the keybind.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool bindKey ( string key, string keyState, string commandName, [ string arguments ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[key names]] for a list of possible keys.&lt;br /&gt;
*'''keyState:''' A string that has one of the following values:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key should trigger the function when the key is released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key should trigger the function when the key is pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key should trigger the function when the key is pressed or released&lt;br /&gt;
*'''commandName:''' The name of the command that the key should be binded to.  &lt;br /&gt;
*'''arguments''' Space delimited arguments that are entered as if one was typing the command.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the function when the key is pressed by the user. Any number of arguments of  can be specified, each being passed to the designated function. You may not pass functions.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the key was bound, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Example 1&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;
This example will bind a player's 'F1' key and 'fire' control to 1 input function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function funcInput ( player, key, keyState )&lt;br /&gt;
  outputChatBox ( getPlayerName ( player) .. &amp;quot; &amp;quot; .. (keyState == &amp;quot;down&amp;quot; and &amp;quot;pressed&amp;quot; or &amp;quot;released&amp;quot;) .. &amp;quot; the &amp;quot; .. key .. &amp;quot; key!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindTheKeys ( player, commandName )&lt;br /&gt;
  bindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, funcInput )   -- bind the player's F1 down key&lt;br /&gt;
  bindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, funcInput )     -- bind the player's F1 up key&lt;br /&gt;
  bindKey ( player, &amp;quot;fire&amp;quot;, &amp;quot;both&amp;quot;, funcInput ) -- bind the player's fire down and up control&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, bindTheKeys )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example 2&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 example will bind a player's 'F1' key and 'fire' control to 1 input function, clientside.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function funcInput ( key, keyState )&lt;br /&gt;
	outputChatBox( &amp;quot;You &amp;quot; .. (keyState == &amp;quot;down&amp;quot; and &amp;quot;pressed&amp;quot; or &amp;quot;let go of&amp;quot;) .. &amp;quot; the &amp;quot; .. key .. &amp;quot; key!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindTheKeys ( commandName )&lt;br /&gt;
	bindKey( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, funcInput )   -- bind the player's F1 down key&lt;br /&gt;
	bindKey( &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, funcInput )     -- bind the player's F1 up key&lt;br /&gt;
	bindKey( &amp;quot;fire&amp;quot;, &amp;quot;both&amp;quot;, funcInput ) -- bind the player's fire down and up control&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, bindTheKeys )&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example says how cool is the MTA:SA is if players wants to move.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function fanFunction()&lt;br /&gt;
  bindKey (source,&amp;quot;forwards&amp;quot;,&amp;quot;down&amp;quot;,&lt;br /&gt;
    function(player,key,state)&lt;br /&gt;
      outputChatBox (getPlayerName (player) .. &amp;quot;#FFFF00 thinks MTA:SA is so cool.&amp;quot;,root,255,255,0,true)&lt;br /&gt;
    end&lt;br /&gt;
  )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onPlayerLogin&amp;quot;,root,fanFunction)&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;
{{Input functions}}&lt;br /&gt;
[[pt-br:bindKey]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=69629</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=69629"/>
		<updated>2021-03-15T12:10:30Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: fixed broken link (DirectX SDK)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
Please read the instructions carefully and do not skip parts of it, if you have no experience.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Compiling the Multi Theft Auto client is only supported on Windows 10.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the following software and SDKs installed:&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio 2019 ===&lt;br /&gt;
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]&lt;br /&gt;
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2019]''' - make sure you get the Community Edition, that one is free.&lt;br /&gt;
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these two items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''C++ MFC for latest v142 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
&lt;br /&gt;
If you don't enable MFC, you will get the following error: &amp;lt;code&amp;gt;cannot open include file 'afxres.h'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you've made a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.&lt;br /&gt;
&lt;br /&gt;
=== Microsoft DirectX SDK ===&lt;br /&gt;
[[File:DirectX_SDK.jpg|right|150px|link=http://web.archive.org/web/20200804044856/https://www.microsoft.com/en-us/download/details.aspx?id=23549]]&lt;br /&gt;
'''Download'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://web.archive.org/web/20200804044856/https://www.microsoft.com/en-us/download/details.aspx?id=23549 Microsoft DirectX SDK (August 2009)]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.h'''&amp;lt;br&amp;gt;&lt;br /&gt;
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.&lt;br /&gt;
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. &lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.lib'''&amp;lt;br&amp;gt;&lt;br /&gt;
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field&lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''S1023 Error'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://support.microsoft.com/en-us/kb/2728613 &amp;quot;S1023&amp;quot; error when you install the DirectX SDK (June 2010)]&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]&lt;br /&gt;
&lt;br /&gt;
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].&lt;br /&gt;
&lt;br /&gt;
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).&lt;br /&gt;
&lt;br /&gt;
== Getting the latest source code ==&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository.&amp;lt;br&amp;gt;&lt;br /&gt;
We recommend cloning the repository in your Git client because you can pull any updates from there easily.&lt;br /&gt;
&lt;br /&gt;
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]&lt;br /&gt;
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]&lt;br /&gt;
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== Compiling the code ==&lt;br /&gt;
# Execute the script '''win-create-projects.bat'''&lt;br /&gt;
# Open the solution file '''MTASA.sln''' in the '''Build''' directory&lt;br /&gt;
# If you are asked to upgrade the project, click '''Cancel'''&lt;br /&gt;
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)&lt;br /&gt;
# Execute the script '''win-install-data.bat'''&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
== Running the client ==&lt;br /&gt;
&lt;br /&gt;
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Running the dedicated server ==&lt;br /&gt;
&lt;br /&gt;
If you already have run step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can go to ''Starting the server''.&lt;br /&gt;
&lt;br /&gt;
=== Installing the latest resources ===&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.&lt;br /&gt;
&lt;br /&gt;
=== Starting the server ===&lt;br /&gt;
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compiling the code'' and follow the steps for a ''Debug'' build.&amp;lt;br&amp;gt;&lt;br /&gt;
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Local_Windows_Debugger.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== How to enable breakpoints ===&lt;br /&gt;
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise, your&lt;br /&gt;
breakpoints will not work for anything besides the MTA Launcher project.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Attach_to_Process.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Extending timeout duration ===&lt;br /&gt;
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory.  &lt;br /&gt;
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.&lt;br /&gt;
&lt;br /&gt;
=== ReAttach for Visual Studio ===&lt;br /&gt;
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ReAttach_to_GTASA.PNG]]&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on the coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
= Errors =&lt;br /&gt;
== CL38 error. [netc_d.dll not found] ==&lt;br /&gt;
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.&lt;br /&gt;
&lt;br /&gt;
== After cloning the repository, it doesn't compile the project ==&lt;br /&gt;
Solution: Execute '''win-create-projects.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[hu:Compiling MTASA]]&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FormatNumber&amp;diff=67019</id>
		<title>FormatNumber</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FormatNumber&amp;diff=67019"/>
		<updated>2020-07-05T09:01:05Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Changed comma to dot in the description. Small algorithm description added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
This function formats large numbers by adding commas to it. For example, 100000 becomes 100.000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string formatNumber( int/string number, [ string sep = &amp;quot;.&amp;quot; ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''number''': The number to be converted.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''sep''': A string of the character you want to split&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the converted number.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
Made by JeViCo. Uses double string reverse &amp;amp; patterns to paste separator&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function formatNumber(number, sep)&lt;br /&gt;
	assert(type(tonumber(number))==&amp;quot;number&amp;quot;, &amp;quot;Bad argument @'formatNumber' [Expected number at argument 1 got &amp;quot;..type(number)..&amp;quot;]&amp;quot;)&lt;br /&gt;
	assert(not sep or type(sep)==&amp;quot;string&amp;quot;, &amp;quot;Bad argument @'formatNumber' [Expected string at argument 2 got &amp;quot;..type(sep)..&amp;quot;]&amp;quot;)&lt;br /&gt;
	return tostring(number):reverse():gsub(&amp;quot;%d%d%d&amp;quot;,&amp;quot;%1%&amp;quot;..(sep and #sep&amp;gt;0 and sep or &amp;quot;.&amp;quot;)):reverse()&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 example converts a player's money, and outputs it to the chatbox when they type 'money' into the console:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function convertPlayerMoney()&lt;br /&gt;
	local pMoney = getPlayerMoney()&lt;br /&gt;
	local convertedMoney = formatNumber(pMoney)&lt;br /&gt;
	outputChatBox(convertedMoney)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;money&amp;quot;, convertPlayerMoney)&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>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FormatNumber&amp;diff=66961</id>
		<title>FormatNumber</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FormatNumber&amp;diff=66961"/>
		<updated>2020-06-26T12:00:45Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Better algorithm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
This function formats large numbers by adding commas to it. For example, 100000 becomes 100,000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string formatNumber( int/string number, [ string sep = &amp;quot;.&amp;quot; ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''number''': The number to be converted.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''sep''': A string of the character you want to split&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the converted number.&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 formatNumber(number, sep)&lt;br /&gt;
	assert(type(tonumber(number))==&amp;quot;number&amp;quot;, &amp;quot;Bad argument @'formatNumber' [Expected number at argument 1 got &amp;quot;..type(number)..&amp;quot;]&amp;quot;)&lt;br /&gt;
	assert(not sep or type(sep)==&amp;quot;string&amp;quot;, &amp;quot;Bad argument @'formatNumber' [Expected string at argument 2 got &amp;quot;..type(sep)..&amp;quot;]&amp;quot;)&lt;br /&gt;
	return tostring(number):reverse():gsub(&amp;quot;%d%d%d&amp;quot;,&amp;quot;%1%&amp;quot;..(sep and #sep&amp;gt;0 and sep or &amp;quot;.&amp;quot;)):reverse()&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 example converts a player's money, and outputs it to the chatbox when they type 'money' into the console:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function convertPlayerMoney()&lt;br /&gt;
	local pMoney = getPlayerMoney()&lt;br /&gt;
	local convertedMoney = formatNumber(pMoney)&lt;br /&gt;
	outputChatBox(convertedMoney)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;money&amp;quot;, convertPlayerMoney)&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>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SmoothMoveCamera&amp;diff=65108</id>
		<title>SmoothMoveCamera</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SmoothMoveCamera&amp;diff=65108"/>
		<updated>2020-02-11T18:48:13Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: misspelled word 'periodic'&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 allows you to create a cinematic-camera-flight, which moves from a specific position to a specific position.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool smoothMoveCamera ( float x1, float y1, float z1, float x1t, float y1t, float z1t, float x2, float y2, float z2, float x2t, float y2t, float z2t, int time )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''x1, y1, z1''': The camera's start position.&lt;br /&gt;
* '''x1t, y1t, z1t''': The camera's start look at.&lt;br /&gt;
* '''x2, y2, z2''': The camera's end position.&lt;br /&gt;
* '''x2t, y2t, z2t''': The camera's end look at.&lt;br /&gt;
* '''time''': The speed of the camera's movement.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
This version returns false if a smoothMoveCamera is in progress:&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
local sm = {}&lt;br /&gt;
sm.moov = 0&lt;br /&gt;
sm.object1,sm.object2 = nil,nil&lt;br /&gt;
 &lt;br /&gt;
local function removeCamHandler()&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		sm.moov = 0&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
local function camRender()&lt;br /&gt;
	if (sm.moov == 1) then&lt;br /&gt;
		local x1,y1,z1 = getElementPosition(sm.object1)&lt;br /&gt;
		local x2,y2,z2 = getElementPosition(sm.object2)&lt;br /&gt;
		setCameraMatrix(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
	else&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)&lt;br /&gt;
	if(sm.moov == 1)then return false end&lt;br /&gt;
	sm.object1 = createObject(1337,x1,y1,z1)&lt;br /&gt;
	sm.object2 = createObject(1337,x1t,y1t,z1t)&lt;br /&gt;
        setElementCollisionsEnabled (sm.object1,false) &lt;br /&gt;
	setElementCollisionsEnabled (sm.object2,false) &lt;br /&gt;
	setElementAlpha(sm.object1,0)&lt;br /&gt;
	setElementAlpha(sm.object2,0)&lt;br /&gt;
	setObjectScale(sm.object1,0.01)&lt;br /&gt;
	setObjectScale(sm.object2,0.01)&lt;br /&gt;
	moveObject(sm.object1,time,x2,y2,z2,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	sm.moov = 1&lt;br /&gt;
	setTimer(removeCamHandler,time,1)&lt;br /&gt;
	setTimer(destroyElement,time,1,sm.object1)&lt;br /&gt;
	setTimer(destroyElement,time,1,sm.object2)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
Author: Noneatme(Me)  [Fixed by ADCX and Motar2k~, does not give errors now]&lt;br /&gt;
&lt;br /&gt;
This Version allows cancellation of current smoothMoveCamera progress and doing another one.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
local sm = {}&lt;br /&gt;
sm.moov = 0&lt;br /&gt;
sm.object1,sm.object2 = nil,nil&lt;br /&gt;
 &lt;br /&gt;
local function removeCamHandler()&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		sm.moov = 0&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
local function camRender()&lt;br /&gt;
	if (sm.moov == 1) then&lt;br /&gt;
		local x1,y1,z1 = getElementPosition(sm.object1)&lt;br /&gt;
		local x2,y2,z2 = getElementPosition(sm.object2)&lt;br /&gt;
		setCameraMatrix(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
	else&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		destroyElement(sm.object1)&lt;br /&gt;
		destroyElement(sm.object2)&lt;br /&gt;
		killTimer(timer1)&lt;br /&gt;
		killTimer(timer2)&lt;br /&gt;
		killTimer(timer3)&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	end&lt;br /&gt;
	sm.object1 = createObject(1337,x1,y1,z1)&lt;br /&gt;
	sm.object2 = createObject(1337,x1t,y1t,z1t)&lt;br /&gt;
        setElementCollisionsEnabled (sm.object1,false) &lt;br /&gt;
	setElementCollisionsEnabled (sm.object2,false) &lt;br /&gt;
	setElementAlpha(sm.object1,0)&lt;br /&gt;
	setElementAlpha(sm.object2,0)&lt;br /&gt;
	setObjectScale(sm.object1,0.01)&lt;br /&gt;
	setObjectScale(sm.object2,0.01)&lt;br /&gt;
	moveObject(sm.object1,time,x2,y2,z2,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	sm.moov = 1&lt;br /&gt;
	timer1 = setTimer(removeCamHandler,time,1)&lt;br /&gt;
	timer2 = setTimer(destroyElement,time,1,sm.object1)&lt;br /&gt;
	timer3 = setTimer(destroyElement,time,1,sm.object2)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	return true&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;
Made by JeViCo. Same function as previous one except it's using interpolateBetween function. Also this version may fix little periodic flickering which happen in previous examples.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
local sm = {}&lt;br /&gt;
sm.moov = 0&lt;br /&gt;
&lt;br /&gt;
local function removeCamHandler()&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		sm.moov = 0&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local start&lt;br /&gt;
local animTime&lt;br /&gt;
local tempPos = {{},{}}&lt;br /&gt;
local tempPos2 = {{},{}}&lt;br /&gt;
&lt;br /&gt;
local function camRender()&lt;br /&gt;
	local now = getTickCount()&lt;br /&gt;
	if (sm.moov == 1) then&lt;br /&gt;
		local x1, y1, z1 = interpolateBetween(tempPos[1][1], tempPos[1][2], tempPos[1][3], tempPos2[1][1], tempPos2[1][2], tempPos2[1][3], (now-start)/animTime, &amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
		local x2,y2,z2 = interpolateBetween(tempPos[2][1], tempPos[2][2], tempPos[2][3], tempPos2[2][1], tempPos2[2][2], tempPos2[2][3], (now-start)/animTime, &amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
		setCameraMatrix(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
	else&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,camRender)&lt;br /&gt;
		fadeCamera(true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)&lt;br /&gt;
	if(sm.moov == 1) then&lt;br /&gt;
		killTimer(timer1)&lt;br /&gt;
		killTimer(timer2)&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,camRender)&lt;br /&gt;
		fadeCamera(true)&lt;br /&gt;
	end&lt;br /&gt;
	fadeCamera(true)&lt;br /&gt;
	sm.moov = 1&lt;br /&gt;
	timer1 = setTimer(removeCamHandler,time,1)&lt;br /&gt;
	timer2 = setTimer(fadeCamera, time-1000, 1, false) -- &lt;br /&gt;
	start = getTickCount()&lt;br /&gt;
	animTime = time&lt;br /&gt;
	tempPos[1] = {x1,y1,z1}&lt;br /&gt;
	tempPos[2] = {x1t,y1t,z1t}&lt;br /&gt;
	tempPos2[1] = {x2,y2,z2}&lt;br /&gt;
	tempPos2[2] = {x2t,y2t,z2t}&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;,root,camRender)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementCollisionsEnabled&amp;diff=64914</id>
		<title>SetElementCollisionsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementCollisionsEnabled&amp;diff=64914"/>
		<updated>2020-01-20T16:27:34Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function can disable or enable an element's collisions. An element without collisions does not interact with the physical environment and remains static.&lt;br /&gt;
&lt;br /&gt;
{{Note|Vehicles that are collisionless and have a driver will cause bugs.}}&lt;br /&gt;
{{Note|Enabling a players collisions when they're inside a vehicle will cause bugs.}}&lt;br /&gt;
{{Note|Disabling a peds collisions will cause some problems, such as it being unable to move or wrong rotation after creation.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementCollisionsEnabled ( element theElement, bool enabled ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setCollisionsEnabled|collisions|getElementCollisionsEnabled}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you wish to set the collisions of&lt;br /&gt;
*'''enabled:''' A boolean to indicate whether collisions are enabled (''true'') or disabled (''false'')&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the collisions were set succesfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example disables collisions for all vehicles within a certain radius of a player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function disableVehicleCollisionsNearPlayer(thePlayer, maxDistance)&lt;br /&gt;
	local playerX, playerY, playerZ = getElementPosition(thePlayer)&lt;br /&gt;
	local vehicles = getElementsByType(&amp;quot;vehicle&amp;quot;)&lt;br /&gt;
	for k,v in ipairs(vehicles) do&lt;br /&gt;
		local vehicleX, vehicleY, vehicleZ = getElementPosition(v)&lt;br /&gt;
		-- get the distance between the player and the vehicle:&lt;br /&gt;
		local distance = getDistanceBetweenPoints3D(vehicleX, vehicleY, vehicleZ, playerX, playerY, playerZ)&lt;br /&gt;
		if (distance &amp;lt;= maxDistance) then&lt;br /&gt;
			-- disable collisions for the vehicle&lt;br /&gt;
			setElementCollisionsEnabled(v, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client element functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SmoothMoveCamera&amp;diff=64884</id>
		<title>SmoothMoveCamera</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SmoothMoveCamera&amp;diff=64884"/>
		<updated>2020-01-10T18:03:10Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: added example (using interpolateBetween). Grammar &amp;amp; syntax check needed (variable count reduce ?)&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 allows you to create a cinematic-camera-flight, which moves from a specific position to a specific position.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool smoothMoveCamera ( float x1, float y1, float z1, float x1t, float y1t, float z1t, float x2, float y2, float z2, float x2t, float y2t, float z2t, int time )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''x1, y1, z1''': The camera's start position.&lt;br /&gt;
* '''x1t, y1t, z1t''': The camera's start look at.&lt;br /&gt;
* '''x2, y2, z2''': The camera's end position.&lt;br /&gt;
* '''x2t, y2t, z2t''': The camera's end look at.&lt;br /&gt;
* '''time''': The speed of the camera's movement.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
This version returns false if a smoothMoveCamera is in progress:&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
local sm = {}&lt;br /&gt;
sm.moov = 0&lt;br /&gt;
sm.object1,sm.object2 = nil,nil&lt;br /&gt;
 &lt;br /&gt;
local function removeCamHandler()&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		sm.moov = 0&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
local function camRender()&lt;br /&gt;
	if (sm.moov == 1) then&lt;br /&gt;
		local x1,y1,z1 = getElementPosition(sm.object1)&lt;br /&gt;
		local x2,y2,z2 = getElementPosition(sm.object2)&lt;br /&gt;
		setCameraMatrix(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
	else&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)&lt;br /&gt;
	if(sm.moov == 1)then return false end&lt;br /&gt;
	sm.object1 = createObject(1337,x1,y1,z1)&lt;br /&gt;
	sm.object2 = createObject(1337,x1t,y1t,z1t)&lt;br /&gt;
        setElementCollisionsEnabled (sm.object1,false) &lt;br /&gt;
	setElementCollisionsEnabled (sm.object2,false) &lt;br /&gt;
	setElementAlpha(sm.object1,0)&lt;br /&gt;
	setElementAlpha(sm.object2,0)&lt;br /&gt;
	setObjectScale(sm.object1,0.01)&lt;br /&gt;
	setObjectScale(sm.object2,0.01)&lt;br /&gt;
	moveObject(sm.object1,time,x2,y2,z2,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	sm.moov = 1&lt;br /&gt;
	setTimer(removeCamHandler,time,1)&lt;br /&gt;
	setTimer(destroyElement,time,1,sm.object1)&lt;br /&gt;
	setTimer(destroyElement,time,1,sm.object2)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
Author: Noneatme(Me)  [Fixed by ADCX and Motar2k~, does not give errors now]&lt;br /&gt;
&lt;br /&gt;
This Version allows cancellation of current smoothMoveCamera progress and doing another one.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
local sm = {}&lt;br /&gt;
sm.moov = 0&lt;br /&gt;
sm.object1,sm.object2 = nil,nil&lt;br /&gt;
 &lt;br /&gt;
local function removeCamHandler()&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		sm.moov = 0&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
local function camRender()&lt;br /&gt;
	if (sm.moov == 1) then&lt;br /&gt;
		local x1,y1,z1 = getElementPosition(sm.object1)&lt;br /&gt;
		local x2,y2,z2 = getElementPosition(sm.object2)&lt;br /&gt;
		setCameraMatrix(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
	else&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		destroyElement(sm.object1)&lt;br /&gt;
		destroyElement(sm.object2)&lt;br /&gt;
		killTimer(timer1)&lt;br /&gt;
		killTimer(timer2)&lt;br /&gt;
		killTimer(timer3)&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	end&lt;br /&gt;
	sm.object1 = createObject(1337,x1,y1,z1)&lt;br /&gt;
	sm.object2 = createObject(1337,x1t,y1t,z1t)&lt;br /&gt;
        setElementCollisionsEnabled (sm.object1,false) &lt;br /&gt;
	setElementCollisionsEnabled (sm.object2,false) &lt;br /&gt;
	setElementAlpha(sm.object1,0)&lt;br /&gt;
	setElementAlpha(sm.object2,0)&lt;br /&gt;
	setObjectScale(sm.object1,0.01)&lt;br /&gt;
	setObjectScale(sm.object2,0.01)&lt;br /&gt;
	moveObject(sm.object1,time,x2,y2,z2,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,&amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
	sm.moov = 1&lt;br /&gt;
	timer1 = setTimer(removeCamHandler,time,1)&lt;br /&gt;
	timer2 = setTimer(destroyElement,time,1,sm.object1)&lt;br /&gt;
	timer3 = setTimer(destroyElement,time,1,sm.object2)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,camRender)&lt;br /&gt;
	return true&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;
Made by JeViCo. Same function as previous one except it's using interpolateBetween function. Also this version may fix little preiodic flickering which happen in previous examples.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&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;
local sm = {}&lt;br /&gt;
sm.moov = 0&lt;br /&gt;
&lt;br /&gt;
local function removeCamHandler()&lt;br /&gt;
	if(sm.moov == 1)then&lt;br /&gt;
		sm.moov = 0&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local start&lt;br /&gt;
local animTime&lt;br /&gt;
local tempPos = {{},{}}&lt;br /&gt;
local tempPos2 = {{},{}}&lt;br /&gt;
&lt;br /&gt;
local function camRender()&lt;br /&gt;
	local now = getTickCount()&lt;br /&gt;
	if (sm.moov == 1) then&lt;br /&gt;
		local x1, y1, z1 = interpolateBetween(tempPos[1][1], tempPos[1][2], tempPos[1][3], tempPos2[1][1], tempPos2[1][2], tempPos2[1][3], (now-start)/animTime, &amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
		local x2,y2,z2 = interpolateBetween(tempPos[2][1], tempPos[2][2], tempPos[2][3], tempPos2[2][1], tempPos2[2][2], tempPos2[2][3], (now-start)/animTime, &amp;quot;InOutQuad&amp;quot;)&lt;br /&gt;
		setCameraMatrix(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
	else&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,camRender)&lt;br /&gt;
		fadeCamera(true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)&lt;br /&gt;
	if(sm.moov == 1) then&lt;br /&gt;
		killTimer(timer1)&lt;br /&gt;
		killTimer(timer2)&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,camRender)&lt;br /&gt;
		fadeCamera(true)&lt;br /&gt;
	end&lt;br /&gt;
	fadeCamera(true)&lt;br /&gt;
	sm.moov = 1&lt;br /&gt;
	timer1 = setTimer(removeCamHandler,time,1)&lt;br /&gt;
	timer2 = setTimer(fadeCamera, time-1000, 1, false) -- &lt;br /&gt;
	start = getTickCount()&lt;br /&gt;
	animTime = time&lt;br /&gt;
	tempPos[1] = {x1,y1,z1}&lt;br /&gt;
	tempPos[2] = {x1t,y1t,z1t}&lt;br /&gt;
	tempPos2[1] = {x2,y2,z2}&lt;br /&gt;
	tempPos2[2] = {x2t,y2t,z2t}&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;,root,camRender)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Table.empty&amp;diff=64784</id>
		<title>Table.empty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Table.empty&amp;diff=64784"/>
		<updated>2019-12-15T07:45:11Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: updated code (check needed)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check is empty table or not.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean table.empty( table a )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''a''': The table for check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the true if table is empty or false in otherwise. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Code&amp;quot; class=&amp;quot;both&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;
function table.empty(a)&lt;br /&gt;
    for _, _ in pairs(a) do&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return true&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;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&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;
print( 'empty = ' .. tostring( table.empty( { [0] = 1 } ) ) ) -- false&lt;br /&gt;
print( 'empty = ' .. tostring( table.empty( { [10] = 10, [2] = 2 } ) ) ) -- false&lt;br /&gt;
print( 'empty = ' .. tostring( table.empty( { } ) ) ) -- true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Kenix &amp;amp; Renkon&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddEventHandler&amp;diff=64731</id>
		<title>AddEventHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddEventHandler&amp;diff=64731"/>
		<updated>2019-11-11T16:30:49Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: revert last edit (wrong)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}} &lt;br /&gt;
{{Important Note|Do '''NOT''' use the same name for your handler function as the event name, as this can lead to confusion if multiple handler functions are used}}&lt;br /&gt;
This function will add an [[event]] handler. An event handler is a function that will be called when the event it's attached to is triggered. See [[event system]] for more information on how the event system works.&lt;br /&gt;
&lt;br /&gt;
Event handlers are functions that are called when a particular event happens. Each event specifies a specific set of variables that are passed to the event handler and can be read by your function. The following global variables are available for use in handler functions:&lt;br /&gt;
*'''source''': the element that triggered the event&lt;br /&gt;
*'''this''': the element that the event handler is attached to&lt;br /&gt;
*'''sourceResource''': the resource that triggered the event&lt;br /&gt;
*'''sourceResourceRoot''': the root element of the resource that triggered the event&lt;br /&gt;
*'''client''': the client that triggered the event using [[triggerServerEvent]]. Not set if the event was not triggered from a client.&lt;br /&gt;
{{New_feature|3|1.0|&lt;br /&gt;
*'''eventName''': the name of the event which triggered the handler function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It is important to remember that events pass up and down the [[element tree]]. An event triggered on the root element is triggered on every element in the tree. An event triggered on any other element is triggered on its ancestors (its parent element and its parent's parent etc) and its children, grandchildren and great-grandchildren. You can use the ''getPropagated'' argument to specify if you wish your handler to receive events that have propagated up or down the tree.&lt;br /&gt;
&lt;br /&gt;
The order in which event handlers are triggered is undefined, you should not rely on one event handler being executed before another.&lt;br /&gt;
{{Note|See [[Script security]] for tips on preventing cheaters when using events and element data}}&lt;br /&gt;
{{Note|See [[Event_Source_Element|Event Source Element]] for a descriptive visualization of the event system handling an event trigger.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = &amp;quot;normal&amp;quot; ] )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''eventName:''' The name of the [[event]] you want to attach the handler function to.&lt;br /&gt;
*'''attachedTo:''' The [[element]] you wish to attach the handler to. The handler will only be called when the event it is attached to is triggered for this element, or one of its children. Often, this can be the root element (meaning the handler will be called when the event is triggered for ''any'' element).&lt;br /&gt;
*'''handlerFunction:''' The handler function you wish to call when the event is triggered. This function will be passed all of the event's parameters as arguments, but it isn't required that it takes all of them.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''getPropagated:''' A boolean representing whether the handler will be triggered if the event was propagated down or up the [[element tree]] (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to ''false'' will only be triggered if ''source == this'').&lt;br /&gt;
{{New_feature|3.0131|1.3.1|&lt;br /&gt;
*'''priority :''' A string representing the trigger order priority relative to other event handlers of the same name. Possible values are:&lt;br /&gt;
**'''&amp;quot;high&amp;quot;'''&lt;br /&gt;
**'''&amp;quot;normal&amp;quot;'''&lt;br /&gt;
**'''&amp;quot;low&amp;quot;'''&lt;br /&gt;
''It is also possible to add finer priority control by appending a positive or negative number to the priority string. For example (in priority order for reference): &amp;quot;high+4&amp;quot; &amp;quot;high&amp;quot; &amp;quot;high-1&amp;quot; &amp;quot;normal-6&amp;quot; &amp;quot;normal-7&amp;quot; &amp;quot;low+1&amp;quot; &amp;quot;low&amp;quot; &amp;quot;low-1&amp;quot;''&lt;br /&gt;
{{Important Note|Anything bound to a specific element will be run before other handlers that are bound to something higher in the element tree (like root) This means that &amp;quot;high+10&amp;quot; bound to root '''won't''' trigger before &amp;quot;normal&amp;quot; bound directly to an element.}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event handler was attached successfully. Returns ''false'' if the specified event could not be found or any parameters were invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
This serverside example sends a message to everyone in the server when a player spawns.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define our handler function&lt;br /&gt;
function onPlayerSpawnHandler ( )&lt;br /&gt;
	-- get the player's name, source is the player because he was spawned&lt;br /&gt;
	local playerName = getPlayerName( source )&lt;br /&gt;
	-- output in the chat box that they've spawned&lt;br /&gt;
	outputChatBox ( playerName .. &amp;quot; has spawned!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerSpawn&amp;quot;, root, onPlayerSpawnHandler ) -- root is a predefined global variable for getRootElement()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.03795|Added priority argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;br /&gt;
[[ru:addEventHandler]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddEventHandler&amp;diff=64730</id>
		<title>AddEventHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddEventHandler&amp;diff=64730"/>
		<updated>2019-11-11T12:32:58Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: how to avoid problems described in first note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}} &lt;br /&gt;
{{Important Note|Do '''NOT''' use the same name for your handler function as the event name, as this can lead to confusion if multiple handler functions are used. Use resourceRoot as attachedTo element to define local events}}&lt;br /&gt;
This function will add an [[event]] handler. An event handler is a function that will be called when the event it's attached to is triggered. See [[event system]] for more information on how the event system works.&lt;br /&gt;
&lt;br /&gt;
Event handlers are functions that are called when a particular event happens. Each event specifies a specific set of variables that are passed to the event handler and can be read by your function. The following global variables are available for use in handler functions:&lt;br /&gt;
*'''source''': the element that triggered the event&lt;br /&gt;
*'''this''': the element that the event handler is attached to&lt;br /&gt;
*'''sourceResource''': the resource that triggered the event&lt;br /&gt;
*'''sourceResourceRoot''': the root element of the resource that triggered the event&lt;br /&gt;
*'''client''': the client that triggered the event using [[triggerServerEvent]]. Not set if the event was not triggered from a client.&lt;br /&gt;
{{New_feature|3|1.0|&lt;br /&gt;
*'''eventName''': the name of the event which triggered the handler function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It is important to remember that events pass up and down the [[element tree]]. An event triggered on the root element is triggered on every element in the tree. An event triggered on any other element is triggered on its ancestors (its parent element and its parent's parent etc) and its children, grandchildren and great-grandchildren. You can use the ''getPropagated'' argument to specify if you wish your handler to receive events that have propagated up or down the tree.&lt;br /&gt;
&lt;br /&gt;
The order in which event handlers are triggered is undefined, you should not rely on one event handler being executed before another.&lt;br /&gt;
{{Note|See [[Script security]] for tips on preventing cheaters when using events and element data}}&lt;br /&gt;
{{Note|See [[Event_Source_Element|Event Source Element]] for a descriptive visualization of the event system handling an event trigger.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = &amp;quot;normal&amp;quot; ] )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''eventName:''' The name of the [[event]] you want to attach the handler function to.&lt;br /&gt;
*'''attachedTo:''' The [[element]] you wish to attach the handler to. The handler will only be called when the event it is attached to is triggered for this element, or one of its children. Often, this can be the root element (meaning the handler will be called when the event is triggered for ''any'' element).&lt;br /&gt;
*'''handlerFunction:''' The handler function you wish to call when the event is triggered. This function will be passed all of the event's parameters as arguments, but it isn't required that it takes all of them.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''getPropagated:''' A boolean representing whether the handler will be triggered if the event was propagated down or up the [[element tree]] (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to ''false'' will only be triggered if ''source == this'').&lt;br /&gt;
{{New_feature|3.0131|1.3.1|&lt;br /&gt;
*'''priority :''' A string representing the trigger order priority relative to other event handlers of the same name. Possible values are:&lt;br /&gt;
**'''&amp;quot;high&amp;quot;'''&lt;br /&gt;
**'''&amp;quot;normal&amp;quot;'''&lt;br /&gt;
**'''&amp;quot;low&amp;quot;'''&lt;br /&gt;
''It is also possible to add finer priority control by appending a positive or negative number to the priority string. For example (in priority order for reference): &amp;quot;high+4&amp;quot; &amp;quot;high&amp;quot; &amp;quot;high-1&amp;quot; &amp;quot;normal-6&amp;quot; &amp;quot;normal-7&amp;quot; &amp;quot;low+1&amp;quot; &amp;quot;low&amp;quot; &amp;quot;low-1&amp;quot;''&lt;br /&gt;
{{Important Note|Anything bound to a specific element will be run before other handlers that are bound to something higher in the element tree (like root) This means that &amp;quot;high+10&amp;quot; bound to root '''won't''' trigger before &amp;quot;normal&amp;quot; bound directly to an element.}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event handler was attached successfully. Returns ''false'' if the specified event could not be found or any parameters were invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
This serverside example sends a message to everyone in the server when a player spawns.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define our handler function&lt;br /&gt;
function onPlayerSpawnHandler ( )&lt;br /&gt;
	-- get the player's name, source is the player because he was spawned&lt;br /&gt;
	local playerName = getPlayerName( source )&lt;br /&gt;
	-- output in the chat box that they've spawned&lt;br /&gt;
	outputChatBox ( playerName .. &amp;quot; has spawned!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerSpawn&amp;quot;, root, onPlayerSpawnHandler ) -- root is a predefined global variable for getRootElement()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.03795|Added priority argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;br /&gt;
[[ru:addEventHandler]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetEventHandlers&amp;diff=63180</id>
		<title>GetEventHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetEventHandlers&amp;diff=63180"/>
		<updated>2019-07-05T10:02:31Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: replaced word 'array' with 'table'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0140|1.4|4973|&lt;br /&gt;
This function gets the attached functions from the event and attached element from current lua script.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getEventHandlers ( string eventName, element attachedTo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''eventName:''' The name of the event. For example ( &amp;quot;onPlayerWasted&amp;quot; ).&lt;br /&gt;
*'''attachedTo:''' The [[element]] attached to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns table with attached functions, empty table otherwise.&lt;br /&gt;
&lt;br /&gt;
===Example===&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;
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )&lt;br /&gt;
	if &lt;br /&gt;
		type( sEventName ) == 'string' and &lt;br /&gt;
		isElement( pElementAttachedTo ) and &lt;br /&gt;
		type( func ) == 'function' &lt;br /&gt;
	then&lt;br /&gt;
		local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )&lt;br /&gt;
		if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions &amp;gt; 0 then&lt;br /&gt;
			for i, v in ipairs( aAttachedFunctions ) do&lt;br /&gt;
				if v == func then&lt;br /&gt;
					return true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onPlayerWasted()&lt;br /&gt;
	outputChatBox( getPlayerName( source ) .. ' died.' )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( 'onPlayerWasted', root, onPlayerWasted )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'removeOnPlayerWastedEvent',&lt;br /&gt;
	function()&lt;br /&gt;
		if isEventHandlerAdded( 'onPlayerWasted', root, onPlayerWasted ) then&lt;br /&gt;
			outputChatBox( 'onPlayerWasted succesfully removed!' )&lt;br /&gt;
			removeEventHandler( 'onPlayerWasted', root, onPlayerWasted )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&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;
{{Event functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetEventHandlers&amp;diff=63179</id>
		<title>GetEventHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetEventHandlers&amp;diff=63179"/>
		<updated>2019-07-05T10:01:55Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: return result fixed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0140|1.4|4973|&lt;br /&gt;
This function gets the attached functions from the event and attached element from current lua script.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getEventHandlers ( string eventName, element attachedTo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''eventName:''' The name of the event. For example ( &amp;quot;onPlayerWasted&amp;quot; ).&lt;br /&gt;
*'''attachedTo:''' The [[element]] attached to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns table with attached functions, empty array otherwise.&lt;br /&gt;
&lt;br /&gt;
===Example===&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;
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )&lt;br /&gt;
	if &lt;br /&gt;
		type( sEventName ) == 'string' and &lt;br /&gt;
		isElement( pElementAttachedTo ) and &lt;br /&gt;
		type( func ) == 'function' &lt;br /&gt;
	then&lt;br /&gt;
		local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )&lt;br /&gt;
		if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions &amp;gt; 0 then&lt;br /&gt;
			for i, v in ipairs( aAttachedFunctions ) do&lt;br /&gt;
				if v == func then&lt;br /&gt;
					return true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onPlayerWasted()&lt;br /&gt;
	outputChatBox( getPlayerName( source ) .. ' died.' )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( 'onPlayerWasted', root, onPlayerWasted )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'removeOnPlayerWastedEvent',&lt;br /&gt;
	function()&lt;br /&gt;
		if isEventHandlerAdded( 'onPlayerWasted', root, onPlayerWasted ) then&lt;br /&gt;
			outputChatBox( 'onPlayerWasted succesfully removed!' )&lt;br /&gt;
			removeEventHandler( 'onPlayerWasted', root, onPlayerWasted )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&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;
{{Event functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=63178</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=63178"/>
		<updated>2019-07-05T09:46:33Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Undo revision 63173 by JeViCo (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=== Table functions ===&lt;br /&gt;
*[[isValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns true if the value exists in the table, false if the value does not exist in the table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableToSql]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to save the table in the database (sql).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTableFromSql]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functionality is used to obtain saved tables using the function ([https://wiki.multitheftauto.com/wiki/SetTableToSql SetTableToSql ]).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a string range to a table containing number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Sort_Functions]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» These functions are able to sort your tables by a key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether two given tables are equal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a table is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function merges two or more tables together.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.removeValue]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function removes a specified value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.getRandomRows]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns random rows from table.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ACL functions ===&lt;br /&gt;
*[[aclGroupClone]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function clone a group to another group with/without ACLs and/or objects.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all ACL groups on a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is server admin or staff.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives an existing ACL group a new name.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Account functions ===&lt;br /&gt;
*[[removeAccountData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove data from an account.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to obtain a player by the name of his account.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Camera functions ===&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&lt;br /&gt;
&lt;br /&gt;
=== Cursor functions ===&lt;br /&gt;
*[[getCursorMovedOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drawing functions ===&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an animated 2D window on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawDashedLine]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a line with dashes.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRing]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a ring with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion crea un rectangle con un texto dentro.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites in 2D.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImageOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an image on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLinedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a rectangle outline with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLoading]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a loading bar on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawOctagon3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a 3D Octagon&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a custom polygon on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawProgressBar]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates a progress bar drawed using DirectDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTriangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a triangle with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the font size from given height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wordWrap]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function breaks a long string into a table of separate lines limited to a specific length in pixels, for drawing separately.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRombo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a Rhombus.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Effects functions ===&lt;br /&gt;
*[[attachEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Elements functions === &lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the specified element's speed in m/s, km/h or mph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are within a marker's collision shape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in the player's camera picture area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if an element's range to a main point is within the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is within a collision shape element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set the speed of an element in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Input functions ===&lt;br /&gt;
*[[bindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[unbindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getClipboard]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This event returns the contents of the clipboard by pressing ctrl + v / ctrl + V. Event triggered ONLY if cursor is showing.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isFireKey]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a key is the firing key.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Data functions === &lt;br /&gt;
*[[byte2human]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts an integer (number of bytes) into a human-readable unit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[capitalize]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts and formats large numbers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts server ticks to a unix timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertTextToSpeech]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts the provided text to a speech in the provided language which players can hear.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a random string which uses ASCII characters. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getEasterDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns easter date monthday and month for a given year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonthH]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function convert english months to arabic months&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonthM]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives you the real months name&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRGColorFromPercentage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia', sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function returns two integers representing red and green colors according to the specified percentage.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the UNIX timestamp of a specified date and time.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a boolean representing if a given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isValidMail]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a provided e-mail string is valid.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[removeHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove hexadecimal numbers (colors, for example) from strings.&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts the amount of occurences of a string in a string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a physical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion sirve para obtener la distancia entre dos elementos.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLowerOrUpper]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function checks whether the letter is large or small.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GUI functions === &lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function centers a CEGUI window element responsively in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiMoveElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function moves guiElement by/like using moveObject.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseOnGUICloseButton]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a gui-window's native close button.&amp;lt;/span&amp;gt;&lt;br /&gt;
=====Comboboxes=====&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function adjusts a CEGUI combobox element to have the correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAddPlayersName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is add players name in combobox .&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Gridlists=====&lt;br /&gt;
*[[guiGridListAddPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function add all online players to a grid list.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetColumnIDFromTitle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a gridlist's column ID from the column title.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetSelectedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string containing the inner text of a selected gridlist item.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the GridList row index from the specified text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if some text exist or not in the GridList.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertGridListToText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts grid list contents to text.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Labels=====&lt;br /&gt;
*[[guiLabelAddEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function add an effects to the gui-label like (shadow, outline).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Marker functions ===&lt;br /&gt;
*[[createMarkerAttachedTo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a marker that is attached to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Math functions ===&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the client-side floating-point precision of 24-bits.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.hypot]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the Hypotenuse of the triangle given by sides x and y.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a percentage from two number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[reMap]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Re-maps a number from one range to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.isPointInPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Check if point is inside polygon or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.polygonArea]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Compute area of any polygon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.randomDiff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Generates a pseudo-random integer that's always different from the last random number generated.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Map functions ===&lt;br /&gt;
*[[assignLod]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function lets you conveniently generate and apply a LOD model to a mapping object&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ped functions ===&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInVehicles]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the players insides vehicles from a specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGuestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a players not login or players Guest .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all logged-in administrators.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedEyesPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds eyes position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a pedestrians's maximum health by converting it from their maximum health stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxOxygenLevel]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from partial name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of players that have the specified data name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all Players In Group .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all players in photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a pedestrian is aiming their weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAimingNearPed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is similar to isPedAiming but uses a colshape to be more precise.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified pedestrian is driving a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is in a specified team.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Player functions ===&lt;br /&gt;
*[[countPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number of players that are within a certain range of the specified coordinates.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[warpToPlayer]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function make player warp to another player.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
&lt;br /&gt;
=== Sound functions ===&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element has finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[stopSoundSlowly]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function stop your sound element slowly.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser functions ===&lt;br /&gt;
*[[playVideo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function plays a video on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Team functions ===&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element by the specified color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamWithFewestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element with least players of all the specified teams.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicle functions === &lt;br /&gt;
*[[getNearestVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the nearest vehicle to the specified player in a specified distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRandomVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a random vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all valid vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehiclesCountByType]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the amount of vehicles by the given type as an integer value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOccupied]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is occupied.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleReversing]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is moving backwards.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Weapon functions === &lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPreviousAndNextWeapon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the next weapon and previous.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XML functions ===&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all children of a XML node.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Utility ===&lt;br /&gt;
*[[animate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use interpolateBetween without render event and easily used.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any client-side function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if its arguments are of the right type and calls the error-function if one is not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function applies a fix for hidden coroutine error messages.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functions returns the ban of the given playername.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCurrentFPS]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the frames per second at which GTA: SA is running.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isCursorOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the cursor is in a particular area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a cursor position is in circular area or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns ''a time-saving'' iterator for your for-loops.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[thisCommandHandlersExist]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This method checks a string if this exist as command Handlers&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[vector3:compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This method checks whether two vectors match, with optional precision.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[preprocessor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to use gcc macros.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=63173</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=63173"/>
		<updated>2019-07-05T09:23:28Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: added file functions section with a new useful function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=== Table functions ===&lt;br /&gt;
*[[isValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns true if the value exists in the table, false if the value does not exist in the table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableToSql]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to save the table in the database (sql).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTableFromSql]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functionality is used to obtain saved tables using the function ([https://wiki.multitheftauto.com/wiki/SetTableToSql SetTableToSql ]).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a string range to a table containing number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Sort_Functions]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» These functions are able to sort your tables by a key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether two given tables are equal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a table is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function merges two or more tables together.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.removeValue]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function removes a specified value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.getRandomRows]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns random rows from table.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ACL functions ===&lt;br /&gt;
*[[aclGroupClone]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function clone a group to another group with/without ACLs and/or objects.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all ACL groups on a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is server admin or staff.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives an existing ACL group a new name.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Account functions ===&lt;br /&gt;
*[[removeAccountData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove data from an account.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to obtain a player by the name of his account.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Camera functions ===&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&lt;br /&gt;
&lt;br /&gt;
=== Cursor functions ===&lt;br /&gt;
*[[getCursorMovedOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drawing functions ===&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an animated 2D window on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawDashedLine]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a line with dashes.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRing]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a ring with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion crea un rectangle con un texto dentro.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites in 2D.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImageOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws an image on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLinedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a rectangle outline with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLoading]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a loading bar on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawOctagon3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a 3D Octagon&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a custom polygon on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawProgressBar]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates a progress bar drawed using DirectDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTriangle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a triangle with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the font size from given height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wordWrap]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function breaks a long string into a table of separate lines limited to a specific length in pixels, for drawing separately.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRombo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a Rhombus.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Effects functions ===&lt;br /&gt;
*[[attachEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Elements functions === &lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the specified element's speed in m/s, km/h or mph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are within a marker's collision shape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in the player's camera picture area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if an element's range to a main point is within the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is within a collision shape element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set the speed of an element in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Input functions ===&lt;br /&gt;
*[[bindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[unbindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getClipboard]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This event returns the contents of the clipboard by pressing ctrl + v / ctrl + V. Event triggered ONLY if cursor is showing.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isFireKey]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a key is the firing key.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Data functions === &lt;br /&gt;
*[[byte2human]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts an integer (number of bytes) into a human-readable unit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[capitalize]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts and formats large numbers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts server ticks to a unix timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertTextToSpeech]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts the provided text to a speech in the provided language which players can hear.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a random string which uses ASCII characters. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getEasterDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns easter date monthday and month for a given year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonthH]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function convert english months to arabic months&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonthM]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gives you the real months name&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRGColorFromPercentage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia', sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function returns two integers representing red and green colors according to the specified percentage.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the UNIX timestamp of a specified date and time.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a boolean representing if a given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isValidMail]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a provided e-mail string is valid.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[removeHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove hexadecimal numbers (colors, for example) from strings.&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts the amount of occurences of a string in a string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a physical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion sirve para obtener la distancia entre dos elementos.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLowerOrUpper]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function checks whether the letter is large or small.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GUI functions === &lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function centers a CEGUI window element responsively in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiMoveElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function moves guiElement by/like using moveObject.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseOnGUICloseButton]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a gui-window's native close button.&amp;lt;/span&amp;gt;&lt;br /&gt;
=====Comboboxes=====&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function adjusts a CEGUI combobox element to have the correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAddPlayersName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is add players name in combobox .&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Gridlists=====&lt;br /&gt;
*[[guiGridListAddPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function add all online players to a grid list.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetColumnIDFromTitle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a gridlist's column ID from the column title.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetSelectedText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string containing the inner text of a selected gridlist item.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the GridList row index from the specified text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if some text exist or not in the GridList.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertGridListToText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts grid list contents to text.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Labels=====&lt;br /&gt;
*[[guiLabelAddEffect]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function add an effects to the gui-label like (shadow, outline).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Marker functions ===&lt;br /&gt;
*[[createMarkerAttachedTo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function creates a marker that is attached to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Math functions ===&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the client-side floating-point precision of 24-bits.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.hypot]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the Hypotenuse of the triangle given by sides x and y.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a percentage from two number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[reMap]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Re-maps a number from one range to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.isPointInPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Check if point is inside polygon or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.polygonArea]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Compute area of any polygon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.randomDiff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Generates a pseudo-random integer that's always different from the last random number generated.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Map functions ===&lt;br /&gt;
*[[assignLod]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function lets you conveniently generate and apply a LOD model to a mapping object&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ped functions ===&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInVehicles]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the players insides vehicles from a specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGuestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a players not login or players Guest .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all logged-in administrators.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedEyesPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds eyes position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a pedestrians's maximum health by converting it from their maximum health stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxOxygenLevel]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from partial name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of players that have the specified data name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInGroup]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all Players In Group .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all players in photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a pedestrian is aiming their weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAimingNearPed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This is similar to isPedAiming but uses a colshape to be more precise.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified pedestrian is driving a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is in a specified team.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Player functions ===&lt;br /&gt;
*[[countPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number of players that are within a certain range of the specified coordinates.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[warpToPlayer]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function make player warp to another player.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
&lt;br /&gt;
=== Sound functions ===&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element has finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[stopSoundSlowly]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function stop your sound element slowly.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser functions ===&lt;br /&gt;
*[[playVideo]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function plays a video on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Team functions ===&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element by the specified color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamWithFewestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element with least players of all the specified teams.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicle functions === &lt;br /&gt;
*[[getNearestVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the nearest vehicle to the specified player in a specified distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRandomVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a random vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all valid vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehiclesCountByType]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the amount of vehicles by the given type as an integer value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOccupied]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is occupied.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleReversing]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is moving backwards.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Weapon functions === &lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPreviousAndNextWeapon]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the next weapon and previous.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XML functions ===&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all children of a XML node.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== File functions ===&lt;br /&gt;
*[[fileClear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to clear file content.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Utility ===&lt;br /&gt;
*[[animate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use interpolateBetween without render event and easily used.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any client-side function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if its arguments are of the right type and calls the error-function if one is not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function applies a fix for hidden coroutine error messages.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This functions returns the ban of the given playername.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCurrentFPS]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the frames per second at which GTA: SA is running.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isCursorOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the cursor is in a particular area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a cursor position is in circular area or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns ''a time-saving'' iterator for your for-loops.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[thisCommandHandlersExist]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This method checks a string if this exist as command Handlers&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[vector3:compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This method checks whether two vectors match, with optional precision.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[preprocessor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to use gcc macros.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetTextWidth&amp;diff=62333</id>
		<title>DxGetTextWidth</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetTextWidth&amp;diff=62333"/>
		<updated>2019-03-07T11:15:48Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: Undo revision 62332 by JeViCo (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function retrieves the theoretical width of a certain piece of text, if it were to be drawn using [[dxDrawText]].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' This function is relative to the client's screen resolution.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float dxGetTextWidth ( string text, [float scale=1, mixed font=&amp;quot;default&amp;quot;, bool bColorCoded=false] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{New feature/item|3.0141|1.4.1|6942|{{OOP|This syntax requires you to ignore the font argument above| [[Element/DX font|font]]:getTextWidth}}}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''text:''' A string representing the text for which you wish to retrieve with width for.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''scale:''' The size of the text.&lt;br /&gt;
* '''font:''' Either a custom [[DX font]] element or the name of a built-in dx font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
* '''bColorCoded:''' Should we exclude color codes from the width? (false will include the hex in the length)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the float of the width of the text. &lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This will show you the width of a message in a normal chatbox sent by a player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function dxwidth(msg)&lt;br /&gt;
    chatbox = getChatboxLayout()&lt;br /&gt;
    local length = dxGetTextWidth(msg,chatbox[&amp;quot;chat_scale&amp;quot;][1])&lt;br /&gt;
    outputChatBox(tostring(length))&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientChatMessage&amp;quot;,root,dxwidth)&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;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxGetTextWidth]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxGetTextWidth&amp;diff=62332</id>
		<title>DxGetTextWidth</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxGetTextWidth&amp;diff=62332"/>
		<updated>2019-03-07T11:09:17Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function retrieves the theoretical width of a certain piece of text, if it were to be drawn using [[dxDrawText]].&lt;br /&gt;
{{Note|The returned width will be in logical units which are 1.75 times the actual pixel width.}}&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' This function is relative to the client's screen resolution.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float dxGetTextWidth ( string text, [float scale=1, mixed font=&amp;quot;default&amp;quot;, bool bColorCoded=false] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{New feature/item|3.0141|1.4.1|6942|{{OOP|This syntax requires you to ignore the font argument above| [[Element/DX font|font]]:getTextWidth}}}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''text:''' A string representing the text for which you wish to retrieve with width for.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''scale:''' The size of the text.&lt;br /&gt;
* '''font:''' Either a custom [[DX font]] element or the name of a built-in dx font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
* '''bColorCoded:''' Should we exclude color codes from the width? (false will include the hex in the length)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the float of the width of the text. &lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This will show you the width of a message in a normal chatbox sent by a player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function dxwidth(msg)&lt;br /&gt;
    chatbox = getChatboxLayout()&lt;br /&gt;
    local length = dxGetTextWidth(msg,chatbox[&amp;quot;chat_scale&amp;quot;][1])&lt;br /&gt;
    outputChatBox(tostring(length))&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientChatMessage&amp;quot;,root,dxwidth)&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;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxGetTextWidth]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FetchRemote&amp;diff=61777</id>
		<title>FetchRemote</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FetchRemote&amp;diff=61777"/>
		<updated>2018-12-30T20:03:32Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes.&lt;br /&gt;
&lt;br /&gt;
In the case when the call fails, a string containing &amp;quot;ERROR&amp;quot; followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts.&lt;br /&gt;
&lt;br /&gt;
If you are using fetchRemote to connect to a PHP script, you can use ''file_get_contents(&amp;quot;php://input&amp;quot;)'' to read the '''postData''' sent from this function.&lt;br /&gt;
{{Note|Client side function only works with the server the player is connected to unless the domain has been accepted with [[requestBrowserDomains]]}}&lt;br /&gt;
{{ Warning| function won't trigger inside another fetchRemote function }}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fetchRemote ( string URL[, string queueName = &amp;quot;default&amp;quot; ][, int connectionAttempts = 10, int connectTimeout = 10000 ], function callbackFunction, [ string postData = &amp;quot;&amp;quot;, bool postIsBinary = false, [ arguments... ] ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''URL:''' A full URL in the format ''&amp;lt;nowiki&amp;gt;http://hostname/path/file.ext&amp;lt;/nowiki&amp;gt;''. A port can be specified with a colon followed by a port number appended to the hostname.&lt;br /&gt;
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:&lt;br /&gt;
**'''''responseData''''' - A string containing the remote response or &amp;quot;ERROR&amp;quot; if there was a problem&lt;br /&gt;
**'''''errno''''' - A number containing the error number or zero if there was no error. A list of possible error values are:&lt;br /&gt;
{{Error_codes_for_callRemote_and_fetchRemote}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left:19px;&amp;quot;&amp;gt;&lt;br /&gt;
*'''''arguments...''''' - The arguments that were passed into fetchRemote&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New items|4.0153|1.5.3-9.11270|&lt;br /&gt;
*'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is &amp;quot;default&amp;quot;. Requests in the same queue are processed in order, one at a time.&lt;br /&gt;
}}&lt;br /&gt;
*'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''In the case of a non-responding remote server, each connection attempt will timeout after 10 seconds. Therefore, the default setting of 10 connection attempts means it will be 100 seconds before your script gets a callback about the error. Reducing this value to 2 for example, will decrease that period to 20 seconds''&lt;br /&gt;
*'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out&lt;br /&gt;
*'''postData:''' A string specifying any data you want to send to the remote HTTP server.&lt;br /&gt;
*'''postIsBinary :''' A boolean specifying if the data is text, or binary.&lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the callback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11342|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''URL:''' A full URL in the format ''&amp;lt;nowiki&amp;gt;http://hostname/path/file.ext&amp;lt;/nowiki&amp;gt;''. A port can be specified with a colon followed by a port number appended to the hostname.&lt;br /&gt;
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:&lt;br /&gt;
**'''''responseData''''' - A string containing the remote response&lt;br /&gt;
**'''''responseInfo''''' - A table containing:&lt;br /&gt;
***'''''success''''' - A boolean indicating if the request was successful.&lt;br /&gt;
***'''''statusCode''''' - An integer status/error code&lt;br /&gt;
***'''''headers''''' - A table containing the HTTP response headers&lt;br /&gt;
**'''''arguments...''''' - The arguments that were passed into fetchRemote&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''options:''' A table containing any request options:&lt;br /&gt;
**'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is &amp;quot;default&amp;quot;. Requests in the same queue are processed in order, one at a time.&lt;br /&gt;
**'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''(Defaults to 10)''&lt;br /&gt;
**'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out. ''(Defaults to 10000)''&lt;br /&gt;
**'''postData:''' A string specifying any data you want to send to the remote HTTP server.&lt;br /&gt;
**'''postIsBinary :''' A boolean specifying if the data is text, or binary. ''(Defaults to false)''&lt;br /&gt;
**'''method:''' A string specifying the request method. ''(Defaults to GET or POST)''&lt;br /&gt;
**'''headers:''' A table containing HTTP request headers. ''e.g.{ Pragma&amp;amp;#61;&amp;quot;no-cache&amp;quot; }''&lt;br /&gt;
**'''maxRedirects:''' An integer limiting the number of HTTP redirections to automatically follow. ''(Defaults to 8)''&lt;br /&gt;
**'''username:''' A string specifying the username for protected pages.&lt;br /&gt;
**'''password:''' A string specifying the password for protected pages.&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11413|&lt;br /&gt;
**'''formFields:''' A table containing form items to submit.  ''e.g.{ name&amp;amp;#61;&amp;quot;bob&amp;quot;, email&amp;amp;#61;&amp;quot;bob@example.com&amp;quot; }''&lt;br /&gt;
}}&lt;br /&gt;
*'''arguments:''' A table containing arguments you may want to pass to the callback.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the arguments are correct, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example shows you how you can fetch an image from a web page, and transfer it to a particular client:&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;
&lt;br /&gt;
function startImageDownload( playerToReceive )&lt;br /&gt;
    fetchRemote ( &amp;quot;http://www.example.com/image.jpg&amp;quot;, myCallback, &amp;quot;&amp;quot;, false, playerToReceive )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function myCallback( responseData, errno, playerToReceive )&lt;br /&gt;
    if errno == 0 then&lt;br /&gt;
        triggerClientEvent( playerToReceive, &amp;quot;onClientGotImage&amp;quot;, resourceRoot, responseData )&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;
&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;
addEvent( &amp;quot;onClientGotImage&amp;quot;, true )&lt;br /&gt;
addEventHandler( &amp;quot;onClientGotImage&amp;quot;, resourceRoot,&lt;br /&gt;
    function( pixels )&lt;br /&gt;
        if myTexture then&lt;br /&gt;
            destroyElement( myTexture )&lt;br /&gt;
        end&lt;br /&gt;
        myTexture = dxCreateTexture( pixels )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myTexture then&lt;br /&gt;
            local w,h = dxGetMaterialSize( myTexture )&lt;br /&gt;
            dxDrawImage( 200, 100, w, h, myTexture )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11413|&lt;br /&gt;
Example sending email via a web service (adopted from examples on https://documentation.mailgun.com/user_manual.html)&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;
sendOptions = {&lt;br /&gt;
    queueName = &amp;quot;My Mailgun queue&amp;quot;,&lt;br /&gt;
    connectionAttempts = 3,&lt;br /&gt;
    connectTimeout = 5000,&lt;br /&gt;
    formFields = {&lt;br /&gt;
        from=&amp;quot;Excited User &amp;lt;excited@samples.mailgun.org&amp;gt;&amp;quot;,&lt;br /&gt;
        to=&amp;quot;devs@mailgun.net&amp;quot;,&lt;br /&gt;
        subject=&amp;quot;Hello&amp;quot;,&lt;br /&gt;
        text=&amp;quot;Testing some Mailgun awesomness!&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    username=&amp;quot;api&amp;quot;,&lt;br /&gt;
    password=&amp;quot;key-3ax6xnjp29jd6fds4gc373sgvjxteol0&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
fetchRemote( &amp;quot;https://api.mailgun.net/v3/samples.mailgun.org/messages&amp;quot;, sendOptions, mailgunCompleteCallback )&lt;br /&gt;
&lt;br /&gt;
function mailgunCompleteCallback(data, info)&lt;br /&gt;
    outputDebugString( &amp;quot;mailgunComplete&amp;quot;&lt;br /&gt;
            .. &amp;quot; success:&amp;quot; .. tostring(info.success)&lt;br /&gt;
            .. &amp;quot; statusCode:&amp;quot; .. tostring(info.statusCode)&lt;br /&gt;
            .. &amp;quot; data:&amp;quot; .. tostring(data)&lt;br /&gt;
            )&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;
==Requirements==&lt;br /&gt;
{{Requirements|1.3.0-9.03739|1.3.2|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04605|Added connectionAttempts argument}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added client side}}&lt;br /&gt;
{{ChangelogItem|1.5.3-9.11270|Added queueName argument}}&lt;br /&gt;
{{ChangelogItem|1.5.4-9.11342|Added alternative syntax}}&lt;br /&gt;
{{ChangelogItem|1.5.4-9.11413|Added formFields}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=59176</id>
		<title>FileRead</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=59176"/>
		<updated>2018-09-16T06:28:22Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of bytes from the given file starting at its current read/write position, and returns them as a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileRead ( file theFile, int count )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:read}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to read from. Use [[fileOpen]] to obtain this handle.&lt;br /&gt;
*'''count:''' The number of bytes you wish to read.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the bytes that were read in a string. Note that this string might not contain as many bytes as you specified if an error occured, i.e. end of file.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function readFile(path)&lt;br /&gt;
    local file = fileOpen(path) -- attempt to open the file&lt;br /&gt;
    if not file then&lt;br /&gt;
        return false -- stop function on failture&lt;br /&gt;
    end&lt;br /&gt;
    local count = fileGetSize(file) -- get file's total size&lt;br /&gt;
    local data = fileRead(file, count) -- read whole file&lt;br /&gt;
    fileClose(file) -- close the file once we're done with it&lt;br /&gt;
    outputConsole(data) -- output code in console&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;readfile&amp;quot;,function(cmd,fileName) -- add command to test this function&lt;br /&gt;
    readFile(fileName) -- execute the function&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[fileOpen]] sets the read/write position to the beginning of the file.&lt;br /&gt;
[[fileGetSize]] gets the total size in bytes of given file.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=59175</id>
		<title>FileRead</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=59175"/>
		<updated>2018-09-16T06:26:41Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of bytes from the given file starting at its current read/write position, and returns them as a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileRead ( file theFile, int count )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:read}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to read from. Use [[fileOpen]] to obtain this handle.&lt;br /&gt;
*'''count:''' The number of bytes you wish to read.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the bytes that were read in a string. Note that this string might not contain as many bytes as you specified if an error occured, i.e. end of file.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function readFile(path)&lt;br /&gt;
    local file = fileOpen(path) -- attempt to open the file&lt;br /&gt;
    if not file then&lt;br /&gt;
        return false -- stop function on failture&lt;br /&gt;
    end&lt;br /&gt;
    local count = fileGetSize(file) -- get file's total size&lt;br /&gt;
    local data = fileRead(file, count) -- read whole file&lt;br /&gt;
    fileClose(file) -- close the file once we're done with it&lt;br /&gt;
    outputConsole(data) -- output code in console&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;readFile&amp;quot;,function(cmd,fileName) -- add command to test this function&lt;br /&gt;
    readFile(fileName) -- execute the function&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[fileOpen]] sets the read/write position to the beginning of the file.&lt;br /&gt;
[[fileGetSize]] gets the total size in bytes of given file.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=59174</id>
		<title>FileRead</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=59174"/>
		<updated>2018-09-16T06:26:10Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of bytes from the given file starting at its current read/write position, and returns them as a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileRead ( file theFile, int count )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:read}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to read from. Use [[fileOpen]] to obtain this handle.&lt;br /&gt;
*'''count:''' The number of bytes you wish to read.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the bytes that were read in a string. Note that this string might not contain as many bytes as you specified if an error occured, i.e. end of file.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function readFile(path)&lt;br /&gt;
    local file = fileOpen(path) -- attempt to open the file&lt;br /&gt;
    if not file then&lt;br /&gt;
        return false -- stop function on failture&lt;br /&gt;
    end&lt;br /&gt;
    local count = fileGetSize(file) -- get file's total size&lt;br /&gt;
    local data = fileRead(file, count) -- read whole file&lt;br /&gt;
    fileClose(file) -- close the file once we're done with it&lt;br /&gt;
    outputConsole(data) -- output code in console&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;readFile&amp;quot;,function(cmd,fileName) -- add command to test this function&lt;br /&gt;
    readFile(fileName) -- execute the function&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[fileOpen]] sets the read/write position to the beginning of the file.&lt;br /&gt;
[[fileGetSize]] gets the total size in bytes of given file&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateEffect&amp;diff=59156</id>
		<title>CreateEffect</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateEffect&amp;diff=59156"/>
		<updated>2018-09-14T16:38:32Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
Creates an [[Element/Effect|effect]] on specified position.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|Not all effects support rotation (e.g. the &amp;quot;fire&amp;quot; - effect doesn't).}}&lt;br /&gt;
{{Note|All effects have their own duration.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;effect createEffect ( string name, float x, float y, float z [, float rX, float rY, float rZ, float drawDistance = 0, soundEnabled = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Effect]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''name:''' A string contains [[Element/Effect#Effects_list|effect name]].&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''rX:''' A floating point number representing the rotation about the X axis in degrees.&lt;br /&gt;
*'''rY:''' A floating point number representing the rotation about the Y axis in degrees.&lt;br /&gt;
*'''rZ:''' A floating point number representing the rotation about the Z axis in degrees.&lt;br /&gt;
*'''drawDistance:''' A floating point number between 1 and 8191 which represents the draw distance of the effect, or 0 to use the default draw distance.&lt;br /&gt;
{{New feature/item|3.0155|1.5.5||&lt;br /&gt;
*'''soundEnabled:''' to enable the sound of the effect.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Returns ===&lt;br /&gt;
Returns the [[Element/Effect|effect]] element if creation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--There are 82 effects&lt;br /&gt;
&lt;br /&gt;
local effectNames = {&lt;br /&gt;
&amp;quot;blood_heli&amp;quot;,&amp;quot;boat_prop&amp;quot;,&amp;quot;camflash&amp;quot;,&amp;quot;carwashspray&amp;quot;,&amp;quot;cement&amp;quot;,&amp;quot;cloudfast&amp;quot;,&amp;quot;coke_puff&amp;quot;,&amp;quot;coke_trail&amp;quot;,&amp;quot;cigarette_smoke&amp;quot;,&lt;br /&gt;
&amp;quot;explosion_barrel&amp;quot;,&amp;quot;explosion_crate&amp;quot;,&amp;quot;explosion_door&amp;quot;,&amp;quot;exhale&amp;quot;,&amp;quot;explosion_fuel_car&amp;quot;,&amp;quot;explosion_large&amp;quot;,&amp;quot;explosion_medium&amp;quot;,&lt;br /&gt;
&amp;quot;explosion_molotov&amp;quot;,&amp;quot;explosion_small&amp;quot;,&amp;quot;explosion_tiny&amp;quot;,&amp;quot;extinguisher&amp;quot;,&amp;quot;flame&amp;quot;,&amp;quot;fire&amp;quot;,&amp;quot;fire_med&amp;quot;,&amp;quot;fire_large&amp;quot;,&amp;quot;flamethrower&amp;quot;,&lt;br /&gt;
&amp;quot;fire_bike&amp;quot;,&amp;quot;fire_car&amp;quot;,&amp;quot;gunflash&amp;quot;,&amp;quot;gunsmoke&amp;quot;,&amp;quot;insects&amp;quot;,&amp;quot;heli_dust&amp;quot;,&amp;quot;jetpack&amp;quot;,&amp;quot;jetthrust&amp;quot;,&amp;quot;nitro&amp;quot;,&amp;quot;molotov_flame&amp;quot;,&lt;br /&gt;
&amp;quot;overheat_car&amp;quot;,&amp;quot;overheat_car_electric&amp;quot;,&amp;quot;prt_blood&amp;quot;,&amp;quot;prt_boatsplash&amp;quot;,&amp;quot;prt_bubble&amp;quot;,&amp;quot;prt_cardebris&amp;quot;,&amp;quot;prt_collisionsmoke&amp;quot;,&lt;br /&gt;
&amp;quot;prt_glass&amp;quot;,&amp;quot;prt_gunshell&amp;quot;,&amp;quot;prt_sand&amp;quot;,&amp;quot;prt_sand2&amp;quot;,&amp;quot;prt_smokeII_3_expand&amp;quot;,&amp;quot;prt_smoke_huge&amp;quot;,&amp;quot;prt_spark&amp;quot;,&amp;quot;prt_spark_2&amp;quot;,&lt;br /&gt;
&amp;quot;prt_splash&amp;quot;,&amp;quot;prt_wake&amp;quot;,&amp;quot;prt_watersplash&amp;quot;,&amp;quot;prt_wheeldirt&amp;quot;,&amp;quot;petrolcan&amp;quot;,&amp;quot;puke&amp;quot;,&amp;quot;riot_smoke&amp;quot;,&amp;quot;spraycan&amp;quot;,&amp;quot;smoke30lit&amp;quot;,&amp;quot;smoke30m&amp;quot;,&lt;br /&gt;
&amp;quot;smoke50lit&amp;quot;,&amp;quot;shootlight&amp;quot;,&amp;quot;smoke_flare&amp;quot;,&amp;quot;tank_fire&amp;quot;,&amp;quot;teargas&amp;quot;,&amp;quot;teargasAD&amp;quot;,&amp;quot;tree_hit_fir&amp;quot;,&amp;quot;tree_hit_palm&amp;quot;,&amp;quot;vent&amp;quot;,&amp;quot;vent2&amp;quot;,&lt;br /&gt;
&amp;quot;water_hydrant&amp;quot;,&amp;quot;water_ripples&amp;quot;,&amp;quot;water_speed&amp;quot;,&amp;quot;water_splash&amp;quot;,&amp;quot;water_splash_big&amp;quot;,&amp;quot;water_splsh_sml&amp;quot;,&amp;quot;water_swim&amp;quot;,&amp;quot;waterfall_end&amp;quot;,&lt;br /&gt;
&amp;quot;water_fnt_tme&amp;quot;,&amp;quot;water_fountain&amp;quot;,&amp;quot;wallbust&amp;quot;,&amp;quot;WS_factorysmoke&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;createEffect&amp;quot;, function(_, effectIndex)&lt;br /&gt;
   effectIndex = tonumber(effectIndex)&lt;br /&gt;
   if effectIndex and type(effectIndex) == &amp;quot;number&amp;quot; then&lt;br /&gt;
      if effectIndex &amp;gt; 0 and effectIndex &amp;lt;= #effectNames then&lt;br /&gt;
         createEffect(effectNames[effectIndex], Vector3( getElementPosition( getLocalPlayer() ) ), 0, 0, 0)&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
--Example Command: /createEffect 3&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.4.0-9.06892|Added drawDistance argument}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{Client_Effects_functions}}&lt;br /&gt;
[[ru:createEffect]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateEffect&amp;diff=59155</id>
		<title>CreateEffect</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateEffect&amp;diff=59155"/>
		<updated>2018-09-14T16:38:15Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
Creates an [[Element/Effect|effect]] on specified position.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|Not all effects support rotation (e.g. the &amp;quot;fire&amp;quot; - effect doesn't).}}&lt;br /&gt;
{{Note|All effects have their own duration).}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;effect createEffect ( string name, float x, float y, float z [, float rX, float rY, float rZ, float drawDistance = 0, soundEnabled = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Effect]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''name:''' A string contains [[Element/Effect#Effects_list|effect name]].&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''rX:''' A floating point number representing the rotation about the X axis in degrees.&lt;br /&gt;
*'''rY:''' A floating point number representing the rotation about the Y axis in degrees.&lt;br /&gt;
*'''rZ:''' A floating point number representing the rotation about the Z axis in degrees.&lt;br /&gt;
*'''drawDistance:''' A floating point number between 1 and 8191 which represents the draw distance of the effect, or 0 to use the default draw distance.&lt;br /&gt;
{{New feature/item|3.0155|1.5.5||&lt;br /&gt;
*'''soundEnabled:''' to enable the sound of the effect.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Returns ===&lt;br /&gt;
Returns the [[Element/Effect|effect]] element if creation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--There are 82 effects&lt;br /&gt;
&lt;br /&gt;
local effectNames = {&lt;br /&gt;
&amp;quot;blood_heli&amp;quot;,&amp;quot;boat_prop&amp;quot;,&amp;quot;camflash&amp;quot;,&amp;quot;carwashspray&amp;quot;,&amp;quot;cement&amp;quot;,&amp;quot;cloudfast&amp;quot;,&amp;quot;coke_puff&amp;quot;,&amp;quot;coke_trail&amp;quot;,&amp;quot;cigarette_smoke&amp;quot;,&lt;br /&gt;
&amp;quot;explosion_barrel&amp;quot;,&amp;quot;explosion_crate&amp;quot;,&amp;quot;explosion_door&amp;quot;,&amp;quot;exhale&amp;quot;,&amp;quot;explosion_fuel_car&amp;quot;,&amp;quot;explosion_large&amp;quot;,&amp;quot;explosion_medium&amp;quot;,&lt;br /&gt;
&amp;quot;explosion_molotov&amp;quot;,&amp;quot;explosion_small&amp;quot;,&amp;quot;explosion_tiny&amp;quot;,&amp;quot;extinguisher&amp;quot;,&amp;quot;flame&amp;quot;,&amp;quot;fire&amp;quot;,&amp;quot;fire_med&amp;quot;,&amp;quot;fire_large&amp;quot;,&amp;quot;flamethrower&amp;quot;,&lt;br /&gt;
&amp;quot;fire_bike&amp;quot;,&amp;quot;fire_car&amp;quot;,&amp;quot;gunflash&amp;quot;,&amp;quot;gunsmoke&amp;quot;,&amp;quot;insects&amp;quot;,&amp;quot;heli_dust&amp;quot;,&amp;quot;jetpack&amp;quot;,&amp;quot;jetthrust&amp;quot;,&amp;quot;nitro&amp;quot;,&amp;quot;molotov_flame&amp;quot;,&lt;br /&gt;
&amp;quot;overheat_car&amp;quot;,&amp;quot;overheat_car_electric&amp;quot;,&amp;quot;prt_blood&amp;quot;,&amp;quot;prt_boatsplash&amp;quot;,&amp;quot;prt_bubble&amp;quot;,&amp;quot;prt_cardebris&amp;quot;,&amp;quot;prt_collisionsmoke&amp;quot;,&lt;br /&gt;
&amp;quot;prt_glass&amp;quot;,&amp;quot;prt_gunshell&amp;quot;,&amp;quot;prt_sand&amp;quot;,&amp;quot;prt_sand2&amp;quot;,&amp;quot;prt_smokeII_3_expand&amp;quot;,&amp;quot;prt_smoke_huge&amp;quot;,&amp;quot;prt_spark&amp;quot;,&amp;quot;prt_spark_2&amp;quot;,&lt;br /&gt;
&amp;quot;prt_splash&amp;quot;,&amp;quot;prt_wake&amp;quot;,&amp;quot;prt_watersplash&amp;quot;,&amp;quot;prt_wheeldirt&amp;quot;,&amp;quot;petrolcan&amp;quot;,&amp;quot;puke&amp;quot;,&amp;quot;riot_smoke&amp;quot;,&amp;quot;spraycan&amp;quot;,&amp;quot;smoke30lit&amp;quot;,&amp;quot;smoke30m&amp;quot;,&lt;br /&gt;
&amp;quot;smoke50lit&amp;quot;,&amp;quot;shootlight&amp;quot;,&amp;quot;smoke_flare&amp;quot;,&amp;quot;tank_fire&amp;quot;,&amp;quot;teargas&amp;quot;,&amp;quot;teargasAD&amp;quot;,&amp;quot;tree_hit_fir&amp;quot;,&amp;quot;tree_hit_palm&amp;quot;,&amp;quot;vent&amp;quot;,&amp;quot;vent2&amp;quot;,&lt;br /&gt;
&amp;quot;water_hydrant&amp;quot;,&amp;quot;water_ripples&amp;quot;,&amp;quot;water_speed&amp;quot;,&amp;quot;water_splash&amp;quot;,&amp;quot;water_splash_big&amp;quot;,&amp;quot;water_splsh_sml&amp;quot;,&amp;quot;water_swim&amp;quot;,&amp;quot;waterfall_end&amp;quot;,&lt;br /&gt;
&amp;quot;water_fnt_tme&amp;quot;,&amp;quot;water_fountain&amp;quot;,&amp;quot;wallbust&amp;quot;,&amp;quot;WS_factorysmoke&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;createEffect&amp;quot;, function(_, effectIndex)&lt;br /&gt;
   effectIndex = tonumber(effectIndex)&lt;br /&gt;
   if effectIndex and type(effectIndex) == &amp;quot;number&amp;quot; then&lt;br /&gt;
      if effectIndex &amp;gt; 0 and effectIndex &amp;lt;= #effectNames then&lt;br /&gt;
         createEffect(effectNames[effectIndex], Vector3( getElementPosition( getLocalPlayer() ) ), 0, 0, 0)&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
--Example Command: /createEffect 3&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.4.0-9.06892|Added drawDistance argument}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{Client_Effects_functions}}&lt;br /&gt;
[[ru:createEffect]]&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateRenderTarget&amp;diff=59154</id>
		<title>DxCreateRenderTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateRenderTarget&amp;diff=59154"/>
		<updated>2018-09-14T16:35:57Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a render target element, which is a special type of [[texture]] that can be drawn on with the dx functions. Successful render target creation is not guaranteed, and may fail due to hardware or memory limitations.&lt;br /&gt;
&lt;br /&gt;
To see if creation is likely to fail, use [[dxGetStatus]]. (When '''VideoMemoryFreeForMTA''' is zero, failure ''is'' guaranteed.)&lt;br /&gt;
{{Tip|Use [[dxSetBlendMode]] to get better quality}}&lt;br /&gt;
{{Tip|It is highly recommended that [[dxSetTestMode]] is used when writing and testing scripts using dxCreateRenderTarget.}}&lt;br /&gt;
{{Note|Render targets are usually cleared when the player minimizes MTA (i.e. alt-tab). See [[onClientRestore]] for details on when to restore any fixed content.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element dxCreateRenderTarget ( int width, int height [, bool withAlpha = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Texture|DxRenderTarget]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''width :''' The width of the texture in pixels.&lt;br /&gt;
*'''height :''' The height of the texture in pixels.&lt;br /&gt;
*'''withAlpha:''' The render target will be created with an alpha channel. 'false' will turn images' alpha channels to black color&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[texture]] element if successful, ''false'' if the system is unable to create a render target.&lt;br /&gt;
&lt;br /&gt;
'''You should always check to see if this function has returned false.'''&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
What is a rendertarget?&lt;br /&gt;
A rendertarget is like a big, white paper(or if you set alpha to true, it will be a transparent paper) that you can draw on, &lt;br /&gt;
after you drawn on it, you can draw it as many times as you like, without impacting performance. It could be used for&lt;br /&gt;
dashboard, where a few hundred dxDraw* functions are called, so, instead of calling these every frame, you can just&lt;br /&gt;
draw it on a render target, and draw the render target, instead of every information one by one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
        myRenderTarget = dxCreateRenderTarget( 80, 100 )            -- Create a render target texture which is 80 x 100 pixels&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myRenderTarget then&lt;br /&gt;
            dxSetRenderTarget( myRenderTarget )                     -- Start drawing on myRenderTarget&lt;br /&gt;
            dxDrawText ( &amp;quot;Hello&amp;quot;, 10, 20 )                          -- Draw a message&lt;br /&gt;
            dxSetRenderTarget()                                     -- Stop drawing on myRenderTarget&lt;br /&gt;
&lt;br /&gt;
            dxDrawImage( 50,  50,  100, 100, myRenderTarget )       -- Now use myRenderTarget as a material and draw it lots of times&lt;br /&gt;
            dxDrawImage( 150, 350, 150, 100, myRenderTarget )&lt;br /&gt;
            dxDrawImage( 250, 250, 100, 150, myRenderTarget )&lt;br /&gt;
            dxDrawImage( 350, 30,  150, 150, myRenderTarget )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local myRenderTarget = dxCreateRenderTarget(500, 500, true)&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Function to draw text to our render target with '''modulate_add''' blend mode when the 'r' key is pressed&lt;br /&gt;
--&lt;br /&gt;
function updateRenderTarget()&lt;br /&gt;
    dxSetRenderTarget(myRenderTarget, true)&lt;br /&gt;
    dxSetBlendMode(&amp;quot;modulate_add&amp;quot;)  -- Set 'modulate_add' when drawing stuff on the render target&lt;br /&gt;
&lt;br /&gt;
    dxDrawText(&amp;quot;Testing &amp;quot;..getTickCount(), 0, 0, 0, 0, tocolor(255, 255, 255, 255), 2, &amp;quot;clear&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    dxSetBlendMode(&amp;quot;blend&amp;quot;)         -- Restore default blending&lt;br /&gt;
    dxSetRenderTarget()             -- Restore default render target&lt;br /&gt;
end&lt;br /&gt;
bindKey(&amp;quot;r&amp;quot;, &amp;quot;down&amp;quot;, updateRenderTarget )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxSetShaderValue&amp;diff=59153</id>
		<title>DxSetShaderValue</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxSetShaderValue&amp;diff=59153"/>
		<updated>2018-09-14T16:23:48Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This sets a named parameter for a [[shader]] element&lt;br /&gt;
&lt;br /&gt;
{{Important Note|It's enough to set the texture only once if it's a render target}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxSetShaderValue ( element theShader, string parameterName, mixed value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[shader]]:setValue}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theShader:''' The shader element whose parameter is to be changed&lt;br /&gt;
*'''parameterName:''' The name of parameter&lt;br /&gt;
*'''value:''' The value to set, which can be a [[texture]], a bool, a number or a list of numbers('''max 16 floats(numbers)''')&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the shader element's parameter was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myShader = dxCreateShader( &amp;quot;hello.fx&amp;quot; )&lt;br /&gt;
myTexture = dxCreateTexture( &amp;quot;man.png&amp;quot; )&lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;texure0&amp;quot;, myTexture )                -- Set a texture&lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;bShowThing&amp;quot;, true )                  -- Set a bool                  &lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;speed&amp;quot;, 2.4 )                        -- Set a float&lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;positionOfCheese&amp;quot;, 100, 200, 300 )   -- Set a list of numbers, with max 16 numbers. Btw, this is a float: 3.4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Vehicle_Components&amp;diff=58546</id>
		<title>Vehicle Components</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Vehicle_Components&amp;diff=58546"/>
		<updated>2018-08-26T09:22:54Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''All components were tested in the vehicle &amp;quot;Sultan&amp;quot;'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*''NOTES:&lt;br /&gt;
**''Unknown Component is all that what give &amp;quot;false&amp;quot; when i try move it.''&lt;br /&gt;
**''Changing wheel position on Z axis doesn't work.''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! width=&amp;quot;150&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Component Name&lt;br /&gt;
! width=&amp;quot;300&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|boot_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Trunk door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_nitro&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Nitro (tuning part)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Front Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_lf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Front Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Back Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_lb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Back Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Chassis&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis_vlo&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Chassis (lod)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_roof&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Roof&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_rf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Front Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_lf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Front Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_rb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Back Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_lb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Back Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bonnet_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Hood&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_wing_right&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right wing (tuning part)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bump_front_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Front bumper&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bump_rear_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Back bumper&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|windscreen_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Windscreen&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_wing_left&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Leftwing (tuning part)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|exhaust_ok&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Exhausts&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle functions==&lt;br /&gt;
{{Client_vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Vehicle_Components&amp;diff=58545</id>
		<title>Vehicle Components</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Vehicle_Components&amp;diff=58545"/>
		<updated>2018-08-26T09:19:58Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''All components were tested in the vehicle &amp;quot;Sultan&amp;quot;'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*''NOTES:&lt;br /&gt;
**''Unknown Component is all that what give &amp;quot;false&amp;quot; when i try move it.''&lt;br /&gt;
**''Changing wheel position on Z axis doesn't work.''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center; margin: 1em auto 1em auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! width=&amp;quot;150&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Component Name&lt;br /&gt;
! width=&amp;quot;300&amp;quot; scope=&amp;quot;col&amp;quot; style=&amp;quot;background:#8f8f8f;&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|boot_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Trunk door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_nitro&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Unknown Component&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Front Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_lf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Front Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_rb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Back Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|wheel_lb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Back Wheel&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Chassis&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|chassis_vlo&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Unknown Component&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_roof&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Unknown Component&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_rf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Front Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_lf_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Front Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_rb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Right Back Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|door_lb_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Left Back Door&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bonnet_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Hood&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_wing_right&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Unknown Component&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bump_front_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Front bumper&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|bump_rear_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Back bumper&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|windscreen_dummy&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Windscreen&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|ug_wing_left&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Unknow Component&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|exhaust_ok&lt;br /&gt;
|style=&amp;quot;background:#cfcfcf;&amp;quot;|Exhausts&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Vehicle functions==&lt;br /&gt;
{{Client_vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxSetShaderValue&amp;diff=58096</id>
		<title>DxSetShaderValue</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxSetShaderValue&amp;diff=58096"/>
		<updated>2018-08-14T13:10:52Z</updated>

		<summary type="html">&lt;p&gt;JeViCo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This sets a named parameter for a [[shader]] element&lt;br /&gt;
&lt;br /&gt;
{{Important Note|It'll be enough to set texture only once if it's a render target}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxSetShaderValue ( element theShader, string parameterName, mixed value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[shader]]:setValue}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theShader:''' The shader element whose parameter is to be changed&lt;br /&gt;
*'''parameterName:''' The name of parameter&lt;br /&gt;
*'''value:''' The value to set, which can be a [[texture]], a bool, a number or a list of numbers('''max 16 floats(numbers)''')&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the shader element's parameter was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myShader = dxCreateShader( &amp;quot;hello.fx&amp;quot; )&lt;br /&gt;
myTexture = dxCreateTexture( &amp;quot;man.png&amp;quot; )&lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;texure0&amp;quot;, myTexture )                -- Set a texture&lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;bShowThing&amp;quot;, true )                  -- Set a bool                  &lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;speed&amp;quot;, 2.4 )                        -- Set a float&lt;br /&gt;
dxSetShaderValue( myShader, &amp;quot;positionOfCheese&amp;quot;, 100, 200, 300 )   -- Set a list of numbers, with max 16 numbers. Btw, this is a float: 3.4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>JeViCo</name></author>
	</entry>
</feed>