<?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=Arran+Fortuna</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=Arran+Fortuna"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Arran_Fortuna"/>
	<updated>2026-04-25T19:03:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82816</id>
		<title>SetDynamicPedShadowsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82816"/>
		<updated>2026-04-17T10:08:39Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows scripts to override the current dynamic ped shadow setting on the client.&lt;br /&gt;
&lt;br /&gt;
When used, it temporarily overrides the player’s video setting for dynamic ped shadows. To restore the original value based on the player's settings, use [[resetDynamicPedShadows]].&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 setDynamicPedShadowsEnabled ( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''enabled:''' a boolean value specifying whether dynamic ped shadows should be enabled (''true'') or disabled (''false'').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the setting was successfully applied, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Disable dynamic ped shadows&lt;br /&gt;
setDynamicPedShadowsEnabled(false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Toggle shadows===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local current = isDynamicPedShadowsEnabled()&lt;br /&gt;
setDynamicPedShadowsEnabled(not current)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Disable shadows on resource start and restore on stop===&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;
        setDynamicPedShadowsEnabled(false)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        resetDynamicPedShadows()&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82815</id>
		<title>SetDynamicPedShadowsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82815"/>
		<updated>2026-04-17T10:04:13Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows scripts to override the current dynamic ped shadow setting on the client.&lt;br /&gt;
&lt;br /&gt;
When used, it temporarily overrides the player’s video setting for dynamic ped shadows. To restore the original value based on the player's settings, use [[resetDynamicPedShadows]].&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 setDynamicPedShadowsEnabled ( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''enabled:''' a boolean value specifying whether dynamic ped shadows should be enabled (''true'') or disabled (''false'').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the setting was successfully applied, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Disable dynamic ped shadows&lt;br /&gt;
setDynamicPedShadowsEnabled(false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Toggle shadows===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local current = isDynamicPedShadowsEnabled()&lt;br /&gt;
setDynamicPedShadowsEnabled(not current)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Disable shadows on resource start and restore on stop===&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;
        setDynamicPedShadowsEnabled(false)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        resetDynamicPedShadows()&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions|client}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsDynamicPedShadowsEnabled&amp;diff=82814</id>
		<title>IsDynamicPedShadowsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsDynamicPedShadowsEnabled&amp;diff=82814"/>
		<updated>2026-04-17T10:04:00Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function checks whether dynamic shadows for peds are currently enabled on the client.&lt;br /&gt;
&lt;br /&gt;
The returned value may reflect:&lt;br /&gt;
* The player's video settings.&lt;br /&gt;
* Any override applied using [[setDynamicPedShadowsEnabled]].&lt;br /&gt;
&lt;br /&gt;
Use [[resetDynamicPedShadows]] to restore the setting back to the player’s original video configuration.&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 isDynamicPedShadowsEnabled ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*None&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if dynamic ped shadows are enabled, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if isDynamicPedShadowsEnabled() then&lt;br /&gt;
    outputChatBox(&amp;quot;Dynamic ped shadows are enabled.&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputChatBox(&amp;quot;Dynamic ped shadows are disabled.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Toggle shadows===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Toggle dynamic ped shadows&lt;br /&gt;
local current = isDynamicPedShadowsEnabled()&lt;br /&gt;
setDynamicPedShadowsEnabled(not current)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions|client}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetDynamicPedShadows&amp;diff=82813</id>
		<title>ResetDynamicPedShadows</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetDynamicPedShadows&amp;diff=82813"/>
		<updated>2026-04-17T10:03:46Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function restores the dynamic ped shadow setting back to the player's original video configuration.&lt;br /&gt;
&lt;br /&gt;
If [[setDynamicPedShadowsEnabled]] was used to override the setting, calling this function will remove that override and reapply the value defined in the player's settings.&lt;br /&gt;
&lt;br /&gt;
This is useful for ensuring that temporary changes made by a resource do not persist after it stops.&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 resetDynamicPedShadows ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*None&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the reset was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Reset dynamic ped shadows to player's settings&lt;br /&gt;
resetDynamicPedShadows()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Safe usage in a resource===&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;
        setDynamicPedShadowsEnabled(false)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        resetDynamicPedShadows()&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions|client}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82812</id>
		<title>SetDynamicPedShadowsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82812"/>
		<updated>2026-04-17T10:02:21Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows scripts to override the current dynamic ped shadow setting on the client.&lt;br /&gt;
&lt;br /&gt;
When used, it temporarily overrides the player’s video setting for dynamic ped shadows. To restore the original value based on the player's settings, use [[resetDynamicPedShadows]].&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 setDynamicPedShadowsEnabled ( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''enabled:''' a boolean value specifying whether dynamic ped shadows should be enabled (''true'') or disabled (''false'').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the setting was successfully applied, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Disable dynamic ped shadows&lt;br /&gt;
setDynamicPedShadowsEnabled(false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Toggle shadows===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local current = isDynamicPedShadowsEnabled()&lt;br /&gt;
setDynamicPedShadowsEnabled(not current)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Disable shadows on resource start and restore on stop===&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;
        setDynamicPedShadowsEnabled(false)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        resetDynamicPedShadows()&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[isDynamicPedShadowsEnabled]]&lt;br /&gt;
* [[resetDynamicPedShadows]]&lt;br /&gt;
{{World functions|client}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetDynamicPedShadows&amp;diff=82811</id>
		<title>ResetDynamicPedShadows</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetDynamicPedShadows&amp;diff=82811"/>
		<updated>2026-04-17T09:55:33Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Created page with &amp;quot;__NOTOC__ {{Client function}} This function restores the dynamic ped shadow setting back to the player's original video configuration.  If setDynamicPedShadowsEnabled was used to override the setting, calling this function will remove that override and reapply the value defined in the player's settings.  This is useful for ensuring that temporary changes made by a resource do not persist after it stops.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool resetDynamicPedSha...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function restores the dynamic ped shadow setting back to the player's original video configuration.&lt;br /&gt;
&lt;br /&gt;
If [[setDynamicPedShadowsEnabled]] was used to override the setting, calling this function will remove that override and reapply the value defined in the player's settings.&lt;br /&gt;
&lt;br /&gt;
This is useful for ensuring that temporary changes made by a resource do not persist after it stops.&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 resetDynamicPedShadows ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*None&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the reset was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Reset dynamic ped shadows to player's settings&lt;br /&gt;
resetDynamicPedShadows()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Safe usage in a resource===&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;
        setDynamicPedShadowsEnabled(false)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        resetDynamicPedShadows()&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[setDynamicPedShadowsEnabled]]&lt;br /&gt;
* [[isDynamicPedShadowsEnabled]]&lt;br /&gt;
* [[Client functions]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82810</id>
		<title>SetDynamicPedShadowsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetDynamicPedShadowsEnabled&amp;diff=82810"/>
		<updated>2026-04-17T09:54:25Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Created page with &amp;quot;__NOTOC__ {{Client function}} This function allows scripts to override the current dynamic ped shadow setting on the client.  When used, it temporarily overrides the player’s video setting for dynamic ped shadows. To restore the original value based on the player's settings, use resetDynamicPedShadows.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool setDynamicPedShadowsEnabled ( bool enabled ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments=== *'''enabled:''' a boolean val...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows scripts to override the current dynamic ped shadow setting on the client.&lt;br /&gt;
&lt;br /&gt;
When used, it temporarily overrides the player’s video setting for dynamic ped shadows. To restore the original value based on the player's settings, use [[resetDynamicPedShadows]].&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 setDynamicPedShadowsEnabled ( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''enabled:''' a boolean value specifying whether dynamic ped shadows should be enabled (''true'') or disabled (''false'').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the setting was successfully applied, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Disable dynamic ped shadows&lt;br /&gt;
setDynamicPedShadowsEnabled(false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Toggle shadows===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local current = isDynamicPedShadowsEnabled()&lt;br /&gt;
setDynamicPedShadowsEnabled(not current)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Disable shadows on resource start and restore on stop===&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;
        setDynamicPedShadowsEnabled(false)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        resetDynamicPedShadows()&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[isDynamicPedShadowsEnabled]]&lt;br /&gt;
* [[resetDynamicPedShadows]]&lt;br /&gt;
* [[Client functions]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsDynamicPedShadowsEnabled&amp;diff=82809</id>
		<title>IsDynamicPedShadowsEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsDynamicPedShadowsEnabled&amp;diff=82809"/>
		<updated>2026-04-17T09:53:02Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Created page with &amp;quot;__NOTOC__ {{Client function}} This function checks whether dynamic shadows for peds are currently enabled on the client.  The returned value may reflect: * The player's video settings. * Any override applied using setDynamicPedShadowsEnabled.  Use resetDynamicPedShadows to restore the setting back to the player’s original video configuration.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool isDynamicPedShadowsEnabled ( ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments==...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function checks whether dynamic shadows for peds are currently enabled on the client.&lt;br /&gt;
&lt;br /&gt;
The returned value may reflect:&lt;br /&gt;
* The player's video settings.&lt;br /&gt;
* Any override applied using [[setDynamicPedShadowsEnabled]].&lt;br /&gt;
&lt;br /&gt;
Use [[resetDynamicPedShadows]] to restore the setting back to the player’s original video configuration.&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 isDynamicPedShadowsEnabled ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*None&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if dynamic ped shadows are enabled, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if isDynamicPedShadowsEnabled() then&lt;br /&gt;
    outputChatBox(&amp;quot;Dynamic ped shadows are enabled.&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputChatBox(&amp;quot;Dynamic ped shadows are disabled.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example: Toggle shadows===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Toggle dynamic ped shadows&lt;br /&gt;
local current = isDynamicPedShadowsEnabled()&lt;br /&gt;
setDynamicPedShadowsEnabled(not current)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[setDynamicPedShadowsEnabled]]&lt;br /&gt;
* [[resetDynamicPedShadows]]&lt;br /&gt;
* [[Client functions]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineStreamingSetProperty&amp;diff=82808</id>
		<title>EngineStreamingSetProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineStreamingSetProperty&amp;diff=82808"/>
		<updated>2026-04-13T16:16:30Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MTA:Eir/Client_function}}&lt;br /&gt;
&lt;br /&gt;
'''THIS IS NOT AN MTA FUNCTION!''' This should be deleted as it's part of an unfinished project.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function changes the behavior of the GTA:SA streaming system. It is meant to optimize the performance of the game for your custom server. Changes in these properties affect the gameplay quality of the entire server.&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 engineStreamingSetProperty ( string propertyName, var propValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
*'''propertyName:''' the name of the streaming property you want to change&lt;br /&gt;
*'''propValue:''' value to pass to the property&lt;br /&gt;
&lt;br /&gt;
===Valid Properties===&lt;br /&gt;
{{:MTA:Eir/functions/engineStreamingSetProperty/validProps}}&lt;br /&gt;
&lt;br /&gt;
===Useful Media===&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_opt.zip - streaming debugging resource&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_test.zip - streaming mode example resource&lt;br /&gt;
* https://www.youtube.com/watch?v=sk8WsHwPgsU - showcase video&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if valid arguments have been passed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples== &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 snippet ultimatively fixes the world flickering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, true );&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;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This snippet sets the Streaming GC system to sparse mode. In this mode only the preallocated amount of Streaming GC nodes is allowed. Keeping a low amount of Streaming nodes is interesting for performance optimizations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;gcOnDemand&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, true );&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;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This snippet turns on fibered loading when the Streaming system is busy and leaves it that way for five seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
&lt;br /&gt;
local lastBusyTime = false;&lt;br /&gt;
local fiberedDuration = 5000;&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        local isBusy = engineGetStreamingInfo().isBusy;&lt;br /&gt;
&lt;br /&gt;
        if ( isBusy ) then&lt;br /&gt;
            local now = getTickCount();&lt;br /&gt;
&lt;br /&gt;
            if not ( lastBusyTime ) then&lt;br /&gt;
                lastBusyTime = now;&lt;br /&gt;
&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
            end&lt;br /&gt;
        elseif ( lastBusyTime ) then&lt;br /&gt;
            if ( now - lastBusyTime &amp;gt; fiberedDuration ) then&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
            end&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;
&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 snippet makes the world load very slow. Lag spikes cannot occur due to Streaming loading anymore.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;fiberedPerfMult&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[en:engineStreamingSetProperty]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=82744</id>
		<title>SetPedLookAt</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=82744"/>
		<updated>2026-03-07T09:38:28Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Add example for remote player usage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Note|Avoid calling setPedLookAt every frame as this can cause bugs like being invincible to burning.}}&lt;br /&gt;
{{Important Note|For remote players, you have to use [https://wiki.multitheftauto.com/wiki/SetPedAimTarget setPedAimTarget] before setPedLookAt.}}&lt;br /&gt;
Makes a ped turn his head and look at a specific world position or element.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000 [, int blend = 1000 ], element target = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the ped to change the lookat of.&lt;br /&gt;
*'''x:''' the x coordinate of the world position to look at.&lt;br /&gt;
*'''y:''' the y coordinate of the world position to look at.&lt;br /&gt;
*'''z:''' the z coordinate of the world position to look at.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.&lt;br /&gt;
*'''blend:''' the time, in milliseconds, during which the look will blend.&lt;br /&gt;
*'''target:''' if this argument is specified, the position arguments will be mean offsets relative to the target and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example makes the local player look at where the camera points at. If you want to sync this effect with other players you can use [[triggerLatentServerEvent]] and [[triggerLatentClientEvent]] functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenSize_X, screenSize_Y = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function pedLookAt()&lt;br /&gt;
   local x, y, z = getWorldFromScreenPosition(screenSize_X / 2, screenSize_Y / 2, 15)&lt;br /&gt;
   setPedLookAt(localPlayer, x, y, z, -1, 0)&lt;br /&gt;
end&lt;br /&gt;
setTimer(pedLookAt, 120, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example makes remote players heads move based on what direction their camera is facing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function remotePlayerHeadMoving()&lt;br /&gt;
	local x, y, z = getElementPosition(localPlayer)&lt;br /&gt;
	for i, player in pairs(getElementsWithinRange(x, y, z, 35, &amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if (player ~= localPlayer and isElementOnScreen(player)) then&lt;br /&gt;
			local rot = getPedCameraRotation(player)&lt;br /&gt;
			local x, y, z = getElementPosition(player)&lt;br /&gt;
			local vx = x + math.sin(math.rad(rot)) * 10&lt;br /&gt;
			local vy = y + math.cos(math.rad(rot)) * 10&lt;br /&gt;
			-- To fix remote player's head bug + check to avoid setPedAimTarget movement lag while aiming with gun&lt;br /&gt;
			if (getPedTask(player, &amp;quot;secondary&amp;quot;, 0) ~= &amp;quot;TASK_SIMPLE_USE_GUN&amp;quot;) then&lt;br /&gt;
				if (player ~= localPlayer) then&lt;br /&gt;
					setPedAimTarget(player, vx, vy, z) -- head bug fix&lt;br /&gt;
				end&lt;br /&gt;
				setPedLookAt(player, vx, vy, z, -1, 0)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
setTimer(remotePlayerHeadMoving, 100, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|509|setPedLookAt does not work for remote players}}&lt;br /&gt;
{{Issue|626|setPedLookAt cancels damage done by any sort of fire}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnElementDataChange&amp;diff=82492</id>
		<title>OnElementDataChange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnElementDataChange&amp;diff=82492"/>
		<updated>2025-10-07T19:30:34Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added info about being able to cancel the event.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered ''after'' an element's [[element data|data]] entry is changed. Such changes can be made on the client or the server using [[setElementData]].&lt;br /&gt;
&lt;br /&gt;
{{Note|These predefined variables are special in this event:&lt;br /&gt;
*'''client''': The [[event system#Event client|client]] global variable is set to the client that called [[setElementData]], or '''nil''' if it was called on the server.&lt;br /&gt;
*'''sourceResource''': The [[resource]] which changed the element data - '''nil''', if client synced data, '''resource''' element otherwise.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string theKey, var oldValue, var newValue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theKey''': The name of the element data entry that has changed.&lt;br /&gt;
*'''oldValue''': The old value of this entry before it changed. See [[element data]] for a list of possible datatypes.&lt;br /&gt;
*'''newValue''': the new value of this entry after it changed. This will be equivalent to [[getElementData]](source, theKey).&lt;br /&gt;
&lt;br /&gt;
==Cancelling==&lt;br /&gt;
This event cannot be cancelled using [[cancelEvent]]. To reverse the effect, use [[setElementData]] with the old value. See Example.&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0170|1.7.0|&lt;br /&gt;
This event can be cancelled using [[cancelEvent]]. If a client sent the cancelled change to the server, the server will send the client the server's version of the element data.&lt;br /&gt;
|25731}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the [[element]] whose element data changed.&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 example outputs a message to players when any of their element data values is changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputChange(theKey, oldValue, newValue)&lt;br /&gt;
    if (getElementType(source) == &amp;quot;player&amp;quot;) then -- check if the element is a player&lt;br /&gt;
        outputChatBox(&amp;quot;Your element data '&amp;quot; .. tostring(theKey) .. &amp;quot;' has changed from '&amp;quot; .. tostring(oldValue) .. &amp;quot;' to '&amp;quot; .. tostring(newValue) .. &amp;quot;'&amp;quot;, source) -- output the change for the affected player&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onElementDataChange&amp;quot;, root, outputChange)&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example checks and possibly reverses an element's data change.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkChange(theKey, oldValue)&lt;br /&gt;
    -- The client can only set 'special_thing' on its own player&lt;br /&gt;
    if (theKey== &amp;quot;special_thing&amp;quot;) and (client ~= source) then&lt;br /&gt;
        outputChatBox(&amp;quot;Illegal setting of &amp;quot; .. tostring(theKey) .. &amp;quot;' by '&amp;quot; .. tostring(getPlayerName(client)))&lt;br /&gt;
        setElementData(source, theKey, oldValue) -- Set back the original value&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onElementDataChange&amp;quot;, root, checkChange)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example blocks all element data changes from clients. In MTA 1.7+ only.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkChange(theKey, oldValue, newValue)&lt;br /&gt;
    if (client) then -- if there's a client variable, it means it came from a player.&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onElementDataChange&amp;quot;, root, checkChange)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Element events}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=82471</id>
		<title>Server mtaserver.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=82471"/>
		<updated>2025-09-13T15:33:12Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: /* bandwidth_reduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.&lt;br /&gt;
&lt;br /&gt;
==Settings==&lt;br /&gt;
&lt;br /&gt;
====servername====&lt;br /&gt;
:''&amp;lt;servername&amp;gt;Default MTA Server&amp;lt;/servername&amp;gt;''&lt;br /&gt;
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====rule====&lt;br /&gt;
:''&amp;lt;rule name=&amp;quot;NAME_HERE&amp;quot; value=&amp;quot;VALUE_HERE&amp;quot;/&amp;gt;''&lt;br /&gt;
:The rule parameters are optional. There can be as many as you want in the config file. They contain information for the Server Browser/List. [[Server_Browser_Rules|Read this article for more information]].&lt;br /&gt;
&lt;br /&gt;
====owner_email_address====&lt;br /&gt;
:''&amp;lt;owner_email_address&amp;gt;&amp;lt;/owner_email_address&amp;gt;''&lt;br /&gt;
:This parameter specifies the contact email addresses for the owner(s) of this server. &lt;br /&gt;
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. &lt;br /&gt;
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. &lt;br /&gt;
:Values: Comma separated list of email addresses&lt;br /&gt;
&lt;br /&gt;
====serverip====&lt;br /&gt;
:''&amp;lt;serverip&amp;gt;auto&amp;lt;/serverip&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.&lt;br /&gt;
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.&lt;br /&gt;
:Values: auto or x.x.x.x ; default value: auto&lt;br /&gt;
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING&lt;br /&gt;
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY&lt;br /&gt;
&lt;br /&gt;
====serverport====&lt;br /&gt;
:''&amp;lt;serverport&amp;gt;22003&amp;lt;/serverport&amp;gt; &lt;br /&gt;
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;&lt;br /&gt;
:default value: 22003. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====maxplayers====&lt;br /&gt;
:''&amp;lt;maxplayers&amp;gt;32&amp;lt;/maxplayers&amp;gt;&lt;br /&gt;
:This parameter specifies the number of maximum player slots available on the server;&lt;br /&gt;
:default value: 32. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====httpserver====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
:This parameter specifies whether the built-in http server will be used.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpport====&lt;br /&gt;
:''&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as &amp;lt;serverport&amp;gt;. It is a required parameter if &amp;lt;httpserver&amp;gt; is set to 1.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpdownloadurl====&lt;br /&gt;
:''&amp;lt;httpdownloadurl&amp;gt;&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.&lt;br /&gt;
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]&lt;br /&gt;
&lt;br /&gt;
====httpmaxconnectionsperclient====&lt;br /&gt;
:''&amp;lt;httpmaxconnectionsperclient&amp;gt;5&amp;lt;/httpmaxconnectionsperclient&amp;gt;&lt;br /&gt;
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.&lt;br /&gt;
:Available range: 1 to 8.&lt;br /&gt;
&lt;br /&gt;
====httpthreadcount====&lt;br /&gt;
:''&amp;lt;httpthreadcount&amp;gt;8&amp;lt;/httpthreadcount&amp;gt;&lt;br /&gt;
:Number of HTTP server threads.&lt;br /&gt;
:Available range: 1 to 20. default value: 8&lt;br /&gt;
&lt;br /&gt;
====httpdosthreshold====&lt;br /&gt;
:''&amp;lt;httpdosthreshold&amp;gt;20&amp;lt;/httpdosthreshold&amp;gt;&lt;br /&gt;
:This parameter limits the number http connections that an IP can initiate over a short period of time.&lt;br /&gt;
:Available range: 1 to 100. default value: 20&lt;br /&gt;
&lt;br /&gt;
====http_dos_exclude====&lt;br /&gt;
:''&amp;lt;http_dos_exclude&amp;gt;&amp;lt;/http_dos_exclude&amp;gt;&lt;br /&gt;
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.&lt;br /&gt;
:e.g. 88.11.22.33,101.2.3.4&lt;br /&gt;
&lt;br /&gt;
====allow_gta3_img_mods====&lt;br /&gt;
:''&amp;lt;allow_gta3_img_mods&amp;gt;none&amp;lt;/allow_gta3_img_mods&amp;gt;&lt;br /&gt;
:By default, the server will block the use of locally customized gta3.img player skins&lt;br /&gt;
:This setting can be used to allow such mods. Not recommended for competitive servers.&lt;br /&gt;
:Values: none, peds ; default value: none&lt;br /&gt;
&lt;br /&gt;
====client_file====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;client_file name=&amp;quot;data/carmods.dat&amp;quot; verify=&amp;quot;0&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:By default, the server will block the use of customized GTA:SA data files.&lt;br /&gt;
:To allow specific client files, add one or more of the above lines.&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====disableac====&lt;br /&gt;
:''&amp;lt;disableac&amp;gt;&amp;lt;/disableac&amp;gt;&lt;br /&gt;
:Comma separated list of disabled anti-cheats.&lt;br /&gt;
:e.g. To disable anti-cheat #2 and #3, use: 2,3&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====enablesd====&lt;br /&gt;
:''&amp;lt;enablesd&amp;gt;31,32&amp;lt;/enablesd&amp;gt;&lt;br /&gt;
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. &lt;br /&gt;
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.&lt;br /&gt;
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====hideac====&lt;br /&gt;
:''&amp;lt;hideac&amp;gt;0&amp;lt;/hideac&amp;gt;&lt;br /&gt;
:When this parameter is enabled client won't get any info about Anticheat settings when connecting to server.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0. Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====minclientversion====&lt;br /&gt;
:''&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.6.0-9.22953.0&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====minclientversion_auto_update====&lt;br /&gt;
:''&amp;lt;minclientversion_auto_update&amp;gt;1&amp;lt;/minclientversion_auto_update&amp;gt;&lt;br /&gt;
:This parameter specifies if/when the &amp;lt;minclientversion&amp;gt; setting is automatically updated.&lt;br /&gt;
:Keeping &amp;lt;minclientversion&amp;gt; updated can help reduce cheating.&lt;br /&gt;
:Note: The instant setting (2) is only recommended for competitive servers.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.&lt;br /&gt;
&lt;br /&gt;
====recommendedclientversion====&lt;br /&gt;
:''&amp;lt;recommendedclientversion&amp;gt;&amp;lt;/recommendedclientversion&amp;gt;&lt;br /&gt;
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====ase====&lt;br /&gt;
:''&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt;&lt;br /&gt;
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from &amp;lt;serverport&amp;gt; + 123 , so on a default &amp;lt;serverport&amp;gt; value 22003 the right port will be 22126 ).&lt;br /&gt;
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====donotbroadcastlan====&lt;br /&gt;
:''&amp;lt;donotbroadcastlan&amp;gt;0&amp;lt;/donotbroadcastlan&amp;gt;&lt;br /&gt;
:This parameter allows you to disable LAN broadcasting.	&lt;br /&gt;
&lt;br /&gt;
====password====&lt;br /&gt;
:''&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt; &lt;br /&gt;
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====net_auto_filter====&lt;br /&gt;
:''&amp;lt;net_auto_filter&amp;gt;1&amp;lt;/net_auto_filter&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Net auto filter.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled. default value: 1&lt;br /&gt;
&lt;br /&gt;
====update_cycle_datagrams_limit====&lt;br /&gt;
:''&amp;lt;update_cycle_datagrams_limit&amp;gt;4&amp;lt;/update_cycle_datagrams_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Send datagrams limit.&lt;br /&gt;
:Available range: 1 to 100. default value: 4&lt;br /&gt;
&lt;br /&gt;
====update_cycle_messages_limit====&lt;br /&gt;
:''&amp;lt;update_cycle_messages_limit&amp;gt;50&amp;lt;/update_cycle_messages_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Send messages limit.&lt;br /&gt;
:Available range: 10 to 1000. default value: 50&lt;br /&gt;
&lt;br /&gt;
====bandwidth_reduction====&lt;br /&gt;
:''&amp;lt;bandwidth_reduction&amp;gt;medium&amp;lt;/bandwidth_reduction&amp;gt; &lt;br /&gt;
:This parameter reduces the server's bandwidth usage by using various optimizations.&lt;br /&gt;
:Values: none, medium or maximum ; default value: medium&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Bandwidth reduction causes de-sync when players are on mapped objects [https://github.com/multitheftauto/mtasa-blue/issues/4460 See GitHub issue]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_syncer_distance&amp;gt;130&amp;lt;/unoccupied_vehicle_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced unoccupied vehicles&lt;br /&gt;
:Available range: 50 - 400; default value: 130&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====ped_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;ped_syncer_distance&amp;gt;100&amp;lt;/ped_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced peds&lt;br /&gt;
:Available range: 50 - 400; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====player_sync_interval====&lt;br /&gt;
:''&amp;lt;player_sync_interval&amp;gt;100&amp;lt;/player_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between player sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====lightweight_sync_interval====&lt;br /&gt;
:''&amp;lt;lightweight_sync_interval&amp;gt;1500&amp;lt;/lightweight_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between lightweight (player) sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 1500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====camera_sync_interval====&lt;br /&gt;
:''&amp;lt;camera_sync_interval&amp;gt;500&amp;lt;/camera_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between camera sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_sync_interval&amp;gt;500&amp;lt;/ped_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is near the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_far_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_far_sync_interval&amp;gt;2000&amp;lt;/ped_far_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is far away from the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 2000&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_sync_interval====&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_sync_interval&amp;gt;400&amp;lt;/unoccupied_vehicle_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_mouse_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_mouse_sync_interval&amp;gt;100&amp;lt;/keysync_mouse_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_analog_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_analog_sync_interval&amp;gt;100&amp;lt;/keysync_analog_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====donkey_work_interval====&lt;br /&gt;
:''&amp;lt;donkey_work_interval&amp;gt;100&amp;lt;/donkey_work_interval&amp;gt;&lt;br /&gt;
:Update near list interval in milliseconds.&lt;br /&gt;
:Available range: 50 to 4000. default value: 100&lt;br /&gt;
&lt;br /&gt;
====bullet_sync====&lt;br /&gt;
:''&amp;lt;bullet_sync&amp;gt;1&amp;lt;/bullet_sync&amp;gt;   &lt;br /&gt;
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.&lt;br /&gt;
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22430|&lt;br /&gt;
====vehicle_contact_sync_radius====&lt;br /&gt;
:''&amp;lt;vehicle_contact_sync_radius&amp;gt;30&amp;lt;/vehicle_contact_sync_radius&amp;gt;   &lt;br /&gt;
:This parameter specifies the radius in which any contact with a vehicle will turn the player into its syncer.&lt;br /&gt;
:Changing this setting to 0 will cause vehicles to not pick a new syncer based on which player is touching the vehicle.&lt;br /&gt;
:Available range: 0 to 130.  Default - 30&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====vehext_percent====&lt;br /&gt;
:''&amp;lt;vehext_percent&amp;gt;0&amp;lt;/vehext_percent&amp;gt;&lt;br /&gt;
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. &lt;br /&gt;
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.&lt;br /&gt;
:Depending on the gamemode, an incorrect prediction may have a negative effect. &lt;br /&gt;
:Therefore this setting should be considered experimental.&lt;br /&gt;
:Available range: 0 to 100.  Default - 0&lt;br /&gt;
&lt;br /&gt;
====vehext_ping_limit====&lt;br /&gt;
:''&amp;lt;vehext_ping_limit&amp;gt;150&amp;lt;/vehext_ping_limit&amp;gt;&lt;br /&gt;
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.&lt;br /&gt;
:Only relevant if &amp;lt;vehext_percent&amp;gt; is greater than zero.&lt;br /&gt;
:Available range: 50 to 500.  Default - 150&lt;br /&gt;
&lt;br /&gt;
====latency_reduction====&lt;br /&gt;
:''&amp;lt;latency_reduction&amp;gt;0&amp;lt;/latency_reduction&amp;gt;&lt;br /&gt;
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).&lt;br /&gt;
:Due to the impact this may have on shot lag compensation, it should be considered experimental.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
:Bugs caused by enabling latency_reduction: https://bugs.mtasa.com/view.php?id=8191 + https://bugs.mtasa.com/view.php?id=8226&lt;br /&gt;
&lt;br /&gt;
====threadnet====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;threadnet&amp;gt;1&amp;lt;/threadnet&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to run the network synchronization on another thread.&lt;br /&gt;
:Enabling will make the sync smoother, but may increase CPU usage slightly.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====idfile====&lt;br /&gt;
:''&amp;lt;idfile&amp;gt;server-id.keys&amp;lt;/idfile&amp;gt; &lt;br /&gt;
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. &lt;br /&gt;
:Keep a backup of this file in a safe place. Default value: server-id.keys&lt;br /&gt;
:More information about client private files: [[Filepath]]&lt;br /&gt;
&lt;br /&gt;
====logfile====&lt;br /&gt;
:''&amp;lt;logfile&amp;gt;logs/server.log&amp;lt;/logfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====authfile====&lt;br /&gt;
:''&amp;lt;authfile&amp;gt;logs/server_auth.log&amp;lt;/authfile&amp;gt;&lt;br /&gt;
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used&lt;br /&gt;
&lt;br /&gt;
====dbfile====&lt;br /&gt;
:''&amp;lt;dbfile&amp;gt;logs/db.log&amp;lt;/dbfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.&lt;br /&gt;
&lt;br /&gt;
====loadstringfile====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;loadstringfile&amp;gt;logs/loadstring.log&amp;lt;/loadstringfile&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.&lt;br /&gt;
&lt;br /&gt;
====acl====&lt;br /&gt;
:''&amp;lt;acl&amp;gt;acl.xml&amp;lt;/acl&amp;gt; &lt;br /&gt;
:This parameter specifies the location and name of the Access Control List settings file. If left&lt;br /&gt;
:blank, server will use acl.xml file, located in the same folder as this configuration file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebuglogfile====&lt;br /&gt;
:''&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebugloglevel====&lt;br /&gt;
:''&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====htmldebuglevel====&lt;br /&gt;
:''&amp;lt;htmldebuglevel&amp;gt;0&amp;lt;/htmldebuglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====filter_duplicate_log_lines====&lt;br /&gt;
:''&amp;lt;filter_duplicate_log_lines&amp;gt;1&amp;lt;/filter_duplicate_log_lines&amp;gt;&lt;br /&gt;
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.&lt;br /&gt;
&lt;br /&gt;
====fpslimit====&lt;br /&gt;
:''&amp;lt;fpslimit&amp;gt;74&amp;lt;/fpslimit&amp;gt;&lt;br /&gt;
:Specifies the frame rate limit that will be applied to connecting clients.&lt;br /&gt;
:Available range: 25 to 32767. Default: 74. You can also use 0 for uncapped fps.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====voice====&lt;br /&gt;
:''&amp;lt;voice&amp;gt;0&amp;lt;/voice&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to enable player voice chat in-game&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled&lt;br /&gt;
&lt;br /&gt;
====voice_samplerate====&lt;br /&gt;
:''&amp;lt;voice_samplerate&amp;gt;1&amp;lt;/voice_samplerate&amp;gt;&lt;br /&gt;
:This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat&lt;br /&gt;
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1&lt;br /&gt;
&lt;br /&gt;
====voice_quality====&lt;br /&gt;
:''&amp;lt;voice_quality&amp;gt;4&amp;lt;/voice_quality&amp;gt;&lt;br /&gt;
:This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat&lt;br /&gt;
:Available range: 0 to 10.  Default - 4&lt;br /&gt;
&lt;br /&gt;
====voice_bitrate====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;voice_bitrate&amp;gt;24600&amp;lt;/voice_bitrate&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically.  Use with care.&lt;br /&gt;
&lt;br /&gt;
====backup_path====&lt;br /&gt;
:''&amp;lt;backup_path&amp;gt;backups&amp;lt;/backup_path&amp;gt;&lt;br /&gt;
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups&lt;br /&gt;
&lt;br /&gt;
====backup_interval====&lt;br /&gt;
:''&amp;lt;backup_interval&amp;gt;3&amp;lt;/backup_interval&amp;gt;&lt;br /&gt;
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 30.  Default - 3&lt;br /&gt;
&lt;br /&gt;
====backup_copies====&lt;br /&gt;
:''&amp;lt;backup_copies&amp;gt;10&amp;lt;/backup_copies&amp;gt;&lt;br /&gt;
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 100.  Default - 10&lt;br /&gt;
&lt;br /&gt;
====compact_internal_databases====&lt;br /&gt;
:''&amp;lt;compact_internal_databases&amp;gt;1&amp;lt;/compact_internal_databases&amp;gt;&lt;br /&gt;
:This parameter specifies when the internal sqlite databases should be defragmented.&lt;br /&gt;
:For more info see: https://www.sqlite.org/lang_vacuum.html&lt;br /&gt;
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====server_logic_fps_limit====&lt;br /&gt;
:''&amp;lt;server_logic_fps_limit&amp;gt;0&amp;lt;/server_logic_fps_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Server logic FPS limit.&lt;br /&gt;
:Available range: 0 to 100. default value: 0&lt;br /&gt;
&lt;br /&gt;
====crash_dump_upload====&lt;br /&gt;
:''&amp;lt;crash_dump_upload&amp;gt;1&amp;lt;/crash_dump_upload&amp;gt;&lt;br /&gt;
:This parameter specifies whether server crash dump files should be sent to MTA HQ.&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 1&lt;br /&gt;
&lt;br /&gt;
====fakelag====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;fakelag&amp;gt;0&amp;lt;/fakelag&amp;gt;&lt;br /&gt;
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 0&lt;br /&gt;
&lt;br /&gt;
====auth_serial_groups====&lt;br /&gt;
:''&amp;lt;auth_serial_groups&amp;gt;Admin&amp;lt;/auth_serial_groups&amp;gt;&lt;br /&gt;
:This parameter lists the ACL groups that are protected by serial authorization.&lt;br /&gt;
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.&lt;br /&gt;
:For more info see: https://mtasa.com/authserial&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.&lt;br /&gt;
:Values: Comma separated list of ACL groups.  Default - Admin&lt;br /&gt;
:See [[Authorized Serial Account Protection]] for more information.&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http====&lt;br /&gt;
:''&amp;lt;auth_serial_http&amp;gt;1&amp;lt;/auth_serial_http&amp;gt;&lt;br /&gt;
:This parameter specifies if the authorized serial login checks should also apply to the http interface.&lt;br /&gt;
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.&lt;br /&gt;
:For more info see: https://mtasa.com/authserialhttp&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http_ip_exceptions====&lt;br /&gt;
:''&amp;lt;auth_serial_http_ip_exceptions&amp;gt;127.0.0.1&amp;lt;/auth_serial_http_ip_exceptions&amp;gt;&lt;br /&gt;
:This parameter specifies which IP addresses should always pass auth_serial_http checks.&lt;br /&gt;
:Values: Comma separated list of IP addresses&lt;br /&gt;
&lt;br /&gt;
====database_credentials_protection====&lt;br /&gt;
:''&amp;lt;database_credentials_protection&amp;gt;1&amp;lt;/database_credentials_protection&amp;gt;&lt;br /&gt;
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:The extra measures are:&lt;br /&gt;
: - script files cannot be accessed with [[fileOpen]]&lt;br /&gt;
: - [[meta.xml]] is read-only&lt;br /&gt;
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 1&lt;br /&gt;
&lt;br /&gt;
{{New items|6.0160|1.6.0-22790|&lt;br /&gt;
====elementdata_whitelisted====&lt;br /&gt;
:''&amp;lt;elementdata_whitelisted&amp;gt;0&amp;lt;/elementdata_whitelisted&amp;gt;&lt;br /&gt;
:Enables extra protection for [[SetElementData|element data]].&lt;br /&gt;
:When this option is enabled, the server ignores element data sync packets from the client, except for allowed keys. To allow a client to change a key, use setElementData(element, name, nil, true, &amp;quot;allow&amp;quot;) first.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|6.0160|1.6.0-22815|&lt;br /&gt;
====check_duplicate_serials====&lt;br /&gt;
:''&amp;lt;check_duplicate_serials&amp;gt;1&amp;lt;/check_duplicate_serials&amp;gt;&lt;br /&gt;
:This parameter determines whether server will compare player serial on connection to any other serial present on server. &lt;br /&gt;
:When this option is enabled, the server will deny entry for player whose serial is already in use by other player on server. You might want to disable this when using VMs.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====player_triggered_event_interval====&lt;br /&gt;
:''&amp;lt;player_triggered_event_interval&amp;gt;1000&amp;lt;/player_triggered_event_interval&amp;gt;&lt;br /&gt;
:Time interval for counting max (see below: max_player_triggered_events_per_interval) triggered events (via triggerServerEvent), exceeding this will call [[onPlayerTriggerEventThreshold]]&lt;br /&gt;
:Values: 50-5000; default: 1000 (in ms)&lt;br /&gt;
&lt;br /&gt;
====max_player_triggered_events_per_interval====&lt;br /&gt;
:''&amp;lt;max_player_triggered_events_per_interval&amp;gt;100&amp;lt;/max_player_triggered_events_per_interval&amp;gt;&lt;br /&gt;
:Max triggered amount of events (via triggerServerEvent) within interval above (player_triggered_event_interval), exceeding this will call [[onPlayerTriggerEventThreshold]]&lt;br /&gt;
:Values: 1-1000; default: 100&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22930|&lt;br /&gt;
====player_teleport_alert====  &lt;br /&gt;
:''&amp;lt;player_teleport_alert&amp;gt;100&amp;lt;/player_teleport_alert&amp;gt;  &lt;br /&gt;
:Defines the maximum allowed unexpected position change (in units). If a player's position changes by more than this value without using [[setElementPosition]], the event [[onPlayerTeleport]] will be triggered.  &lt;br /&gt;
:Values: 5-500; default: 100&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====module====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_win32.dll&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_linux.so&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the module(s) which are loaded with the server. To load several modules, add more &amp;lt;module&amp;gt; parameter(s). Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====resource_client_file_checks====&lt;br /&gt;
&amp;lt;!-- added by https://github.com/multitheftauto/mtasa-blue/pull/3822 --&amp;gt;&lt;br /&gt;
:''&amp;lt;resource_client_file_checks&amp;gt;1&amp;lt;/resource_client_file_checks&amp;gt;&lt;br /&gt;
:If enabled, the server will perform checks on files in resources (listed in [[meta.xml]]) with PNG, TXD and DFF extensions, checking if they are corrupted. When the system finds a non-valid file of these types, it outputs a warning to the server console.&lt;br /&gt;
:You may want to disable thse checks when storing different/non-conforming data in files with these extensions (e.g. encrypted data).&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====resource====&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;admin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;defaultstats&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;helpmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;joinquit&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapcycler&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;parachute&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcebrowser&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; default=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;scoreboard&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;spawnmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;voice&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;votemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;webadmin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;play&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src-&amp;quot;resources&amp;quot; startup&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&lt;br /&gt;
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more &amp;lt;resource&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
:In addition, there are several flags which control how the server deals with each resource:&lt;br /&gt;
&lt;br /&gt;
:* '''src''': the resource name. This is the only mandatory flag.&lt;br /&gt;
:* '''startup''': controls whether the resource will be started with the server or not. If &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will be started. If not specified, defaults to not starting the resource.&lt;br /&gt;
:* '''protected''': if &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.&lt;br /&gt;
:* '''default''': if given a &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot; value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.&lt;br /&gt;
&lt;br /&gt;
====busy_sleep_time====&lt;br /&gt;
:''&amp;lt;busy_sleep_time&amp;gt;-1&amp;lt;/busy_sleep_time&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - This parameter configures the server's sleep duration in milliseconds during busy processing, affecting CPU usage and responsiveness.  &lt;br /&gt;
:Available range: -1 to 50; default value: -1  &lt;br /&gt;
:-1 sets the server to automatically determine the optimal value based on workload.  &lt;br /&gt;
:Setting it to 0 is recommended for achieving the best performance but may result in higher CPU usage.  &lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
====idle_sleep_time====&lt;br /&gt;
:''&amp;lt;idle_sleep_time&amp;gt;-1&amp;lt;/idle_sleep_time&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - This parameter configures the server's sleep duration in milliseconds during idle periods, affecting CPU usage and responsiveness.&lt;br /&gt;
:Available range: -1 to 50; default value: -1&lt;br /&gt;
:-1 sets the server to automatically determine the optimal value based on workload.&lt;br /&gt;
:Setting it to 10 is recommended for achieving the best performance while balancing CPU usage.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
==Deprecated settings==&lt;br /&gt;
&lt;br /&gt;
The following settings have been deprecated in the production version of MTA:SA and no longer work.&lt;br /&gt;
&lt;br /&gt;
====networkencryption====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - also seems to be deprecated in code --&amp;gt;&lt;br /&gt;
:''&amp;lt;networkencryption&amp;gt;1&amp;lt;/networkencryption&amp;gt;&lt;br /&gt;
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====autologin====&lt;br /&gt;
&amp;lt;!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --&amp;gt;&lt;br /&gt;
:''&amp;lt;autologin&amp;gt;0&amp;lt;/autologin&amp;gt;&lt;br /&gt;
:Specifies whether or not players should automatically be logged in based on their IP adresses.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
&lt;br /&gt;
====httpautoclientfiles====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - doesn't exists in code too --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpautoclientfiles&amp;gt;1&amp;lt;/httpautoclientfiles&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Support]]&lt;br /&gt;
[[ru:Server mtaserver.conf]]&lt;br /&gt;
[[pl:mtaserver.conf]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=82465</id>
		<title>Server mtaserver.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=82465"/>
		<updated>2025-09-10T08:43:57Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.&lt;br /&gt;
&lt;br /&gt;
==Settings==&lt;br /&gt;
&lt;br /&gt;
====servername====&lt;br /&gt;
:''&amp;lt;servername&amp;gt;Default MTA Server&amp;lt;/servername&amp;gt;''&lt;br /&gt;
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====rule====&lt;br /&gt;
:''&amp;lt;rule name=&amp;quot;NAME_HERE&amp;quot; value=&amp;quot;VALUE_HERE&amp;quot;/&amp;gt;''&lt;br /&gt;
:The rule parameters are optional. There can be as many as you want in the config file. They contain information for the Server Browser/List. [[Server_Browser_Rules|Read this article for more information]].&lt;br /&gt;
&lt;br /&gt;
====owner_email_address====&lt;br /&gt;
:''&amp;lt;owner_email_address&amp;gt;&amp;lt;/owner_email_address&amp;gt;''&lt;br /&gt;
:This parameter specifies the contact email addresses for the owner(s) of this server. &lt;br /&gt;
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. &lt;br /&gt;
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. &lt;br /&gt;
:Values: Comma separated list of email addresses&lt;br /&gt;
&lt;br /&gt;
====serverip====&lt;br /&gt;
:''&amp;lt;serverip&amp;gt;auto&amp;lt;/serverip&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.&lt;br /&gt;
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.&lt;br /&gt;
:Values: auto or x.x.x.x ; default value: auto&lt;br /&gt;
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING&lt;br /&gt;
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY&lt;br /&gt;
&lt;br /&gt;
====serverport====&lt;br /&gt;
:''&amp;lt;serverport&amp;gt;22003&amp;lt;/serverport&amp;gt; &lt;br /&gt;
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;&lt;br /&gt;
:default value: 22003. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====maxplayers====&lt;br /&gt;
:''&amp;lt;maxplayers&amp;gt;32&amp;lt;/maxplayers&amp;gt;&lt;br /&gt;
:This parameter specifies the number of maximum player slots available on the server;&lt;br /&gt;
:default value: 32. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====httpserver====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
:This parameter specifies whether the built-in http server will be used.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpport====&lt;br /&gt;
:''&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as &amp;lt;serverport&amp;gt;. It is a required parameter if &amp;lt;httpserver&amp;gt; is set to 1.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpdownloadurl====&lt;br /&gt;
:''&amp;lt;httpdownloadurl&amp;gt;&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.&lt;br /&gt;
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]&lt;br /&gt;
&lt;br /&gt;
====httpmaxconnectionsperclient====&lt;br /&gt;
:''&amp;lt;httpmaxconnectionsperclient&amp;gt;5&amp;lt;/httpmaxconnectionsperclient&amp;gt;&lt;br /&gt;
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.&lt;br /&gt;
:Available range: 1 to 8.&lt;br /&gt;
&lt;br /&gt;
====httpthreadcount====&lt;br /&gt;
:''&amp;lt;httpthreadcount&amp;gt;8&amp;lt;/httpthreadcount&amp;gt;&lt;br /&gt;
:Number of HTTP server threads.&lt;br /&gt;
:Available range: 1 to 20. default value: 8&lt;br /&gt;
&lt;br /&gt;
====httpdosthreshold====&lt;br /&gt;
:''&amp;lt;httpdosthreshold&amp;gt;20&amp;lt;/httpdosthreshold&amp;gt;&lt;br /&gt;
:This parameter limits the number http connections that an IP can initiate over a short period of time.&lt;br /&gt;
:Available range: 1 to 100. default value: 20&lt;br /&gt;
&lt;br /&gt;
====http_dos_exclude====&lt;br /&gt;
:''&amp;lt;http_dos_exclude&amp;gt;&amp;lt;/http_dos_exclude&amp;gt;&lt;br /&gt;
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.&lt;br /&gt;
:e.g. 88.11.22.33,101.2.3.4&lt;br /&gt;
&lt;br /&gt;
====allow_gta3_img_mods====&lt;br /&gt;
:''&amp;lt;allow_gta3_img_mods&amp;gt;none&amp;lt;/allow_gta3_img_mods&amp;gt;&lt;br /&gt;
:By default, the server will block the use of locally customized gta3.img player skins&lt;br /&gt;
:This setting can be used to allow such mods. Not recommended for competitive servers.&lt;br /&gt;
:Values: none, peds ; default value: none&lt;br /&gt;
&lt;br /&gt;
====client_file====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;client_file name=&amp;quot;data/carmods.dat&amp;quot; verify=&amp;quot;0&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:By default, the server will block the use of customized GTA:SA data files.&lt;br /&gt;
:To allow specific client files, add one or more of the above lines.&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====disableac====&lt;br /&gt;
:''&amp;lt;disableac&amp;gt;&amp;lt;/disableac&amp;gt;&lt;br /&gt;
:Comma separated list of disabled anti-cheats.&lt;br /&gt;
:e.g. To disable anti-cheat #2 and #3, use: 2,3&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====enablesd====&lt;br /&gt;
:''&amp;lt;enablesd&amp;gt;31,32&amp;lt;/enablesd&amp;gt;&lt;br /&gt;
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. &lt;br /&gt;
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.&lt;br /&gt;
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====hideac====&lt;br /&gt;
:''&amp;lt;hideac&amp;gt;0&amp;lt;/hideac&amp;gt;&lt;br /&gt;
:When this parameter is enabled client won't get any info about Anticheat settings when connecting to server.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0. Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====minclientversion====&lt;br /&gt;
:''&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.6.0-9.22953.0&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====minclientversion_auto_update====&lt;br /&gt;
:''&amp;lt;minclientversion_auto_update&amp;gt;1&amp;lt;/minclientversion_auto_update&amp;gt;&lt;br /&gt;
:This parameter specifies if/when the &amp;lt;minclientversion&amp;gt; setting is automatically updated.&lt;br /&gt;
:Keeping &amp;lt;minclientversion&amp;gt; updated can help reduce cheating.&lt;br /&gt;
:Note: The instant setting (2) is only recommended for competitive servers.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.&lt;br /&gt;
&lt;br /&gt;
====recommendedclientversion====&lt;br /&gt;
:''&amp;lt;recommendedclientversion&amp;gt;&amp;lt;/recommendedclientversion&amp;gt;&lt;br /&gt;
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====ase====&lt;br /&gt;
:''&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt;&lt;br /&gt;
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from &amp;lt;serverport&amp;gt; + 123 , so on a default &amp;lt;serverport&amp;gt; value 22003 the right port will be 22126 ).&lt;br /&gt;
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====donotbroadcastlan====&lt;br /&gt;
:''&amp;lt;donotbroadcastlan&amp;gt;0&amp;lt;/donotbroadcastlan&amp;gt;&lt;br /&gt;
:This parameter allows you to disable LAN broadcasting.	&lt;br /&gt;
&lt;br /&gt;
====password====&lt;br /&gt;
:''&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt; &lt;br /&gt;
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====net_auto_filter====&lt;br /&gt;
:''&amp;lt;net_auto_filter&amp;gt;1&amp;lt;/net_auto_filter&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Net auto filter.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled. default value: 1&lt;br /&gt;
&lt;br /&gt;
====update_cycle_datagrams_limit====&lt;br /&gt;
:''&amp;lt;update_cycle_datagrams_limit&amp;gt;4&amp;lt;/update_cycle_datagrams_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Send datagrams limit.&lt;br /&gt;
:Available range: 1 to 100. default value: 4&lt;br /&gt;
&lt;br /&gt;
====update_cycle_messages_limit====&lt;br /&gt;
:''&amp;lt;update_cycle_messages_limit&amp;gt;50&amp;lt;/update_cycle_messages_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Send messages limit.&lt;br /&gt;
:Available range: 10 to 1000. default value: 50&lt;br /&gt;
&lt;br /&gt;
====bandwidth_reduction====&lt;br /&gt;
:''&amp;lt;bandwidth_reduction&amp;gt;medium&amp;lt;/bandwidth_reduction&amp;gt; &lt;br /&gt;
:This parameter reduces the server's bandwidth usage by using various optimizations.&lt;br /&gt;
:Values: none, medium or maximum ; default value: medium&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_syncer_distance&amp;gt;130&amp;lt;/unoccupied_vehicle_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced unoccupied vehicles&lt;br /&gt;
:Available range: 50 - 400; default value: 130&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====ped_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;ped_syncer_distance&amp;gt;100&amp;lt;/ped_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced peds&lt;br /&gt;
:Available range: 50 - 400; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====player_sync_interval====&lt;br /&gt;
:''&amp;lt;player_sync_interval&amp;gt;100&amp;lt;/player_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between player sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====lightweight_sync_interval====&lt;br /&gt;
:''&amp;lt;lightweight_sync_interval&amp;gt;1500&amp;lt;/lightweight_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between lightweight (player) sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 1500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====camera_sync_interval====&lt;br /&gt;
:''&amp;lt;camera_sync_interval&amp;gt;500&amp;lt;/camera_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between camera sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_sync_interval&amp;gt;500&amp;lt;/ped_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is near the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_far_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_far_sync_interval&amp;gt;2000&amp;lt;/ped_far_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is far away from the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 2000&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_sync_interval====&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_sync_interval&amp;gt;400&amp;lt;/unoccupied_vehicle_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_mouse_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_mouse_sync_interval&amp;gt;100&amp;lt;/keysync_mouse_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_analog_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_analog_sync_interval&amp;gt;100&amp;lt;/keysync_analog_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====donkey_work_interval====&lt;br /&gt;
:''&amp;lt;donkey_work_interval&amp;gt;100&amp;lt;/donkey_work_interval&amp;gt;&lt;br /&gt;
:Update near list interval in milliseconds.&lt;br /&gt;
:Available range: 50 to 4000. default value: 100&lt;br /&gt;
&lt;br /&gt;
====bullet_sync====&lt;br /&gt;
:''&amp;lt;bullet_sync&amp;gt;1&amp;lt;/bullet_sync&amp;gt;   &lt;br /&gt;
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.&lt;br /&gt;
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22430|&lt;br /&gt;
====vehicle_contact_sync_radius====&lt;br /&gt;
:''&amp;lt;vehicle_contact_sync_radius&amp;gt;30&amp;lt;/vehicle_contact_sync_radius&amp;gt;   &lt;br /&gt;
:This parameter specifies the radius in which any contact with a vehicle will turn the player into its syncer.&lt;br /&gt;
:Changing this setting to 0 will cause vehicles to not pick a new syncer based on which player is touching the vehicle.&lt;br /&gt;
:Available range: 0 to 130.  Default - 30&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====vehext_percent====&lt;br /&gt;
:''&amp;lt;vehext_percent&amp;gt;0&amp;lt;/vehext_percent&amp;gt;&lt;br /&gt;
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. &lt;br /&gt;
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.&lt;br /&gt;
:Depending on the gamemode, an incorrect prediction may have a negative effect. &lt;br /&gt;
:Therefore this setting should be considered experimental.&lt;br /&gt;
:Available range: 0 to 100.  Default - 0&lt;br /&gt;
&lt;br /&gt;
====vehext_ping_limit====&lt;br /&gt;
:''&amp;lt;vehext_ping_limit&amp;gt;150&amp;lt;/vehext_ping_limit&amp;gt;&lt;br /&gt;
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.&lt;br /&gt;
:Only relevant if &amp;lt;vehext_percent&amp;gt; is greater than zero.&lt;br /&gt;
:Available range: 50 to 500.  Default - 150&lt;br /&gt;
&lt;br /&gt;
====latency_reduction====&lt;br /&gt;
:''&amp;lt;latency_reduction&amp;gt;0&amp;lt;/latency_reduction&amp;gt;&lt;br /&gt;
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).&lt;br /&gt;
:Due to the impact this may have on shot lag compensation, it should be considered experimental.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
:Bugs caused by enabling latency_reduction: https://bugs.mtasa.com/view.php?id=8191 + https://bugs.mtasa.com/view.php?id=8226&lt;br /&gt;
&lt;br /&gt;
====threadnet====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;threadnet&amp;gt;1&amp;lt;/threadnet&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to run the network synchronization on another thread.&lt;br /&gt;
:Enabling will make the sync smoother, but may increase CPU usage slightly.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====idfile====&lt;br /&gt;
:''&amp;lt;idfile&amp;gt;server-id.keys&amp;lt;/idfile&amp;gt; &lt;br /&gt;
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. &lt;br /&gt;
:Keep a backup of this file in a safe place. Default value: server-id.keys&lt;br /&gt;
:More information about client private files: [[Filepath]]&lt;br /&gt;
&lt;br /&gt;
====logfile====&lt;br /&gt;
:''&amp;lt;logfile&amp;gt;logs/server.log&amp;lt;/logfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====authfile====&lt;br /&gt;
:''&amp;lt;authfile&amp;gt;logs/server_auth.log&amp;lt;/authfile&amp;gt;&lt;br /&gt;
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used&lt;br /&gt;
&lt;br /&gt;
====dbfile====&lt;br /&gt;
:''&amp;lt;dbfile&amp;gt;logs/db.log&amp;lt;/dbfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.&lt;br /&gt;
&lt;br /&gt;
====loadstringfile====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;loadstringfile&amp;gt;logs/loadstring.log&amp;lt;/loadstringfile&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.&lt;br /&gt;
&lt;br /&gt;
====acl====&lt;br /&gt;
:''&amp;lt;acl&amp;gt;acl.xml&amp;lt;/acl&amp;gt; &lt;br /&gt;
:This parameter specifies the location and name of the Access Control List settings file. If left&lt;br /&gt;
:blank, server will use acl.xml file, located in the same folder as this configuration file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebuglogfile====&lt;br /&gt;
:''&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebugloglevel====&lt;br /&gt;
:''&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====htmldebuglevel====&lt;br /&gt;
:''&amp;lt;htmldebuglevel&amp;gt;0&amp;lt;/htmldebuglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====filter_duplicate_log_lines====&lt;br /&gt;
:''&amp;lt;filter_duplicate_log_lines&amp;gt;1&amp;lt;/filter_duplicate_log_lines&amp;gt;&lt;br /&gt;
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.&lt;br /&gt;
&lt;br /&gt;
====fpslimit====&lt;br /&gt;
:''&amp;lt;fpslimit&amp;gt;74&amp;lt;/fpslimit&amp;gt;&lt;br /&gt;
:Specifies the frame rate limit that will be applied to connecting clients.&lt;br /&gt;
:Available range: 25 to 32767. Default: 74. You can also use 0 for uncapped fps.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====voice====&lt;br /&gt;
:''&amp;lt;voice&amp;gt;0&amp;lt;/voice&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to enable player voice chat in-game&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled&lt;br /&gt;
&lt;br /&gt;
====voice_samplerate====&lt;br /&gt;
:''&amp;lt;voice_samplerate&amp;gt;1&amp;lt;/voice_samplerate&amp;gt;&lt;br /&gt;
:This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat&lt;br /&gt;
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1&lt;br /&gt;
&lt;br /&gt;
====voice_quality====&lt;br /&gt;
:''&amp;lt;voice_quality&amp;gt;4&amp;lt;/voice_quality&amp;gt;&lt;br /&gt;
:This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat&lt;br /&gt;
:Available range: 0 to 10.  Default - 4&lt;br /&gt;
&lt;br /&gt;
====voice_bitrate====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;voice_bitrate&amp;gt;24600&amp;lt;/voice_bitrate&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically.  Use with care.&lt;br /&gt;
&lt;br /&gt;
====backup_path====&lt;br /&gt;
:''&amp;lt;backup_path&amp;gt;backups&amp;lt;/backup_path&amp;gt;&lt;br /&gt;
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups&lt;br /&gt;
&lt;br /&gt;
====backup_interval====&lt;br /&gt;
:''&amp;lt;backup_interval&amp;gt;3&amp;lt;/backup_interval&amp;gt;&lt;br /&gt;
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 30.  Default - 3&lt;br /&gt;
&lt;br /&gt;
====backup_copies====&lt;br /&gt;
:''&amp;lt;backup_copies&amp;gt;10&amp;lt;/backup_copies&amp;gt;&lt;br /&gt;
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 100.  Default - 10&lt;br /&gt;
&lt;br /&gt;
====compact_internal_databases====&lt;br /&gt;
:''&amp;lt;compact_internal_databases&amp;gt;1&amp;lt;/compact_internal_databases&amp;gt;&lt;br /&gt;
:This parameter specifies when the internal sqlite databases should be defragmented.&lt;br /&gt;
:For more info see: https://www.sqlite.org/lang_vacuum.html&lt;br /&gt;
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====server_logic_fps_limit====&lt;br /&gt;
:''&amp;lt;server_logic_fps_limit&amp;gt;0&amp;lt;/server_logic_fps_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Server logic FPS limit.&lt;br /&gt;
:Available range: 0 to 100. default value: 0&lt;br /&gt;
&lt;br /&gt;
====crash_dump_upload====&lt;br /&gt;
:''&amp;lt;crash_dump_upload&amp;gt;1&amp;lt;/crash_dump_upload&amp;gt;&lt;br /&gt;
:This parameter specifies whether server crash dump files should be sent to MTA HQ.&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 1&lt;br /&gt;
&lt;br /&gt;
====fakelag====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;fakelag&amp;gt;0&amp;lt;/fakelag&amp;gt;&lt;br /&gt;
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 0&lt;br /&gt;
&lt;br /&gt;
====auth_serial_groups====&lt;br /&gt;
:''&amp;lt;auth_serial_groups&amp;gt;Admin&amp;lt;/auth_serial_groups&amp;gt;&lt;br /&gt;
:This parameter lists the ACL groups that are protected by serial authorization.&lt;br /&gt;
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.&lt;br /&gt;
:For more info see: https://mtasa.com/authserial&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.&lt;br /&gt;
:Values: Comma separated list of ACL groups.  Default - Admin&lt;br /&gt;
:See [[Authorized Serial Account Protection]] for more information.&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http====&lt;br /&gt;
:''&amp;lt;auth_serial_http&amp;gt;1&amp;lt;/auth_serial_http&amp;gt;&lt;br /&gt;
:This parameter specifies if the authorized serial login checks should also apply to the http interface.&lt;br /&gt;
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.&lt;br /&gt;
:For more info see: https://mtasa.com/authserialhttp&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http_ip_exceptions====&lt;br /&gt;
:''&amp;lt;auth_serial_http_ip_exceptions&amp;gt;127.0.0.1&amp;lt;/auth_serial_http_ip_exceptions&amp;gt;&lt;br /&gt;
:This parameter specifies which IP addresses should always pass auth_serial_http checks.&lt;br /&gt;
:Values: Comma separated list of IP addresses&lt;br /&gt;
&lt;br /&gt;
====database_credentials_protection====&lt;br /&gt;
:''&amp;lt;database_credentials_protection&amp;gt;1&amp;lt;/database_credentials_protection&amp;gt;&lt;br /&gt;
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:The extra measures are:&lt;br /&gt;
: - script files cannot be accessed with [[fileOpen]]&lt;br /&gt;
: - [[meta.xml]] is read-only&lt;br /&gt;
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 1&lt;br /&gt;
&lt;br /&gt;
{{New items|6.0160|1.6.0-22790|&lt;br /&gt;
====elementdata_whitelisted====&lt;br /&gt;
:''&amp;lt;elementdata_whitelisted&amp;gt;0&amp;lt;/elementdata_whitelisted&amp;gt;&lt;br /&gt;
:Enables extra protection for [[SetElementData|element data]].&lt;br /&gt;
:When this option is enabled, the server ignores element data sync packets from the client, except for allowed keys. To allow a client to change a key, use setElementData(element, name, nil, true, &amp;quot;allow&amp;quot;) first.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|6.0160|1.6.0-22815|&lt;br /&gt;
====check_duplicate_serials====&lt;br /&gt;
:''&amp;lt;check_duplicate_serials&amp;gt;1&amp;lt;/check_duplicate_serials&amp;gt;&lt;br /&gt;
:This parameter determines whether server will compare player serial on connection to any other serial present on server. &lt;br /&gt;
:When this option is enabled, the server will deny entry for player whose serial is already in use by other player on server. You might want to disable this when using VMs.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====player_triggered_event_interval====&lt;br /&gt;
:''&amp;lt;player_triggered_event_interval&amp;gt;1000&amp;lt;/player_triggered_event_interval&amp;gt;&lt;br /&gt;
:Time interval for counting max (see below: max_player_triggered_events_per_interval) triggered events (via triggerServerEvent), exceeding this will call [[onPlayerTriggerEventThreshold]]&lt;br /&gt;
:Values: 50-5000; default: 1000 (in ms)&lt;br /&gt;
&lt;br /&gt;
====max_player_triggered_events_per_interval====&lt;br /&gt;
:''&amp;lt;max_player_triggered_events_per_interval&amp;gt;100&amp;lt;/max_player_triggered_events_per_interval&amp;gt;&lt;br /&gt;
:Max triggered amount of events (via triggerServerEvent) within interval above (player_triggered_event_interval), exceeding this will call [[onPlayerTriggerEventThreshold]]&lt;br /&gt;
:Values: 1-1000; default: 100&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22930|&lt;br /&gt;
====player_teleport_alert====  &lt;br /&gt;
:''&amp;lt;player_teleport_alert&amp;gt;100&amp;lt;/player_teleport_alert&amp;gt;  &lt;br /&gt;
:Defines the maximum allowed unexpected position change (in units). If a player's position changes by more than this value without using [[setElementPosition]], the event [[onPlayerTeleport]] will be triggered.  &lt;br /&gt;
:Values: 5-500; default: 100&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====module====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_win32.dll&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_linux.so&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the module(s) which are loaded with the server. To load several modules, add more &amp;lt;module&amp;gt; parameter(s). Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====resource_client_file_checks====&lt;br /&gt;
&amp;lt;!-- added by https://github.com/multitheftauto/mtasa-blue/pull/3822 --&amp;gt;&lt;br /&gt;
:''&amp;lt;resource_client_file_checks&amp;gt;1&amp;lt;/resource_client_file_checks&amp;gt;&lt;br /&gt;
:If enabled, the server will perform checks on files in resources (listed in [[meta.xml]]) with PNG, TXD and DFF extensions, checking if they are corrupted. When the system finds a non-valid file of these types, it outputs a warning to the server console.&lt;br /&gt;
:You may want to disable thse checks when storing different/non-conforming data in files with these extensions (e.g. encrypted data).&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====resource====&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;admin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;defaultstats&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;helpmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;joinquit&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapcycler&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;parachute&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcebrowser&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; default=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;scoreboard&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;spawnmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;voice&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;votemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;webadmin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;play&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src-&amp;quot;resources&amp;quot; startup&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&lt;br /&gt;
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more &amp;lt;resource&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
:In addition, there are several flags which control how the server deals with each resource:&lt;br /&gt;
&lt;br /&gt;
:* '''src''': the resource name. This is the only mandatory flag.&lt;br /&gt;
:* '''startup''': controls whether the resource will be started with the server or not. If &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will be started. If not specified, defaults to not starting the resource.&lt;br /&gt;
:* '''protected''': if &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.&lt;br /&gt;
:* '''default''': if given a &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot; value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.&lt;br /&gt;
&lt;br /&gt;
====busy_sleep_time====&lt;br /&gt;
:''&amp;lt;busy_sleep_time&amp;gt;-1&amp;lt;/busy_sleep_time&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - This parameter configures the server's sleep duration in milliseconds during busy processing, affecting CPU usage and responsiveness.  &lt;br /&gt;
:Available range: -1 to 50; default value: -1  &lt;br /&gt;
:-1 sets the server to automatically determine the optimal value based on workload.  &lt;br /&gt;
:Setting it to 0 is recommended for achieving the best performance but may result in higher CPU usage.  &lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
====idle_sleep_time====&lt;br /&gt;
:''&amp;lt;idle_sleep_time&amp;gt;-1&amp;lt;/idle_sleep_time&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - This parameter configures the server's sleep duration in milliseconds during idle periods, affecting CPU usage and responsiveness.&lt;br /&gt;
:Available range: -1 to 50; default value: -1&lt;br /&gt;
:-1 sets the server to automatically determine the optimal value based on workload.&lt;br /&gt;
:Setting it to 10 is recommended for achieving the best performance while balancing CPU usage.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
==Deprecated settings==&lt;br /&gt;
&lt;br /&gt;
The following settings have been deprecated in the production version of MTA:SA and no longer work.&lt;br /&gt;
&lt;br /&gt;
====networkencryption====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - also seems to be deprecated in code --&amp;gt;&lt;br /&gt;
:''&amp;lt;networkencryption&amp;gt;1&amp;lt;/networkencryption&amp;gt;&lt;br /&gt;
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====autologin====&lt;br /&gt;
&amp;lt;!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --&amp;gt;&lt;br /&gt;
:''&amp;lt;autologin&amp;gt;0&amp;lt;/autologin&amp;gt;&lt;br /&gt;
:Specifies whether or not players should automatically be logged in based on their IP adresses.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
&lt;br /&gt;
====httpautoclientfiles====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - doesn't exists in code too --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpautoclientfiles&amp;gt;1&amp;lt;/httpautoclientfiles&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Support]]&lt;br /&gt;
[[ru:Server mtaserver.conf]]&lt;br /&gt;
[[pl:mtaserver.conf]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=82461</id>
		<title>Server mtaserver.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=82461"/>
		<updated>2025-09-09T19:07:53Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Clarify how to use elementdata_whitelisted&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.&lt;br /&gt;
&lt;br /&gt;
==Settings==&lt;br /&gt;
&lt;br /&gt;
====servername====&lt;br /&gt;
:''&amp;lt;servername&amp;gt;Default MTA Server&amp;lt;/servername&amp;gt;''&lt;br /&gt;
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====rule====&lt;br /&gt;
:''&amp;lt;rule name=&amp;quot;NAME_HERE&amp;quot; value=&amp;quot;VALUE_HERE&amp;quot;/&amp;gt;''&lt;br /&gt;
:The rule parameters are optional. There can be as many as you want in the config file. They contain information for the Server Browser/List. [[Server_Browser_Rules|Read this article for more information]].&lt;br /&gt;
&lt;br /&gt;
====owner_email_address====&lt;br /&gt;
:''&amp;lt;owner_email_address&amp;gt;&amp;lt;/owner_email_address&amp;gt;''&lt;br /&gt;
:This parameter specifies the contact email addresses for the owner(s) of this server. &lt;br /&gt;
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. &lt;br /&gt;
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. &lt;br /&gt;
:Values: Comma separated list of email addresses&lt;br /&gt;
&lt;br /&gt;
====serverip====&lt;br /&gt;
:''&amp;lt;serverip&amp;gt;auto&amp;lt;/serverip&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.&lt;br /&gt;
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.&lt;br /&gt;
:Values: auto or x.x.x.x ; default value: auto&lt;br /&gt;
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING&lt;br /&gt;
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY&lt;br /&gt;
&lt;br /&gt;
====serverport====&lt;br /&gt;
:''&amp;lt;serverport&amp;gt;22003&amp;lt;/serverport&amp;gt; &lt;br /&gt;
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;&lt;br /&gt;
:default value: 22003. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====maxplayers====&lt;br /&gt;
:''&amp;lt;maxplayers&amp;gt;32&amp;lt;/maxplayers&amp;gt;&lt;br /&gt;
:This parameter specifies the number of maximum player slots available on the server;&lt;br /&gt;
:default value: 32. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====httpserver====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
:This parameter specifies whether the built-in http server will be used.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpport====&lt;br /&gt;
:''&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as &amp;lt;serverport&amp;gt;. It is a required parameter if &amp;lt;httpserver&amp;gt; is set to 1.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpdownloadurl====&lt;br /&gt;
:''&amp;lt;httpdownloadurl&amp;gt;&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.&lt;br /&gt;
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]&lt;br /&gt;
&lt;br /&gt;
====httpmaxconnectionsperclient====&lt;br /&gt;
:''&amp;lt;httpmaxconnectionsperclient&amp;gt;5&amp;lt;/httpmaxconnectionsperclient&amp;gt;&lt;br /&gt;
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.&lt;br /&gt;
:Available range: 1 to 8.&lt;br /&gt;
&lt;br /&gt;
====httpthreadcount====&lt;br /&gt;
:''&amp;lt;httpthreadcount&amp;gt;8&amp;lt;/httpthreadcount&amp;gt;&lt;br /&gt;
:Number of HTTP server threads.&lt;br /&gt;
:Available range: 1 to 20. default value: 8&lt;br /&gt;
&lt;br /&gt;
====httpdosthreshold====&lt;br /&gt;
:''&amp;lt;httpdosthreshold&amp;gt;20&amp;lt;/httpdosthreshold&amp;gt;&lt;br /&gt;
:This parameter limits the number http connections that an IP can initiate over a short period of time.&lt;br /&gt;
:Available range: 1 to 100. default value: 20&lt;br /&gt;
&lt;br /&gt;
====http_dos_exclude====&lt;br /&gt;
:''&amp;lt;http_dos_exclude&amp;gt;&amp;lt;/http_dos_exclude&amp;gt;&lt;br /&gt;
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.&lt;br /&gt;
:e.g. 88.11.22.33,101.2.3.4&lt;br /&gt;
&lt;br /&gt;
====allow_gta3_img_mods====&lt;br /&gt;
:''&amp;lt;allow_gta3_img_mods&amp;gt;none&amp;lt;/allow_gta3_img_mods&amp;gt;&lt;br /&gt;
:By default, the server will block the use of locally customized gta3.img player skins&lt;br /&gt;
:This setting can be used to allow such mods. Not recommended for competitive servers.&lt;br /&gt;
:Values: none, peds ; default value: none&lt;br /&gt;
&lt;br /&gt;
====client_file====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;client_file name=&amp;quot;data/carmods.dat&amp;quot; verify=&amp;quot;0&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:By default, the server will block the use of customized GTA:SA data files.&lt;br /&gt;
:To allow specific client files, add one or more of the above lines.&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====disableac====&lt;br /&gt;
:''&amp;lt;disableac&amp;gt;&amp;lt;/disableac&amp;gt;&lt;br /&gt;
:Comma separated list of disabled anti-cheats.&lt;br /&gt;
:e.g. To disable anti-cheat #2 and #3, use: 2,3&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====enablesd====&lt;br /&gt;
:''&amp;lt;enablesd&amp;gt;31,32&amp;lt;/enablesd&amp;gt;&lt;br /&gt;
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. &lt;br /&gt;
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.&lt;br /&gt;
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====hideac====&lt;br /&gt;
:''&amp;lt;hideac&amp;gt;0&amp;lt;/hideac&amp;gt;&lt;br /&gt;
:When this parameter is enabled client won't get any info about Anticheat settings when connecting to server.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0. Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====minclientversion====&lt;br /&gt;
:''&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.6.0-9.22953.0&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====minclientversion_auto_update====&lt;br /&gt;
:''&amp;lt;minclientversion_auto_update&amp;gt;1&amp;lt;/minclientversion_auto_update&amp;gt;&lt;br /&gt;
:This parameter specifies if/when the &amp;lt;minclientversion&amp;gt; setting is automatically updated.&lt;br /&gt;
:Keeping &amp;lt;minclientversion&amp;gt; updated can help reduce cheating.&lt;br /&gt;
:Note: The instant setting (2) is only recommended for competitive servers.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.&lt;br /&gt;
&lt;br /&gt;
====recommendedclientversion====&lt;br /&gt;
:''&amp;lt;recommendedclientversion&amp;gt;&amp;lt;/recommendedclientversion&amp;gt;&lt;br /&gt;
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====ase====&lt;br /&gt;
:''&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt;&lt;br /&gt;
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from &amp;lt;serverport&amp;gt; + 123 , so on a default &amp;lt;serverport&amp;gt; value 22003 the right port will be 22126 ).&lt;br /&gt;
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====donotbroadcastlan====&lt;br /&gt;
:''&amp;lt;donotbroadcastlan&amp;gt;0&amp;lt;/donotbroadcastlan&amp;gt;&lt;br /&gt;
:This parameter allows you to disable LAN broadcasting.	&lt;br /&gt;
&lt;br /&gt;
====password====&lt;br /&gt;
:''&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt; &lt;br /&gt;
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====net_auto_filter====&lt;br /&gt;
:''&amp;lt;net_auto_filter&amp;gt;1&amp;lt;/net_auto_filter&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Net auto filter.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled. default value: 1&lt;br /&gt;
&lt;br /&gt;
====update_cycle_datagrams_limit====&lt;br /&gt;
:''&amp;lt;update_cycle_datagrams_limit&amp;gt;4&amp;lt;/update_cycle_datagrams_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Send datagrams limit.&lt;br /&gt;
:Available range: 1 to 100. default value: 4&lt;br /&gt;
&lt;br /&gt;
====update_cycle_messages_limit====&lt;br /&gt;
:''&amp;lt;update_cycle_messages_limit&amp;gt;50&amp;lt;/update_cycle_messages_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Send messages limit.&lt;br /&gt;
:Available range: 10 to 1000. default value: 50&lt;br /&gt;
&lt;br /&gt;
====bandwidth_reduction====&lt;br /&gt;
:''&amp;lt;bandwidth_reduction&amp;gt;medium&amp;lt;/bandwidth_reduction&amp;gt; &lt;br /&gt;
:This parameter reduces the server's bandwidth usage by using various optimizations.&lt;br /&gt;
:Values: none, medium or maximum ; default value: medium&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_syncer_distance&amp;gt;130&amp;lt;/unoccupied_vehicle_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced unoccupied vehicles&lt;br /&gt;
:Available range: 50 - 400; default value: 130&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====ped_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;ped_syncer_distance&amp;gt;100&amp;lt;/ped_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced peds&lt;br /&gt;
:Available range: 50 - 400; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====player_sync_interval====&lt;br /&gt;
:''&amp;lt;player_sync_interval&amp;gt;100&amp;lt;/player_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between player sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====lightweight_sync_interval====&lt;br /&gt;
:''&amp;lt;lightweight_sync_interval&amp;gt;1500&amp;lt;/lightweight_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between lightweight (player) sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 1500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====camera_sync_interval====&lt;br /&gt;
:''&amp;lt;camera_sync_interval&amp;gt;500&amp;lt;/camera_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between camera sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_sync_interval&amp;gt;500&amp;lt;/ped_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is near the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_far_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_far_sync_interval&amp;gt;2000&amp;lt;/ped_far_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is far away from the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 2000&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_sync_interval====&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_sync_interval&amp;gt;400&amp;lt;/unoccupied_vehicle_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_mouse_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_mouse_sync_interval&amp;gt;100&amp;lt;/keysync_mouse_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_analog_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_analog_sync_interval&amp;gt;100&amp;lt;/keysync_analog_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====donkey_work_interval====&lt;br /&gt;
:''&amp;lt;donkey_work_interval&amp;gt;100&amp;lt;/donkey_work_interval&amp;gt;&lt;br /&gt;
:Update near list interval in milliseconds.&lt;br /&gt;
:Available range: 50 to 4000. default value: 100&lt;br /&gt;
&lt;br /&gt;
====bullet_sync====&lt;br /&gt;
:''&amp;lt;bullet_sync&amp;gt;1&amp;lt;/bullet_sync&amp;gt;   &lt;br /&gt;
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.&lt;br /&gt;
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22430|&lt;br /&gt;
====vehicle_contact_sync_radius====&lt;br /&gt;
:''&amp;lt;vehicle_contact_sync_radius&amp;gt;30&amp;lt;/vehicle_contact_sync_radius&amp;gt;   &lt;br /&gt;
:This parameter specifies the radius in which any contact with a vehicle will turn the player into its syncer.&lt;br /&gt;
:Changing this setting to 0 will cause vehicles to not pick a new syncer based on which player is touching the vehicle.&lt;br /&gt;
:Available range: 0 to 130.  Default - 30&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====vehext_percent====&lt;br /&gt;
:''&amp;lt;vehext_percent&amp;gt;0&amp;lt;/vehext_percent&amp;gt;&lt;br /&gt;
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. &lt;br /&gt;
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.&lt;br /&gt;
:Depending on the gamemode, an incorrect prediction may have a negative effect. &lt;br /&gt;
:Therefore this setting should be considered experimental.&lt;br /&gt;
:Available range: 0 to 100.  Default - 0&lt;br /&gt;
&lt;br /&gt;
====vehext_ping_limit====&lt;br /&gt;
:''&amp;lt;vehext_ping_limit&amp;gt;150&amp;lt;/vehext_ping_limit&amp;gt;&lt;br /&gt;
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.&lt;br /&gt;
:Only relevant if &amp;lt;vehext_percent&amp;gt; is greater than zero.&lt;br /&gt;
:Available range: 50 to 500.  Default - 150&lt;br /&gt;
&lt;br /&gt;
====latency_reduction====&lt;br /&gt;
:''&amp;lt;latency_reduction&amp;gt;0&amp;lt;/latency_reduction&amp;gt;&lt;br /&gt;
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).&lt;br /&gt;
:Due to the impact this may have on shot lag compensation, it should be considered experimental.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
:Bugs caused by enabling latency_reduction: https://bugs.mtasa.com/view.php?id=8191 + https://bugs.mtasa.com/view.php?id=8226&lt;br /&gt;
&lt;br /&gt;
====threadnet====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;threadnet&amp;gt;1&amp;lt;/threadnet&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to run the network synchronization on another thread.&lt;br /&gt;
:Enabling will make the sync smoother, but may increase CPU usage slightly.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====idfile====&lt;br /&gt;
:''&amp;lt;idfile&amp;gt;server-id.keys&amp;lt;/idfile&amp;gt; &lt;br /&gt;
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. &lt;br /&gt;
:Keep a backup of this file in a safe place. Default value: server-id.keys&lt;br /&gt;
:More information about client private files: [[Filepath]]&lt;br /&gt;
&lt;br /&gt;
====logfile====&lt;br /&gt;
:''&amp;lt;logfile&amp;gt;logs/server.log&amp;lt;/logfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====authfile====&lt;br /&gt;
:''&amp;lt;authfile&amp;gt;logs/server_auth.log&amp;lt;/authfile&amp;gt;&lt;br /&gt;
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used&lt;br /&gt;
&lt;br /&gt;
====dbfile====&lt;br /&gt;
:''&amp;lt;dbfile&amp;gt;logs/db.log&amp;lt;/dbfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.&lt;br /&gt;
&lt;br /&gt;
====loadstringfile====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;loadstringfile&amp;gt;logs/loadstring.log&amp;lt;/loadstringfile&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.&lt;br /&gt;
&lt;br /&gt;
====acl====&lt;br /&gt;
:''&amp;lt;acl&amp;gt;acl.xml&amp;lt;/acl&amp;gt; &lt;br /&gt;
:This parameter specifies the location and name of the Access Control List settings file. If left&lt;br /&gt;
:blank, server will use acl.xml file, located in the same folder as this configuration file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebuglogfile====&lt;br /&gt;
:''&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebugloglevel====&lt;br /&gt;
:''&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====htmldebuglevel====&lt;br /&gt;
:''&amp;lt;htmldebuglevel&amp;gt;0&amp;lt;/htmldebuglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====filter_duplicate_log_lines====&lt;br /&gt;
:''&amp;lt;filter_duplicate_log_lines&amp;gt;1&amp;lt;/filter_duplicate_log_lines&amp;gt;&lt;br /&gt;
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.&lt;br /&gt;
&lt;br /&gt;
====fpslimit====&lt;br /&gt;
:''&amp;lt;fpslimit&amp;gt;74&amp;lt;/fpslimit&amp;gt;&lt;br /&gt;
:Specifies the frame rate limit that will be applied to connecting clients.&lt;br /&gt;
:Available range: 25 to 32767. Default: 74. You can also use 0 for uncapped fps.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====voice====&lt;br /&gt;
:''&amp;lt;voice&amp;gt;0&amp;lt;/voice&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to enable player voice chat in-game&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled&lt;br /&gt;
&lt;br /&gt;
====voice_samplerate====&lt;br /&gt;
:''&amp;lt;voice_samplerate&amp;gt;1&amp;lt;/voice_samplerate&amp;gt;&lt;br /&gt;
:This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat&lt;br /&gt;
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1&lt;br /&gt;
&lt;br /&gt;
====voice_quality====&lt;br /&gt;
:''&amp;lt;voice_quality&amp;gt;4&amp;lt;/voice_quality&amp;gt;&lt;br /&gt;
:This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat&lt;br /&gt;
:Available range: 0 to 10.  Default - 4&lt;br /&gt;
&lt;br /&gt;
====voice_bitrate====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;voice_bitrate&amp;gt;24600&amp;lt;/voice_bitrate&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically.  Use with care.&lt;br /&gt;
&lt;br /&gt;
====backup_path====&lt;br /&gt;
:''&amp;lt;backup_path&amp;gt;backups&amp;lt;/backup_path&amp;gt;&lt;br /&gt;
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups&lt;br /&gt;
&lt;br /&gt;
====backup_interval====&lt;br /&gt;
:''&amp;lt;backup_interval&amp;gt;3&amp;lt;/backup_interval&amp;gt;&lt;br /&gt;
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 30.  Default - 3&lt;br /&gt;
&lt;br /&gt;
====backup_copies====&lt;br /&gt;
:''&amp;lt;backup_copies&amp;gt;10&amp;lt;/backup_copies&amp;gt;&lt;br /&gt;
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 100.  Default - 10&lt;br /&gt;
&lt;br /&gt;
====compact_internal_databases====&lt;br /&gt;
:''&amp;lt;compact_internal_databases&amp;gt;1&amp;lt;/compact_internal_databases&amp;gt;&lt;br /&gt;
:This parameter specifies when the internal sqlite databases should be defragmented.&lt;br /&gt;
:For more info see: https://www.sqlite.org/lang_vacuum.html&lt;br /&gt;
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====server_logic_fps_limit====&lt;br /&gt;
:''&amp;lt;server_logic_fps_limit&amp;gt;0&amp;lt;/server_logic_fps_limit&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING'''&lt;br /&gt;
:Server logic FPS limit.&lt;br /&gt;
:Available range: 0 to 100. default value: 0&lt;br /&gt;
&lt;br /&gt;
====crash_dump_upload====&lt;br /&gt;
:''&amp;lt;crash_dump_upload&amp;gt;1&amp;lt;/crash_dump_upload&amp;gt;&lt;br /&gt;
:This parameter specifies whether server crash dump files should be sent to MTA HQ.&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 1&lt;br /&gt;
&lt;br /&gt;
====fakelag====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;fakelag&amp;gt;0&amp;lt;/fakelag&amp;gt;&lt;br /&gt;
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 0&lt;br /&gt;
&lt;br /&gt;
====auth_serial_groups====&lt;br /&gt;
:''&amp;lt;auth_serial_groups&amp;gt;Admin&amp;lt;/auth_serial_groups&amp;gt;&lt;br /&gt;
:This parameter lists the ACL groups that are protected by serial authorization.&lt;br /&gt;
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.&lt;br /&gt;
:For more info see: https://mtasa.com/authserial&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.&lt;br /&gt;
:Values: Comma separated list of ACL groups.  Default - Admin&lt;br /&gt;
:See [[Authorized Serial Account Protection]] for more information.&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http====&lt;br /&gt;
:''&amp;lt;auth_serial_http&amp;gt;1&amp;lt;/auth_serial_http&amp;gt;&lt;br /&gt;
:This parameter specifies if the authorized serial login checks should also apply to the http interface.&lt;br /&gt;
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.&lt;br /&gt;
:For more info see: https://mtasa.com/authserialhttp&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http_ip_exceptions====&lt;br /&gt;
:''&amp;lt;auth_serial_http_ip_exceptions&amp;gt;127.0.0.1&amp;lt;/auth_serial_http_ip_exceptions&amp;gt;&lt;br /&gt;
:This parameter specifies which IP addresses should always pass auth_serial_http checks.&lt;br /&gt;
:Values: Comma separated list of IP addresses&lt;br /&gt;
&lt;br /&gt;
====database_credentials_protection====&lt;br /&gt;
:''&amp;lt;database_credentials_protection&amp;gt;1&amp;lt;/database_credentials_protection&amp;gt;&lt;br /&gt;
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:The extra measures are:&lt;br /&gt;
: - script files cannot be accessed with [[fileOpen]]&lt;br /&gt;
: - [[meta.xml]] is read-only&lt;br /&gt;
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 1&lt;br /&gt;
&lt;br /&gt;
{{New items|6.0160|1.6.0-22790|&lt;br /&gt;
====elementdata_whitelisted====&lt;br /&gt;
:''&amp;lt;elementdata_whitelisted&amp;gt;0&amp;lt;/elementdata_whitelisted&amp;gt;&lt;br /&gt;
:Enables extra protection for [[SetElementData|element data]].&lt;br /&gt;
:When this option is enabled, the server ignores element data sync packets from the client, except for allowed keys. To allow a client to change a key, use setElementData(element, name, nil, false, &amp;quot;allow&amp;quot;) first.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|6.0160|1.6.0-22815|&lt;br /&gt;
====check_duplicate_serials====&lt;br /&gt;
:''&amp;lt;check_duplicate_serials&amp;gt;1&amp;lt;/check_duplicate_serials&amp;gt;&lt;br /&gt;
:This parameter determines whether server will compare player serial on connection to any other serial present on server. &lt;br /&gt;
:When this option is enabled, the server will deny entry for player whose serial is already in use by other player on server. You might want to disable this when using VMs.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled; default - 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====player_triggered_event_interval====&lt;br /&gt;
:''&amp;lt;player_triggered_event_interval&amp;gt;1000&amp;lt;/player_triggered_event_interval&amp;gt;&lt;br /&gt;
:Time interval for counting max (see below: max_player_triggered_events_per_interval) triggered events (via triggerServerEvent), exceeding this will call [[onPlayerTriggerEventThreshold]]&lt;br /&gt;
:Values: 50-5000; default: 1000 (in ms)&lt;br /&gt;
&lt;br /&gt;
====max_player_triggered_events_per_interval====&lt;br /&gt;
:''&amp;lt;max_player_triggered_events_per_interval&amp;gt;100&amp;lt;/max_player_triggered_events_per_interval&amp;gt;&lt;br /&gt;
:Max triggered amount of events (via triggerServerEvent) within interval above (player_triggered_event_interval), exceeding this will call [[onPlayerTriggerEventThreshold]]&lt;br /&gt;
:Values: 1-1000; default: 100&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22930|&lt;br /&gt;
====player_teleport_alert====  &lt;br /&gt;
:''&amp;lt;player_teleport_alert&amp;gt;100&amp;lt;/player_teleport_alert&amp;gt;  &lt;br /&gt;
:Defines the maximum allowed unexpected position change (in units). If a player's position changes by more than this value without using [[setElementPosition]], the event [[onPlayerTeleport]] will be triggered.  &lt;br /&gt;
:Values: 5-500; default: 100&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====module====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_win32.dll&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_linux.so&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the module(s) which are loaded with the server. To load several modules, add more &amp;lt;module&amp;gt; parameter(s). Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====resource_client_file_checks====&lt;br /&gt;
&amp;lt;!-- added by https://github.com/multitheftauto/mtasa-blue/pull/3822 --&amp;gt;&lt;br /&gt;
:''&amp;lt;resource_client_file_checks&amp;gt;1&amp;lt;/resource_client_file_checks&amp;gt;&lt;br /&gt;
:If enabled, the server will perform checks on files in resources (listed in [[meta.xml]]) with PNG, TXD and DFF extensions, checking if they are corrupted. When the system finds a non-valid file of these types, it outputs a warning to the server console.&lt;br /&gt;
:You may want to disable thse checks when storing different/non-conforming data in files with these extensions (e.g. encrypted data).&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====resource====&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;admin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;defaultstats&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;helpmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;joinquit&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapcycler&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;parachute&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcebrowser&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; default=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;scoreboard&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;spawnmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;voice&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;votemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;webadmin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;play&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src-&amp;quot;resources&amp;quot; startup&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&lt;br /&gt;
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more &amp;lt;resource&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
:In addition, there are several flags which control how the server deals with each resource:&lt;br /&gt;
&lt;br /&gt;
:* '''src''': the resource name. This is the only mandatory flag.&lt;br /&gt;
:* '''startup''': controls whether the resource will be started with the server or not. If &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will be started. If not specified, defaults to not starting the resource.&lt;br /&gt;
:* '''protected''': if &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.&lt;br /&gt;
:* '''default''': if given a &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot; value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.&lt;br /&gt;
&lt;br /&gt;
====busy_sleep_time====&lt;br /&gt;
:''&amp;lt;busy_sleep_time&amp;gt;-1&amp;lt;/busy_sleep_time&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - This parameter configures the server's sleep duration in milliseconds during busy processing, affecting CPU usage and responsiveness.  &lt;br /&gt;
:Available range: -1 to 50; default value: -1  &lt;br /&gt;
:-1 sets the server to automatically determine the optimal value based on workload.  &lt;br /&gt;
:Setting it to 0 is recommended for achieving the best performance but may result in higher CPU usage.  &lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
====idle_sleep_time====&lt;br /&gt;
:''&amp;lt;idle_sleep_time&amp;gt;-1&amp;lt;/idle_sleep_time&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - This parameter configures the server's sleep duration in milliseconds during idle periods, affecting CPU usage and responsiveness.&lt;br /&gt;
:Available range: -1 to 50; default value: -1&lt;br /&gt;
:-1 sets the server to automatically determine the optimal value based on workload.&lt;br /&gt;
:Setting it to 10 is recommended for achieving the best performance while balancing CPU usage.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]].&lt;br /&gt;
&lt;br /&gt;
==Deprecated settings==&lt;br /&gt;
&lt;br /&gt;
The following settings have been deprecated in the production version of MTA:SA and no longer work.&lt;br /&gt;
&lt;br /&gt;
====networkencryption====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - also seems to be deprecated in code --&amp;gt;&lt;br /&gt;
:''&amp;lt;networkencryption&amp;gt;1&amp;lt;/networkencryption&amp;gt;&lt;br /&gt;
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====autologin====&lt;br /&gt;
&amp;lt;!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --&amp;gt;&lt;br /&gt;
:''&amp;lt;autologin&amp;gt;0&amp;lt;/autologin&amp;gt;&lt;br /&gt;
:Specifies whether or not players should automatically be logged in based on their IP adresses.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
&lt;br /&gt;
====httpautoclientfiles====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - doesn't exists in code too --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpautoclientfiles&amp;gt;1&amp;lt;/httpautoclientfiles&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Support]]&lt;br /&gt;
[[ru:Server mtaserver.conf]]&lt;br /&gt;
[[pl:mtaserver.conf]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HasObjectPermissionTo&amp;diff=82416</id>
		<title>HasObjectPermissionTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HasObjectPermissionTo&amp;diff=82416"/>
		<updated>2025-08-25T08:22:58Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added note about defaultPermission defaulting to false in 1.7&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function returns whether or not the given object has access to perform the given action. &lt;br /&gt;
{{Note|Only certain action names work. This function seems to return ''nil'' and output a bad argument error when checking if an object has rights for an action which doesn't start with ''function.'', ''command.'' or ''resource.'' keywords.}}&lt;br /&gt;
&lt;br /&gt;
Scripts frequently wish to limit access to features to particular users. The naïve way to do this would be to check if the player who is attempting to perform an action is in a particular group (usually the Admin group). The main issue with doing this is that the Admin group is not guaranteed to exist. It also doesn't give the server admin any flexibility. He might want to allow his 'moderators' access to the function you're limiting access to, or he may want it disabled entirely. &lt;br /&gt;
&lt;br /&gt;
This is where using the ACL properly comes in, and luckily this is very easy. It all comes down to using this function. This, somewhat confusingly named function lets you check if an ACL object (a player or a resource) has a particular ACL right. In this case, we just care about players.&lt;br /&gt;
&lt;br /&gt;
So, first of all, think of a name for your 'right'. Let's say we want a private area only certain people can go in, we'll call our right accessPrivateArea. Then, all you need to do is add one 'if' statement to your code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;if hasObjectPermissionTo ( player, &amp;quot;resource.YourResourceName.accessPrivateArea&amp;quot;, false ) then&lt;br /&gt;
-- Whatever you want to happen if they're allowed in&lt;br /&gt;
else&lt;br /&gt;
-- Whatever you want to happen if they aren't&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that we've named the ''right'' using ''resource.YourResourceName.accessPrivateArea'' - this is just for neatness, so that the admin knows what resource the right belongs to. It's strongly advised you follow this convention. The ''false'' argument specifies the 'defaultPermission', false indicating that if the user hasn't had the right allowed or dissallowed (i.e. the admin hasn't added it to the config), that it should default to being not allowed.&lt;br /&gt;
&lt;br /&gt;
The only downside of using this method is that the admin has to modify his config. The upsides are that the admin has much more control and your script will work for any server, however the admin has configured it.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
{{New feature/item|3.0162|1.7.0|25445|&lt;br /&gt;
'''In 1.7.0 defaultPermission will now default to false. May affect the normal operation of existing scripts.'''&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool hasObjectPermissionTo ( string / element theObject, string theAction [, bool defaultPermission = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;!-- Yes! This is actually correct this time ^^ notice theObject can be a string! --&amp;gt;&lt;br /&gt;
{{OOP|This function is also a static function underneath the ACL class.|[[ACL]].hasObjectPermissionTo||}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theObject:''' The object to test if has permission to. This can be a client element (ie. a player), a resource or a string in the form &amp;quot;user.&amp;lt;name&amp;gt;&amp;quot; or &amp;quot;resource.&amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
*'''theAction:''' The action to test if the given object has access to. Ie. &amp;quot;function.kickPlayer&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''defaultPermission:''' The default permission if none is specified in either of the groups the given object is a member of. If this is left to true, the given object will have permissions to perform the action unless the opposite is explicitly specified in the [[ACL]]. If false, the action will be denied by default unless explicitly approved by the [[Access Control List]].&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the given object has permission to perform the given action, ''false'' otherwise. Returns ''nil'' if the function failed because of bad arguments.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example kicks a player if the user using it has access to the kickPlayer function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Kick command&lt;br /&gt;
function onKickCommandHandler ( playerSource, commandName, playerToKick, stringReason )&lt;br /&gt;
    -- Does the calling user have permission to kick the player? Default&lt;br /&gt;
    -- to false for safety reasons. We do this so any user can't use us to&lt;br /&gt;
    -- kick players.&lt;br /&gt;
    if ( hasObjectPermissionTo ( playerSource, &amp;quot;function.kickPlayer&amp;quot;, false ) ) then&lt;br /&gt;
&lt;br /&gt;
        -- Do we have permission to kick the player? We do this so we can fail&lt;br /&gt;
        -- nicely if this resource doesn't have access to call that function.&lt;br /&gt;
        if ( hasObjectPermissionTo ( resource, &amp;quot;function.kickPlayer&amp;quot;, true ) ) then&lt;br /&gt;
            -- Kick him&lt;br /&gt;
            kickPlayer ( playerToKick, playerSource, stringReason )&lt;br /&gt;
        else&lt;br /&gt;
            -- Resource doesn't have any permissions, sorry&lt;br /&gt;
            outputChatBox ( &amp;quot;kick: The admin resource is not able to kick players. Please give this resource access to 'function.kickPlayer' in the ACL to use this function.&amp;quot;, playerSource )&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        -- User doesn't have any permissions&lt;br /&gt;
        outputChatBox ( &amp;quot;kick: You don't have permissions to use this command.&amp;quot;, playerSource )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;kick&amp;quot;, onKickCommandHandler )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{ACL_functions}}&lt;br /&gt;
[[zh-cn:hasObjectPermissionTo]]&lt;br /&gt;
[[pt-br:hasObjectPermissionTo]]&lt;br /&gt;
[[ru:hasObjectPermissionTo]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=82386</id>
		<title>SetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=82386"/>
		<updated>2025-08-19T18:10:10Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function stores [[element data]] under a certain key, attached to an element. Element data set using this is then synced with all clients and the server. The data can contain server-created elements, but you should avoid passing data that is not able to be synced such as xmlnodes, acls, aclgroups etc.&lt;br /&gt;
&lt;br /&gt;
As element data is synced to all clients, it can generate a lot of network traffic and be heavy on performance. Events are much more efficient for sending data from a client to the server only, or from the server to a specific client. &amp;lt;br/&amp;gt;&lt;br /&gt;
Usage of element data should be discouraged where your goal can be achieved with events like above, and [[table|tables]] for storing and retrieving data.&lt;br /&gt;
{{Tip|A simple and efficient way to make a variable known to the server and clients is to use setElementData on the [[root]] element.}}&lt;br /&gt;
{{Note|See [[Script security]] for tips on preventing cheaters when using events and element data.}}&lt;br /&gt;
{{Note|For performance reasons, never use setElementData in events that fire often (like [[onClientRender]]) without further optimization or conditions. In fact, using element data in general, can take such a toll on performance that not using it unless strictly necessary (e.g use alternatives such as storing data in tables) is recommended.}}&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0158|1.5.7|A subscription mode has been introduced for [[setElementData]] serverside. When setting data in subscription mode, only clients that are added through [[addElementDataSubscriber]] will receive the data, which is good for performance.&lt;br /&gt;
Note this mode only works when setting element data serverside. Setting data clientside still sends the update to all clients if 'synchronize' is set to true.&lt;br /&gt;
|20477}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &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;
bool setElementData ( element theElement, string key, var value [, string syncMode = &amp;quot;broadcast&amp;quot;, string clientChangesPolicy = &amp;quot;default&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setData||getElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 128 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New items|3.0158|1.5.7|&lt;br /&gt;
*'''syncMode:''' Synchronization mode.&lt;br /&gt;
**''&amp;quot;broadcast&amp;quot;'' - Synchronize to all clients (default behavior). You can also parse ''true'' for this option.&lt;br /&gt;
**''&amp;quot;local&amp;quot;'' - Don't synchronize. You can also parse ''false'' for this option.&lt;br /&gt;
**''&amp;quot;subscribe&amp;quot;'' - Only synchronize to specific clients. See [[addElementDataSubscriber]] and [[removeElementDataSubscriber]].&lt;br /&gt;
|20477}}&lt;br /&gt;
{{New items|3.0161|1.6.0|&lt;br /&gt;
*'''clientChangesPolicy:''' Client changes policy.&lt;br /&gt;
**''&amp;quot;default&amp;quot;'' - Use '''elementdata_whitelisted''' setting from [https://wiki.multitheftauto.com/wiki/Server_mtaserver.conf#elementdata_whitelisted mtaserver.conf]&lt;br /&gt;
**''&amp;quot;allow&amp;quot;'' - Trust changes from clients.&lt;br /&gt;
**''&amp;quot;deny&amp;quot;'' - Deny client changes. The server will trigger the [[onPlayerChangesProtectedData]] event when the client attempts to change the value.&lt;br /&gt;
{{Note|Linux server users [https://github.com/multitheftauto/mtasa-blue/issues/4109 have reported crashes] when using the clientChangesPolicy argument.}}&lt;br /&gt;
|22815}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setData||getElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 128 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the server.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set successfully, ''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 allows a player to add a custom tag onto their nickname, and also reverts it back to normal if they wish.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function addPlayerCustomTag ( thePlayer, command, newTag )&lt;br /&gt;
	--Let's make sure the newTag param has been entered...&lt;br /&gt;
	if ( newTag ) then&lt;br /&gt;
		--Grab their current playername for saving.&lt;br /&gt;
		local sPlayerNickname = getPlayerName ( thePlayer )&lt;br /&gt;
		--Create their new nickname with their tag&lt;br /&gt;
		local sNewPlayerNickname = newTag .. &amp;quot; &amp;quot; .. sPlayerNickname&lt;br /&gt;
		&lt;br /&gt;
		--Let's first load the element data, see if it's there already&lt;br /&gt;
		--The reason for this is that if a player were to do /addtag twice,&lt;br /&gt;
		--the tag would be prepended a second time&lt;br /&gt;
		local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
		if ( sOldNick == false ) then&lt;br /&gt;
			--Save their orignal nickname in their element data&lt;br /&gt;
			setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, sPlayerNickname )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Set their new nickname globally&lt;br /&gt;
		setPlayerName ( thePlayer, sNewPlayerNickname )&lt;br /&gt;
		&lt;br /&gt;
		--Tell them it's done&lt;br /&gt;
		outputChatBox ( &amp;quot;Your new nickname has been set, to put it back to its original state you can use /deltag&amp;quot;, thePlayer )&lt;br /&gt;
	else&lt;br /&gt;
		--The newTag param was not entered, give an error message&lt;br /&gt;
		outputChatBox ( &amp;quot;/addtag - Incorrect syntax, Correct: /addtag &amp;lt;newtag&amp;gt;&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;addtag&amp;quot;, addPlayerCustomTag )&lt;br /&gt;
&lt;br /&gt;
function removePlayerCustomTag ( thePlayer, command )&lt;br /&gt;
	--We first need to check that they have already used /addtag, let's do that now&lt;br /&gt;
	local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
	if ( sOldNick ) then&lt;br /&gt;
		--Great, they have a tag added, let's reset them&lt;br /&gt;
		&lt;br /&gt;
		--First we will want to reset the element data back to its default (that being false)&lt;br /&gt;
		setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, false )&lt;br /&gt;
		&lt;br /&gt;
		--Now set the client name back&lt;br /&gt;
		setPlayerName( thePlayer, sOldNick )&lt;br /&gt;
		&lt;br /&gt;
		--Notify them&lt;br /&gt;
		outputChatBox ( &amp;quot;Your old nickname has been set&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;deltag&amp;quot;, removePlayerCustomTag )&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.6.0-9.22815|Added clientChangesPolicy argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;br /&gt;
&lt;br /&gt;
[[pt-br:SetElementData]]&lt;br /&gt;
[[tr:setElementData]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponFire&amp;diff=82385</id>
		<title>OnPlayerWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWeaponFire&amp;diff=82385"/>
		<updated>2025-08-19T14:29:15Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{New feature/item|3.0153|1.5.3|9921|&lt;br /&gt;
This event is called when a player fires a weapon.  This does not trigger for projectiles, melee weapons, or camera.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|&lt;br /&gt;
*This event works only with weapons which have enabled bullet sync. See [[Weapons]] for more information.&lt;br /&gt;
*Start and end coordinates will be near the center of the map if a player fires a single handed weapon while looking behind them (when the gun is pointed at the sky)&lt;br /&gt;
}}&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int weaponID, float endX, float endY, float endZ, element hitElement, float startX, float startY, float startZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
*'''weaponID''':  an [[int]] representing [[weapons|weapon]] used for making a shot.&lt;br /&gt;
*'''endX''': [[float]] world X coordinate representing the end point.&lt;br /&gt;
*'''endY''': [[float]] world Y coordinate representing the end point.&lt;br /&gt;
*'''endZ''': [[float]] world Z coordinate representing the end point.&lt;br /&gt;
*'''hitElement''': an [[element]] which was hit by a shot. Currently this can be only another [[player]]. '''Note: hitElement could be incorrect and should not be relied upon.'''&lt;br /&gt;
*'''startX''': [[float]] world X coordinate representing the start of the bullet. '''Note: This is not the gun muzzle.'''&lt;br /&gt;
*'''startY''': [[float]] world Y coordinate representing the start of the bullet.&lt;br /&gt;
*'''startZ''': [[float]] world Z coordinate representing the start of the bullet.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who fired the weapon.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code creates explosions when the source players shoots.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler (&amp;quot;onPlayerWeaponFire&amp;quot;, root, &lt;br /&gt;
   function (weapon, endX, endY, endZ, hitElement, startX, startY, startZ)&lt;br /&gt;
       createExplosion(endX, endY, endZ, 2, source);&lt;br /&gt;
   end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DbQuery&amp;diff=82378</id>
		<title>DbQuery</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DbQuery&amp;diff=82378"/>
		<updated>2025-08-10T20:38:19Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function starts a database query using the supplied connection. Use the returned query handle with [[dbPoll]] to get the result, or [[dbFree]] if you don't want the result.&lt;br /&gt;
{{Tip|The server command [[Server_Commands#debugdb|debugdb 2]] will output verbose information on each query to a logging file (usually '''logs/db.log''')}}&lt;br /&gt;
{{Important Note|It is strongly recommended to use this function asynchronously, as presented in &amp;quot;This example starts a select query and processes the result in an inline callback function with custom arguments:&amp;quot;}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
handle dbQuery ( [ function callbackFunction, [ table callbackArguments, ] ] element databaseConnection, string query [, var param1 [, var param2 ...]] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[connection]]:query}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''databaseConnection:''' A database connection element previously returned from [[dbConnect]]&lt;br /&gt;
*'''query:''' An SQL query. Positions where parameter values will be inserted are marked with a '''?'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''callbackFunction:''' An optional function to be called when a result is ready. The function will only be called if the result has not already been read with [[dbPoll]]. The function is called with the query handle as the first argument.&lt;br /&gt;
*'''callbackArguments:''' An optional table containing extra arguments (excluding functions) to be sent to the callback function.&lt;br /&gt;
*'''paramX:''' A variable number of parameters. These must be strings or numbers - it is important to make sure they are of the correct type. Also, the number of parameters passed must be equal to the number of '''?''' characters in the query string.&lt;br /&gt;
String parameters are automatically quoted and escaped as required. (If you do not want a string quoted, use '''??''')&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a query handle unless the connection is incorrect, in which case it return ''false''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example starts an INSERT query and frees the result:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local qh = dbQuery( connection, &amp;quot;INSERT INTO table_name VALUES (?,?,?)&amp;quot;, &amp;quot;aaa&amp;quot;, &amp;quot;bbb&amp;quot;, 10 )&lt;br /&gt;
dbFree( qh )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example starts a select query and waits for the result: (server freeze included)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local qh = dbQuery( connection, &amp;quot;SELECT * FROM table_name&amp;quot; )&lt;br /&gt;
local result = dbPoll( qh, -1 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example starts a select query and processes the result in a callback function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function aaa()&lt;br /&gt;
    dbQuery( myCallback, connection, &amp;quot;SELECT * FROM table_name&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function myCallback(qh)&lt;br /&gt;
    local result = dbPoll( qh, 0 )   -- Timeout doesn't matter here because the result will always be ready&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example starts a select query and processes the result in an inline callback function with custom arguments:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dbQuery( function(qh, tag, score)&lt;br /&gt;
            local result = dbPoll( qh, 0 )   -- Timeout doesn't matter here because the result will always be ready&lt;br /&gt;
            outputDebugString( tag )         -- Prints &amp;quot;hello&amp;quot;&lt;br /&gt;
            outputDebugString( score )       -- Prints 2000&lt;br /&gt;
         end&lt;br /&gt;
         ,{&amp;quot;hello&amp;quot;,2000}, connection, &amp;quot;SELECT * FROM table_name&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Note''': It is usually good practice to surround table and column names with backticks (`) in case they contain spaces or SQL keywords (and therefore cause syntax errors). This is especially true when using variables for table and column names, as potential problems may not be apparent when the script is first written.''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows how to use backticks and '''??''' for parts of the query that are not column values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dbExec( connection, &amp;quot;UPDATE `??` SET `??`=?&amp;quot;, tableName, columnName, columnValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{SQL_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementResourceName&amp;diff=82249</id>
		<title>GetElementResourceName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementResourceName&amp;diff=82249"/>
		<updated>2025-07-21T09:27:58Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Created page with &amp;quot;__NOTOC__ {{Useful Function}} This function returns the name of the resource that created an element.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; string getElementResourceName ( element theElement ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required arguments=== * '''theElement''': the element you want to get the resource name of.  ==Returns== This function always returns a ''string'' containing the element's creator or a string containing information on how it failed to do so.  ==Cod...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function returns the name of the resource that created an element.&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 getElementResourceName ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''theElement''': the [[element]] you want to get the resource name of.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function always returns a ''string'' containing the [[element]]'s creator or a string containing information on how it failed to do so.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&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 getElementResourceName(element)&lt;br /&gt;
    if not isElement(element) then&lt;br /&gt;
        return &amp;quot;Invalid element&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local maxHops = 50&lt;br /&gt;
    local path = getElementType(element)&lt;br /&gt;
    local chain = { element }&lt;br /&gt;
&lt;br /&gt;
    -- Build parent chain&lt;br /&gt;
    local current = element&lt;br /&gt;
    while current and maxHops &amp;gt; 0 do&lt;br /&gt;
        current = getElementParent(current)&lt;br /&gt;
        if current then&lt;br /&gt;
            table.insert(chain, current)&lt;br /&gt;
            path = path .. &amp;quot; -&amp;gt; &amp;quot; .. getElementType(current)&lt;br /&gt;
        end&lt;br /&gt;
        maxHops = maxHops - 1&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Try to match one of the parents to a resource root&lt;br /&gt;
    for _, res in ipairs(getResources()) do&lt;br /&gt;
        local resRoot = getResourceRootElement(res)&lt;br /&gt;
        for _, ancestor in ipairs(chain) do&lt;br /&gt;
            if ancestor == resRoot then&lt;br /&gt;
                return getResourceName(res)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;No matching resource found (path: &amp;quot; .. path .. &amp;quot;)&amp;quot;&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;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=82248</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=82248"/>
		<updated>2025-07-21T09:25:10Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: /* Element functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=== Table functions ===&lt;br /&gt;
*[[addTableChangeHandler]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function monitors the changes of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[pairsByKeys]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sort pairs table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableToSql]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[Sort_Functions]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getTableFromSql]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isValueInTable]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; 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-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.deepmerge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function deep merges two tables. Every nested table will be correspondingly merged.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.element]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a new table with only userdata content.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.flip]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the table from the last value to the first value, such as reflection.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.getRandomRows]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns random rows from table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a 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-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;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getPlayersInACLGroup]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns all players in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; 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;
&lt;br /&gt;
=== Account functions ===&lt;br /&gt;
*[[getPlayerFromAccountName]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isPlayerAccount]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the account is a valid player account (account exists and is not a guest 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-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[sCamera]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» The function creates a speed camera in-game, fines speeding vehicles, and notifies the driver and take money from player based on vehicle speed.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Colshape functions ===&lt;br /&gt;
*[[createGarageColShape]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a collision shape from the specified garage.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cursor functions ===&lt;br /&gt;
*[[getCursorMovedOn]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setCursorCenteredOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This functions will center the cursor inside a rectangle.&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-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-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-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-size:smaller;&amp;quot;&amp;gt;» This function draws a line with dashes.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawEditbox]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a edit box across the screen - rendered for one frame. This should be used in conjunction with '''onClientRender''' in order to display continuously.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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-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-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-size:smaller;&amp;quot;&amp;gt;» This function draws a custom polygon on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawProgressBar]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function simulates a progress bar drawed using DirectDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangleOnPlayer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle above the player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRing]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a ring with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRombo]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a Rhombus.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawSprite]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draw a sprite in the 3D world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion crea un rectangle con un texto dentro.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTriangle]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[dxDrawBordered3DLine]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;»This function creates a bordered area with 3D dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxFade]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function fade-in or fade-out any dxDraw by gradually changing its alpha value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[CreateRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a 3d rectangle on the player screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenStartPositionFromBox]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function helps with getting the correct position for your dx-effects.&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-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setScreenFlash]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make the screen flash(like a screenshot).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Element functions === &lt;br /&gt;
*[[autoAttach]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function attaches one element into another at the same position and rotation they are.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[attachElementToBone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to attach an element to ped bone accurately using new bone functions.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementDirectionCardialPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the direction of the element according to the ''wind rose''.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getElementUsingData]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns table elements that contains the elements data with the given key and value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementZoneFullName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to retrieve the zone full name of a element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getNearestElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the nearest element (of a specific type) to a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPositionInFrontOfElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns position in provided distance away from element, including element's rotation.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInAir]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in air or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; 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-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-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementPlayer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the element is a player or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[getElementResourceName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the name of the resource that created an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
*[[onClientPlayerTimeChange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when the player's real time change.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onPlayerZoneChange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when the player enters a new area on the map.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[unbindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isCommandHandlerAdded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if a command is added or not in the respective resource.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Data functions === &lt;br /&gt;
*[[levenshtein]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function can be used to calculate the Levenshtein distance between two strings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[gregorianToJalali]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts gregorian date to jalali/shamsi date.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[byte2human]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertDate]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts date to another look.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[findRotation3D]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[formatDate]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[formatNumber]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function formats large numbers by adding commas.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenElements]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Returns the distance between two elements.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getElementRelatedAngle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the related angle between one element to another. This is useful to check which side an element is to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getFreeDimension]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function get free dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getRealMonth]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the current month 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-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-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;
*[[gradientString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function transforms a string in a new coloured gradient string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[hex2rgb]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert hex to rgb.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[hexColorToRGB]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert hex string/number to RGBA values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHSV]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert RGB to HSV color space.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToDecimal]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert RGB to Decimal color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[string.insert]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function inserts a string within another string at a given position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[splitMultiple]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function improves the split function so that multiple characters can be used as the split at character.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[tocolor2rgba]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert tocolor to rgba.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[fixPersianString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a fixed sorted bilingual RTL for strings consisting of Farsi/Arabic and English.&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-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;
*[[isMouseOnGUICloseButton]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isMouseOnGuiElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiMoveElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function moves guiElement by/like using moveObject.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiSetStaticImageMovable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to move a static image like a gui window.&amp;lt;/span&amp;gt;&lt;br /&gt;
=====Comboboxes=====&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; 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;
&lt;br /&gt;
=====Gridlists=====&lt;br /&gt;
*[[convertGridListToText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts grid list contents to text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[guiGridListAddPlayers]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[guiGridListGetColumnIDFromTitle]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[guiGridListSetColumnNonSortable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function makes a gridlist column become non-sortable.&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-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-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;
*[[reMap]] &amp;lt;span style=&amp;quot;color:gray; 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.clamp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number between range of numbers or it's minimum or maximum.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.getBezierPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Get N-th order bezier point.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.hypot]] &amp;lt;span style=&amp;quot;color:gray; 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.isPointInPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Check if point is inside polygon or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.lerp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Get val between two integer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; 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.polygonArea]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[math.rotVecToEulerAngle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Rotation Vector To Euler Angle&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; 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.percentProgress|math.percentProgress]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Returns a percentage progress from two specific values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.average]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the simple arithmetic mean of multiple numbers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.absin]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a formula representing the just positive half of a sine wave.&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-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;
*[[getWorldPositionFromMapPosition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts an F11 map position to world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ped functions ===&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getGuestPlayers]] &amp;lt;span style=&amp;quot;color:gray; 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-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-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds eyes position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedGender]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds their gender.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getPedWeaponSkill]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's corresponding weapon skill level name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedHitBone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the approximate number of the bone where the ped is hit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getPlayersInVehicles]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getPlayerNameFromID]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will get the player name from the ID element data.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[isPedDiving]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This feature checks that pedestrian is diving in the water.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isPedNearbyWall]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if player/ped is nearby a objects like buildings or walls.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setPedAttack]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make a ped attack a specified target.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setPedFollow]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make a ped follow a specified target.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedFalling]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the player/ped is falling from a high place.&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-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;
*[[getPlayerPreviousAndNextWeapon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the player previous and next weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function make a table of players within certain range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerActuallyInVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is actually in a vehicle instead of just in the process of entering.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerHitByVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function cancels event when a element is hit by a vehicle.&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-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-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSize]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the size of a specified resource in kB(kilobyte)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
*[[setResourcePriority]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function set resource download priority group.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound functions ===&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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-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;
*[[findEmptyCarSeat]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds you the first empty seat in a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getNearestVehicle]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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;
*[[getVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; 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;
*[[isVehicleDoubleExhaust]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks is exhaust vehicle double.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; 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-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-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnFire]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the vehicle is on fire or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleReversing]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isVehicleUpgraded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks is vehicle upgraded by upgrade ID.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setVehicleTurnVelocityCenterOfMass]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setVehicleHandlingFromText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's handling from text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleWheelModel]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function changes the wheel model of the informed vehicle.&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-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;
&lt;br /&gt;
=== Object functions ===&lt;br /&gt;
*[[getDynamicDoorObjectOpenRatio]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function tells you how open a dynamic door is in a range from 0 to 1.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementObject]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function tells you if an element is an object or no.&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-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;
=== Engine functions ===&lt;br /&gt;
*[[engineGetCOLsFromLibrary]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the collision data from the col library.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[engineLoadIMGContainer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function loads the IMG container.&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-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-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-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-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;
*[[checkPassiveTimer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use passive timers in your conditions. For example you want to prevent players repeatedly using a command.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[compact]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function create table containing variables and their values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[createDirectory]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a directory in the resource's file system.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanBySerial]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the ban if the serial is banned.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getSkinNameFromID]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the name of the skin from the given id.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isLastExecuteInTimer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function check if the execute is the last execute in the timer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInCircle]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[PlotTrajectoryAtTime]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Calculate projectile/water trajectory.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[preprocessor]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to use gcc macros.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[vector3:compare]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[svgCreateRoundedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a rectangle with rounded edges.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[debounce]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is removing unwanted input noise.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[listAllFiles]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function lists all files and subdirectories within a given directory and its subdirectories.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dumpdelete]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function recursively deletes elements inside a table, destroying elements like vehicles, peds, or killing timers.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String functions===&lt;br /&gt;
*[[string.endsWith]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a string ends with other string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.startsWith]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a string starts with other string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.repetition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function repeats a substring n times.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientMinimize&amp;diff=81999</id>
		<title>OnClientMinimize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientMinimize&amp;diff=81999"/>
		<updated>2025-05-19T09:20:38Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when the local player minimizes the game screen.&lt;br /&gt;
{{Note | This event only triggers from fullscreen minimize. [[onClientRestore]] can trigger even if this event didn't. [[isMTAWindowFocused]] is a more reliable way to see if a player is minimized.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example kills any player who minimizes the game. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function handleMinimize()&lt;br /&gt;
    setElementHealth( localPlayer, 0 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientMinimize&amp;quot;, root, handleMinimize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientMinimize&amp;diff=81998</id>
		<title>OnClientMinimize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientMinimize&amp;diff=81998"/>
		<updated>2025-05-19T09:05:48Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when the local player minimizes the game screen.&lt;br /&gt;
{{Note | This event only triggers from fullscreen minimize. [[onClientRestore]] can trigger even if this event didn't. Doesn't trigger if using borderless window. [[isMTAWindowFocused]] is a more reliable way to see if a player is minimized.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example kills any player who minimizes the game. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function handleMinimize()&lt;br /&gt;
    setElementHealth( localPlayer, 0 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientMinimize&amp;quot;, root, handleMinimize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientMinimize&amp;diff=81997</id>
		<title>OnClientMinimize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientMinimize&amp;diff=81997"/>
		<updated>2025-05-19T09:01:15Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when the local player minimizes the game screen.&lt;br /&gt;
{{Note | This event only triggers from fullscreen minimize. [[onClientRestore]] can trigger even if this event didn't. Doesn't trigger if using borderless window.}}&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example kills any player who minimizes the game. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function handleMinimize()&lt;br /&gt;
    setElementHealth( localPlayer, 0 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientMinimize&amp;quot;, root, handleMinimize )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=81964</id>
		<title>Scripting Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=81964"/>
		<updated>2025-04-26T08:03:01Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: /* Server Performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a variety of things that knowing, make life easier for MTA scripters.&lt;br /&gt;
&lt;br /&gt;
== General Lua ==&lt;br /&gt;
* The ''infinite loop / too long execution error'' which aborts execution can be disabled with ''debug.sethook(nil)''&lt;br /&gt;
* Be careful when looping a table where you intend to delete multiple rows, if 2 of them are in a row the 2nd one will get skipped! You must loop the table backwards (reverse ipairs). For example: ''for i = #table, 1, -1 do''&lt;br /&gt;
* Rather than having if checks inside if checks inside if checks, consider using ''return'' for example ''if (not ready) then return false end''&lt;br /&gt;
* A quick way to clamp a number between a lower and upper value: math.min(math.max(x, min), max) and easy to remember, just think: &amp;quot;min max min max&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting ==&lt;br /&gt;
* Remember that 'false' boolean has a value - If you want to delete a variable or element/account data, use 'nil' instead - this will reduce memory and disk usage (minuscule optimization, only notable on larger servers)&lt;br /&gt;
* Remember that 99% of the time it's a bug in your script, not an MTA bug! Don't report something to GitHub Issues until you're absolutely certain the bug can be reproduced with a small piece of script.&lt;br /&gt;
* As MTA already has so many functions and events virtually everything you want to do is already possible, as long as you're willing to do the work! You'll find better solutions to problems as there are many ways to achieve the same thing as long as you know all the functions and events.&lt;br /&gt;
* If a script is getting too complicated, try putting back-end stuff in another file so the main script calls the functions in the 2nd one. For example rather than having meaningless things like ''vehicleTable[vehicle][7]'' in the main file, put that in a function in the 2nd file and have the main file call a meaningfully named function so rather than seeing a useless ''7'' you'd see something like ''getFuel'' and although this might take longer to set-up you'll save time in the long run as you'll spend less time being confused when you come back to it in a weeks time to debug a problem.&lt;br /&gt;
* Your client side scripts can cause desync if you're not careful, try to keep the psychical world equal with every player. For example if your script creates a client side object make sure your script will create it for everyone nearby, else people will be wondering why a player appears to be constantly floating and falling.&lt;br /&gt;
* Instead of using ''onClientResourceStart'' or ''onResourceStart'' events attached to ''resourceRoot'' like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function warnPeopleThatThisResourceStarted()&lt;br /&gt;
    outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, warnPeopleThatThisResourceStarted)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also use this outside of any function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
However the result won't be exactly the same, as onClientResourceStart gets called only when all resource scripts are fully loaded, whilst code outside of it will be ran once '''this specific''' script is loaded. This is important, because load order of scripts exists, and you might want to call other script function (which gets loaded into memory afterwards), resulting in '''attempt to call global''' error. By using this specific event you have reliable time-frame to call it.&lt;br /&gt;
* string.dump produces unsigned compiled Lua code which is not allowed for security reasons. The only way to transport code now is by using the source code. e.g.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exampleFunction = [===[&lt;br /&gt;
    return param&lt;br /&gt;
]===]&lt;br /&gt;
&lt;br /&gt;
local loadedFunction = loadstring(exampleFunction)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting - Element IDs Being Reused ==&lt;br /&gt;
* If your script is covered in [[isTimer]] and [[isElement]] checks to hide debug warnings from deleted elements not being dereferenced (making the variable nil) you will regret it when that element ID or timer pointer has to be re-used by MTA in a weeks time and your script starts acting strangely and you won't have a clue why. Dereference destroyed elements and disconnected players!&lt;br /&gt;
* Why would MTA reuse it in a weeks time? Everything has a userdata value whether it's a function or an element, there is a limited amount of these available meaning that eventually the server will be forced to use the same userdata value twice, as long as whatever that userdata value was for is no longer valid. This could happen within hours, weeks or even never depending on how many elements are being created and destroyed by your scripts.&lt;br /&gt;
* For example if you have a race server that has 100 objects in every map and the map was changing every 5 minutes your server would go through at least 1200 an hour, 28,800 a day, 201,600 a week in userdata values, it can't keep going up and up though eventually it will have to reuse the same userdata values and as long as you're dereferencing in your scripts, it won't be a problem.&lt;br /&gt;
&lt;br /&gt;
The is an example of a script which fails to dereference, because when the player quits their userdata value remains in the table, but what if in a weeks time another player joins and they get assigned the same userdata value?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local admins = {}&lt;br /&gt;
local secretPasswordOnlyAdminsShouldKnow = &amp;quot;12345678&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function adminLogin()&lt;br /&gt;
    if (hasObjectPermissionTo(source, &amp;quot;command.ban&amp;quot;, false)) then&lt;br /&gt;
        admins[source] = true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root, adminLogin)&lt;br /&gt;
&lt;br /&gt;
function cmdGetSecretPassword(plr)&lt;br /&gt;
    if (not admins[plr]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    outputChatBox(&amp;quot;The secret password is &amp;quot;..secretPasswordOnlyAdminsShouldKnow, plr)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getsecretpass&amp;quot;, cmdGetSecretPassword)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some random player who joins in a weeks time gets the same userdata value as an admin, that player can now use &amp;quot;getsecretpass&amp;quot;. Solution? De-reference on destruction!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function onQuit()&lt;br /&gt;
    admins[source] = nil&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, onQuit)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Server Performance ==&lt;br /&gt;
* Server lagging? Check [[Debugging#Debugging_Performance_Issues|this page of debugging performance issues]]&lt;br /&gt;
* Using '''localPlayer''' (or if not possible: '''resourceRoot''') in '''2nd''' argument of triggerServer(Client)Event for events is much more efficient than using root.&lt;br /&gt;
* Try to be efficient, but if what you're doing is too time consuming or complex, is it really efficient?&lt;br /&gt;
* Unless you have hundreds of players, don't worry about making little optimizations, check ''performancebrowser'' or ''ipb'' (ingame performancebrowser) and make sure no resource is using significantly more than the others.&lt;br /&gt;
* It's much more efficient to [[SetElementHealth]] [[setElementRotation]] [[setPedArmor]] on a player client side (doing it server side sends an RPC to all players) consider a client event all your server scripts can call to set a players stat on their client and their client will then update the server via puresync and that change is then relayed to clients via the next puresync or lightsync packet. Note that doing this for position client isn't advised as the refresh rate for lightsync is low so would take a few seconds for remote players in another part of the map to see the player's new position.&lt;br /&gt;
&lt;br /&gt;
== Client Performance ==&lt;br /&gt;
* The biggest cause of client script CPU usage is anything done in onClient/Pre/HUD/Render because it is called every frame. For example if you have a script which calls dxDrawLine3D 20 times, 60 times a second, if those lines are only in 1 part of the map, consider adding a [[getDistanceBetweenPoints3D]] check between the local player and the general area that those lines are in and if they're no where near the player, don't draw the lines.&lt;br /&gt;
* '''dxDraw*''' functions can be highly optimised by using [https://wiki.multitheftauto.com/wiki/DxCreateRenderTarget dxCreateRenderTarget], which will merge them into one single '''dxDrawImage''' resulting in much less calls. This can be applied to parts of interface which are static, or updated periodically.&lt;br /&gt;
* Another thing that gets called a lot and could therefore be quite consuming if not careful are events like [[onClientPlayerWeaponFire]] and [[onClientPlayerDamage]] so any scripts that use these should only be bound to the necessary elements (such as localPlayer instead of root) and run the simplest if statements for example if you wanted to handle a certain weapon being fired in a certain dimension it's better to check weapon first as that's a simple weaponID == x rather than getElementDimension(source) == y.&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between local and global variables ==&lt;br /&gt;
&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   a = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;global&amp;quot;, stop - start ) -- more than 500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
local b = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   b = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;local&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between structural and OOP scripting ==&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   a = localPlayer.position&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;variable&amp;quot;, stop - start ) -- more than 1500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
b = nil&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   b = getElementPosition(localPlayer)&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;structural&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=81963</id>
		<title>Scripting Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=81963"/>
		<updated>2025-04-26T07:59:21Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Re-added something Srslyyyy removed as it is not &amp;quot;misleading information&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a variety of things that knowing, make life easier for MTA scripters.&lt;br /&gt;
&lt;br /&gt;
== General Lua ==&lt;br /&gt;
* The ''infinite loop / too long execution error'' which aborts execution can be disabled with ''debug.sethook(nil)''&lt;br /&gt;
* Be careful when looping a table where you intend to delete multiple rows, if 2 of them are in a row the 2nd one will get skipped! You must loop the table backwards (reverse ipairs). For example: ''for i = #table, 1, -1 do''&lt;br /&gt;
* Rather than having if checks inside if checks inside if checks, consider using ''return'' for example ''if (not ready) then return false end''&lt;br /&gt;
* A quick way to clamp a number between a lower and upper value: math.min(math.max(x, min), max) and easy to remember, just think: &amp;quot;min max min max&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting ==&lt;br /&gt;
* Remember that 'false' boolean has a value - If you want to delete a variable or element/account data, use 'nil' instead - this will reduce memory and disk usage (minuscule optimization, only notable on larger servers)&lt;br /&gt;
* Remember that 99% of the time it's a bug in your script, not an MTA bug! Don't report something to GitHub Issues until you're absolutely certain the bug can be reproduced with a small piece of script.&lt;br /&gt;
* As MTA already has so many functions and events virtually everything you want to do is already possible, as long as you're willing to do the work! You'll find better solutions to problems as there are many ways to achieve the same thing as long as you know all the functions and events.&lt;br /&gt;
* If a script is getting too complicated, try putting back-end stuff in another file so the main script calls the functions in the 2nd one. For example rather than having meaningless things like ''vehicleTable[vehicle][7]'' in the main file, put that in a function in the 2nd file and have the main file call a meaningfully named function so rather than seeing a useless ''7'' you'd see something like ''getFuel'' and although this might take longer to set-up you'll save time in the long run as you'll spend less time being confused when you come back to it in a weeks time to debug a problem.&lt;br /&gt;
* Your client side scripts can cause desync if you're not careful, try to keep the psychical world equal with every player. For example if your script creates a client side object make sure your script will create it for everyone nearby, else people will be wondering why a player appears to be constantly floating and falling.&lt;br /&gt;
* Instead of using ''onClientResourceStart'' or ''onResourceStart'' events attached to ''resourceRoot'' like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function warnPeopleThatThisResourceStarted()&lt;br /&gt;
    outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, warnPeopleThatThisResourceStarted)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also use this outside of any function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
However the result won't be exactly the same, as onClientResourceStart gets called only when all resource scripts are fully loaded, whilst code outside of it will be ran once '''this specific''' script is loaded. This is important, because load order of scripts exists, and you might want to call other script function (which gets loaded into memory afterwards), resulting in '''attempt to call global''' error. By using this specific event you have reliable time-frame to call it.&lt;br /&gt;
* string.dump produces unsigned compiled Lua code which is not allowed for security reasons. The only way to transport code now is by using the source code. e.g.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exampleFunction = [===[&lt;br /&gt;
    return param&lt;br /&gt;
]===]&lt;br /&gt;
&lt;br /&gt;
local loadedFunction = loadstring(exampleFunction)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting - Element IDs Being Reused ==&lt;br /&gt;
* If your script is covered in [[isTimer]] and [[isElement]] checks to hide debug warnings from deleted elements not being dereferenced (making the variable nil) you will regret it when that element ID or timer pointer has to be re-used by MTA in a weeks time and your script starts acting strangely and you won't have a clue why. Dereference destroyed elements and disconnected players!&lt;br /&gt;
* Why would MTA reuse it in a weeks time? Everything has a userdata value whether it's a function or an element, there is a limited amount of these available meaning that eventually the server will be forced to use the same userdata value twice, as long as whatever that userdata value was for is no longer valid. This could happen within hours, weeks or even never depending on how many elements are being created and destroyed by your scripts.&lt;br /&gt;
* For example if you have a race server that has 100 objects in every map and the map was changing every 5 minutes your server would go through at least 1200 an hour, 28,800 a day, 201,600 a week in userdata values, it can't keep going up and up though eventually it will have to reuse the same userdata values and as long as you're dereferencing in your scripts, it won't be a problem.&lt;br /&gt;
&lt;br /&gt;
The is an example of a script which fails to dereference, because when the player quits their userdata value remains in the table, but what if in a weeks time another player joins and they get assigned the same userdata value?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local admins = {}&lt;br /&gt;
local secretPasswordOnlyAdminsShouldKnow = &amp;quot;12345678&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function adminLogin()&lt;br /&gt;
    if (hasObjectPermissionTo(source, &amp;quot;command.ban&amp;quot;, false)) then&lt;br /&gt;
        admins[source] = true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root, adminLogin)&lt;br /&gt;
&lt;br /&gt;
function cmdGetSecretPassword(plr)&lt;br /&gt;
    if (not admins[plr]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    outputChatBox(&amp;quot;The secret password is &amp;quot;..secretPasswordOnlyAdminsShouldKnow, plr)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getsecretpass&amp;quot;, cmdGetSecretPassword)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some random player who joins in a weeks time gets the same userdata value as an admin, that player can now use &amp;quot;getsecretpass&amp;quot;. Solution? De-reference on destruction!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function onQuit()&lt;br /&gt;
    admins[source] = nil&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, onQuit)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Server Performance ==&lt;br /&gt;
* Server lagging? Check [[Debugging#Debugging_Performance_Issues|this page of debugging performance issues]]&lt;br /&gt;
* Using '''localPlayer''' (or if not possible: '''resourceRoot''') in '''2nd''' argument of triggerServer(Client)Event for events is much more efficient than using root.&lt;br /&gt;
* Try to be efficient, but if what you're doing is too time consuming or complex, is it really efficient?&lt;br /&gt;
* Unless you have hundreds of players, don't worry about making little optimizations, check ''performancebrowser'' or ''ipb'' (ingame performancebrowser) and make sure no resource is using significantly more than the others.&lt;br /&gt;
* It's much more efficient to [[SetElementHealth]] and [[setElementRotation]] on a player client side (doing it server side sends an RPC to all players) consider a client event all your server scripts can call to set a players health on their client and their client will then update the server via puresync and that change is then relayed to clients via the next puresync or lightsync packet.&lt;br /&gt;
&lt;br /&gt;
== Client Performance ==&lt;br /&gt;
* The biggest cause of client script CPU usage is anything done in onClient/Pre/HUD/Render because it is called every frame. For example if you have a script which calls dxDrawLine3D 20 times, 60 times a second, if those lines are only in 1 part of the map, consider adding a [[getDistanceBetweenPoints3D]] check between the local player and the general area that those lines are in and if they're no where near the player, don't draw the lines.&lt;br /&gt;
* '''dxDraw*''' functions can be highly optimised by using [https://wiki.multitheftauto.com/wiki/DxCreateRenderTarget dxCreateRenderTarget], which will merge them into one single '''dxDrawImage''' resulting in much less calls. This can be applied to parts of interface which are static, or updated periodically.&lt;br /&gt;
* Another thing that gets called a lot and could therefore be quite consuming if not careful are events like [[onClientPlayerWeaponFire]] and [[onClientPlayerDamage]] so any scripts that use these should only be bound to the necessary elements (such as localPlayer instead of root) and run the simplest if statements for example if you wanted to handle a certain weapon being fired in a certain dimension it's better to check weapon first as that's a simple weaponID == x rather than getElementDimension(source) == y.&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between local and global variables ==&lt;br /&gt;
&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   a = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;global&amp;quot;, stop - start ) -- more than 500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
local b = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   b = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;local&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between structural and OOP scripting ==&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   a = localPlayer.position&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;variable&amp;quot;, stop - start ) -- more than 1500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
b = nil&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   b = getElementPosition(localPlayer)&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;structural&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=79464</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=79464"/>
		<updated>2024-05-30T16:16:49Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added gui-window&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server_client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all elements of the specified type. This can be useful, as it disregards ''where'' in the element tree it is. It can be used with either the built in types (listed below) or with any custom type used in a .map file. For example, if there is an element of type &amp;quot;flag&amp;quot; (e.g. &amp;lt;flag /&amp;gt;) in the .map file, the using &amp;quot;flag&amp;quot; as the type argument would find it.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &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;
table getElementsByType ( string theType, [ element startat=getRootElement() ] ) &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;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;
table getElementsByType ( string theType, [ element startat=getRootElement(), bool streamedIn=false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP|This function is a static function underneath the Element class.|[[Element]].getAllByType||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theType:''' The type of element you want a list of. This is the same as the tag name in the .map file, so this can be used with a custom element type if desired. Built in types can be found here: [[Element]]&lt;br /&gt;
**'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
**'''&amp;quot;ped&amp;quot;:''' A ped&lt;br /&gt;
**'''&amp;quot;water&amp;quot;:''' A water polygon&lt;br /&gt;
**'''&amp;quot;sound&amp;quot;:''' A playing sound&lt;br /&gt;
**'''&amp;quot;vehicle&amp;quot;:''' A vehicle&lt;br /&gt;
**'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
**'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
**'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
**'''&amp;quot;colshape&amp;quot;:''' A collision shape&lt;br /&gt;
**'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
**'''&amp;quot;radararea&amp;quot;:''' A radar area&lt;br /&gt;
**'''&amp;quot;team&amp;quot;:''' A team&lt;br /&gt;
**'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
**'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
**'''&amp;quot;projectile&amp;quot;:''' A clientside projectile&lt;br /&gt;
**'''&amp;quot;effect&amp;quot;:''' A clientside effect&lt;br /&gt;
**'''&amp;quot;light&amp;quot;:''' A clientside light&lt;br /&gt;
**'''&amp;quot;searchlight&amp;quot;:''' A clientside searchlight&lt;br /&gt;
**'''&amp;quot;shader&amp;quot;:''' A shader&lt;br /&gt;
**'''&amp;quot;texture&amp;quot;:''' A texture&lt;br /&gt;
**'''&amp;quot;gui-window&amp;quot;:''' A GUI window (there's others like this for other GUI types)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''startat:''' The [[element]] the search should start at. Children of this element are searched, siblings or parents will not be found. By default, this is the root element which should suit most uses.&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;
*'''streamedIn:''' If true, function will only return elements that are streamed in.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example retrieves a table of the players in the server, and checks whether or not each one is in a vehicle:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType ( &amp;quot;player&amp;quot; ) -- get a table of all the players in the server&lt;br /&gt;
for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player&lt;br /&gt;
   if ( isPlayerInVehicle ( thePlayer ) ) then -- if the player is in a vehicle, announce it&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is in a vehicle&amp;quot; )&lt;br /&gt;
   else -- if the player isn't in a vehicle, announce that he/she is on foot&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is on foot&amp;quot; )&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example retrieves a table of the teams in the server, and display them in chat:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local teams = getElementsByType(&amp;quot;team&amp;quot;)&lt;br /&gt;
for i,team in ipairs(teams) do&lt;br /&gt;
   local teamName = getTeamName(team) -- get the team name&lt;br /&gt;
   outputChatBox(teamName) -- display the team name in chat&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This shows how you could create a new element to describe a gas station:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createGasStations(below)&lt;br /&gt;
    local gasstations = getElementsByType ( &amp;quot;gasstation&amp;quot;, below ) -- get a table of all the gas station elements in the element tree&lt;br /&gt;
    for theKey,theGasStation in ipairs(gasstations) do &lt;br /&gt;
        local x = getElementData(theGasStation, &amp;quot;posX&amp;quot;) -- get the position of the element&lt;br /&gt;
        local y = getElementData(theGasStation, &amp;quot;posY&amp;quot;)&lt;br /&gt;
        local z = getElementData(theGasStation, &amp;quot;posZ&amp;quot;)&lt;br /&gt;
        setElementParent(createColSphere(x, y, z, 10), theGasStation) -- create a colshape for the gas station at the gas station's position&lt;br /&gt;
        addEventHandler(&amp;quot;onColShapeHit&amp;quot;, theGasStation, giveGas) -- when the player hits&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mapLoad()&lt;br /&gt;
    createGasStations(source) -- create gas stations for the map that's just loaded&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, mapLoad)&lt;br /&gt;
&lt;br /&gt;
function giveGas(hittingElement)&lt;br /&gt;
    local theGasStation = source&lt;br /&gt;
    if getElementType(hittingElement) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local gas_left = getElementData(theGasStation, &amp;quot;amount&amp;quot;)&lt;br /&gt;
        local gas_speed = getElementData(theGasStation, &amp;quot;speed&amp;quot;)&lt;br /&gt;
        if gas_left &amp;gt; 0 then&lt;br /&gt;
&lt;br /&gt;
            local gas_to_remove = gas_speed &lt;br /&gt;
            if gas_left &amp;lt; gas_speed then&lt;br /&gt;
                gas_to_remove = gas_left&lt;br /&gt;
&lt;br /&gt;
            local current_vehicle_gas = getElementData(hittingElement, &amp;quot;gas&amp;quot;)&lt;br /&gt;
            current_vehicle_gas = current_vehicle_gas + gas_to_remove&lt;br /&gt;
            gas_left = gas_left - gas_to_remove&lt;br /&gt;
&lt;br /&gt;
            setElementData(hittingElement, &amp;quot;gas&amp;quot;, current_vehicle_gas)&lt;br /&gt;
            setElementData(theGasStation, &amp;quot;amount&amp;quot;, gas_left)&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox(&amp;quot;Pump is out of gas!&amp;quot;)&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;
'''Example 4:''' This example loops trough all connected players and redirects them to another server host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local serverIP = &amp;quot;99.88.77.66&amp;quot; -- Change to your server IP to redirect everyone&lt;br /&gt;
local serverPort = 22005 -- The destination server's port&lt;br /&gt;
&lt;br /&gt;
function redirectAllPlayers()&lt;br /&gt;
	for _,p in ipairs (getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
		if p then&lt;br /&gt;
			redirectPlayer (p, serverIP, serverPort)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onResourceStart&amp;quot;, resourceRoot, redirectAllPlayers)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerScreenShot&amp;diff=78752</id>
		<title>OnPlayerScreenShot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerScreenShot&amp;diff=78752"/>
		<updated>2024-01-04T22:23:06Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when the screen capture requested by [[takePlayerScreenShot]] has completed.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource theResource, string status, string imageData, int timestamp, string tag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theResource''': the [[resource]] which called [[takePlayerScreenShot]].&lt;br /&gt;
*'''status''': a [[string]] containing the status of the event which can be one of these values:&lt;br /&gt;
**''&amp;quot;ok&amp;quot;'' - the image capture was successful and imageData will contain a JPEG image.&lt;br /&gt;
**''&amp;quot;disabled&amp;quot;'' - the image capture failed because the player has disabled screen uploads.&lt;br /&gt;
**''&amp;quot;minimized&amp;quot;'' - the image capture failed because the player has minimized the screen (i.e. alt-tabbed).&lt;br /&gt;
**''&amp;quot;error&amp;quot;'' - the image capture failed because of an unspecified error.&lt;br /&gt;
*'''imageData''': a [[string]] which contains the JPEG image data. This can be saved with the [[Server_Scripting_Functions#File_functions|file functions]], or sent to players with [[triggerClientEvent]] or even uploaded to a web site.&lt;br /&gt;
*'''timestamp''': an [[int]] representing the server tick count when the capture was taken.&lt;br /&gt;
*'''tag''': a [[string]] passed to [[takePlayerScreenShot]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]]&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example captures the screen of a random player every 2 seconds and shows it to everyone:&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- Take screen shot every 2 seconds&lt;br /&gt;
function doTakeScreenShot()&lt;br /&gt;
    takePlayerScreenShot( getRandomPlayer(), 320, 200 )&lt;br /&gt;
end&lt;br /&gt;
setTimer(doTakeScreenShot, 2000, 0)&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- Receive screen shot result&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerScreenShot&amp;quot;, root,&lt;br /&gt;
    function ( theResource, status, pixels, timestamp, tag )&lt;br /&gt;
        triggerClientEvent( root, &amp;quot;onMyClientScreenShot&amp;quot;, resourceRoot, pixels )  -- Relay to all players&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;
&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;
--------------------------------------------------&lt;br /&gt;
-- Turn image data into a texture at the client&lt;br /&gt;
addEvent(&amp;quot;onMyClientScreenShot&amp;quot;,true)&lt;br /&gt;
addEventHandler( &amp;quot;onMyClientScreenShot&amp;quot;, resourceRoot,&lt;br /&gt;
    function( pixels )&lt;br /&gt;
        if image then&lt;br /&gt;
            destroyElement(image)&lt;br /&gt;
        end&lt;br /&gt;
        image = dxCreateTexture( pixels )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- Show image&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if image then&lt;br /&gt;
            dxDrawImage( 100, 250, 320, 200, image )&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;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.3|n/a|}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Split&amp;diff=78593</id>
		<title>Split</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Split&amp;diff=78593"/>
		<updated>2023-11-15T16:59:40Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added splitMultiple info to split&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function splits a string into substrings. You specify a character that will act as a separating character; this will determine where to split the sub-strings. For example, it can split the string &amp;quot;Hello World&amp;quot; into two strings containing the two words, by spliting using a space as a separator.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' You can use the function [[gettok]] to retrieve a single token from the string at a specific index. This may be faster for one-off lookups, but considerably slower if you are going to check each token in a long string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table split ( string stringToSplit, string / int separatingChar )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''stringToSplit''' The string you wish to split into parts.&lt;br /&gt;
* '''separatingChar''' A string of the character you want to split, or the [[ASCII|ASCII number]] representing the character you want to use to split. If you want to split a string at multiple characters see [[splitMultiple]]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' of substrings split from the original string if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{note|Unicode characters work but when combined with others do not. E.g: #split(&amp;quot;a€cb†&amp;quot;, &amp;quot;€&amp;quot;) returns 3 but #split(&amp;quot;a€cb&amp;quot;, &amp;quot;€&amp;quot;) returns 2.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|You can't use same char twice as a separator. Eg.:  ||, ||| are the same as |.&lt;br /&gt;
}}&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 example gives the specified weapons to the given player, while the weapons are a string in the form: 'weaponId,ammo;weaponId2,ammo2;weaponId3,ammo3;..'. This is especially for data read from a .map file attribute.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function giveWeapons(player, weaponsString)&lt;br /&gt;
	local weaponsTable = split(weaponsString, ';') --split the string by the semi colon&lt;br /&gt;
	for k,v in ipairs(weaponsTable) do --for all the split values do&lt;br /&gt;
		weaponId = gettok(v, 1, string.byte(',')) --get the weapon ID using gettok, retrieve the first token&lt;br /&gt;
		weaponAmmo = gettok(v, 2, &amp;quot;,&amp;quot;) --get the ammo using gettok, retrieve the second token&lt;br /&gt;
		if (weaponId and weaponAmmo) then --if neither of them is invalid&lt;br /&gt;
			giveWeapon(player, weaponId, weaponAmmo) --give the player the weapons&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=78592</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=78592"/>
		<updated>2023-11-15T16:58:09Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added splitMultiple&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=== Table functions ===&lt;br /&gt;
*[[addTableChangeHandler]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function monitors the changes of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTableFromSql]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isValueInTable]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[pairsByKeys]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sort pairs table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableToSql]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[Sort_Functions]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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.deepmerge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function deep merges two tables. Every nested table will be correspondingly merged.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.element]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a new table with only userdata content.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.flip]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the table from the last value to the first value, such as reflection.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.fromString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts string to a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.getRandomRows]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns random rows from table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a 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-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-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;
*[[getPlayersInACLGroup]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns all players in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getPlayerFromAccountName]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Colshape functions ===&lt;br /&gt;
*[[createGarageColShape]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a collision shape from the specified garage.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cursor functions ===&lt;br /&gt;
*[[getCursorMovedOn]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setCursorCenteredOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This functions will center the cursor inside a rectangle.&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-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-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-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-size:smaller;&amp;quot;&amp;gt;» This function draws a line with dashes.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawEditbox]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a edit box across the screen - rendered for one frame. This should be used in conjunction with '''onClientRender''' in order to display continuously.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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-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-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-size:smaller;&amp;quot;&amp;gt;» This function draws a custom polygon on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawProgressBar]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function simulates a progress bar drawed using DirectDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangleOnPlayer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle above the player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRing]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a ring with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRombo]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a Rhombus.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawSprite]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draw a sprite in the 3D world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion crea un rectangle con un texto dentro.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTriangle]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[dxFade]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function fade-in or fade-out any dxDraw by gradually changing its alpha value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function calculates the height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenStartPositionFromBox]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function helps with getting the correct position for your dx-effects.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wordWrap]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[CreateRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a 3d rectangle on the player screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[DxDrawBordered3DLine]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;»This function creates a bordered area with 3D dx lines.&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-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setScreenFlash]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make the screen flash(like a screenshot).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Element functions === &lt;br /&gt;
*[[autoAttach]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function attaches one element into another at the same position and rotation they are.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[attachElementToBone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to attach an element to ped bone accurately using new bone functions.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementDirectionCardialPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the direction of the element according to the ''wind rose''.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getElementUsingData]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns table elements that contains the elements data with the given key and value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementZoneFullName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to retrieve the zone full name of a element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getNearestElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the nearest element (of a specific type) to a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInAir]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in air or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; 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-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-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementPlayer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the element is a player or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[getPositionInFrontOfElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns position in provided distance away from element, including element's rotation.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
*[[onClientPlayerTimeChange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when the player's real time change.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onPlayerZoneChange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when the player enters a new area on the map.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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;
*[[isCommandHandlerAdded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if a command is added or not in the respective resource.&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-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-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertDate]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts date to another look.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[findRotation3D]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[formatDate]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[formatNumber]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function formats large numbers by adding commas.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenElements]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Returns the distance between two elements.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getElementRelatedAngle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the related angle between one element to another. This is useful to check which side an element is to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getFreeDimension]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function get free dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[getRealMonth]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the current month 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-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-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;
*[[gradientString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function transforms a string in a new coloured gradient string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[hex2rgb]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert hex to rgb.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[hexColorToRGB]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert hex string/number to RGBA values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHSV]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert RGB to HSV color space.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToDecimal]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert RGB to Decimal color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[string.insert]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function inserts a string within another string at a given position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[splitMultiple]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function improves the split function so that multiple characters can be used as the split at character.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[tocolor2rgba]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert tocolor to rgba.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
&lt;br /&gt;
=== GUI functions === &lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function moves guiElement by/like using moveObject.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiSetStaticImageMovable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to move a static image like a gui window.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseOnGUICloseButton]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isMouseOnGuiElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent. &amp;lt;/span&amp;gt;&lt;br /&gt;
=====Comboboxes=====&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; 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;
&lt;br /&gt;
=====Gridlists=====&lt;br /&gt;
*[[convertGridListToText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts grid list contents to text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[guiGridListAddPlayers]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[guiGridListSetColumnNonSortable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function makes a gridlist column become non-sortable.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; 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;
&lt;br /&gt;
=====Labels=====&lt;br /&gt;
*[[guiLabelAddEffect]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[math.clamp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number between range of numbers or it's minimum or maximum.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.getBezierPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Get N-th order bezier point.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.hypot]] &amp;lt;span style=&amp;quot;color:gray; 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.isPointInPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Check if point is inside polygon or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.lerp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Get val between two integer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; 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.polygonArea]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[math.rotVecToEulerAngle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Rotation Vector To Euler Angle&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[reMap]] &amp;lt;span style=&amp;quot;color:gray; 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.percentProgress|math.percentProgress]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Returns a percentage progress from two specific values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.average]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the simple arithmetic mean of multiple numbers.&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-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;
*[[getWorldPositionFromMapPosition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts an F11 map position to world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ped functions ===&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getGuestPlayers]] &amp;lt;span style=&amp;quot;color:gray; 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-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-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds eyes position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedGender]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds their gender.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getPedWeaponSkill]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's corresponding weapon skill level name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedHitBone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the approximate number of the bone where the ped is hit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[getPlayersInVehicles]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[isPedDiving]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This feature checks that pedestrian is diving in the water.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isPedNearbyWall]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if player/ped is nearby a objects like buildings or walls.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setPedAttack]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make a ped attack a specified target.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setPedFollow]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make a ped follow a specified target.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerNameFromID]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will get the player name from the ID element data.&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-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;
*[[getPlayerPreviousAndNextWeapon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the player previous and next weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function make a table of players within certain range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerActuallyInVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is actually in a vehicle instead of just in the process of entering.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerHitByVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function cancels event when a element is hit by a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&lt;br /&gt;
*[[getFilesInResourceFolder]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets a list of files that are inside a folder of a resource.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; 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-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSize]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the size of a specified resource in kB(kilobyte)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
*[[setResourcePriority]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function set resource download priority group.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound functions ===&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element has finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isSoundPlaying]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element is playing or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[stopSoundSlowly]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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;
*[[findEmptyCarSeat]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds you the first empty seat in a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getNearestVehicle]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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-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;
*[[getVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; 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;
*[[isVehicleDoubleExhaust]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks is exhaust vehicle double.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; 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-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-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnFire]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the vehicle is on fire or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleReversing]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isVehicleUpgraded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks is vehicle upgraded by upgrade ID.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setVehicleTurnVelocityCenterOfMass]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[setVehicleHandlingFromText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's handling from text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleWheelModel]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function changes the wheel model of the informed vehicle.&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-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;
&lt;br /&gt;
=== Object functions ===&lt;br /&gt;
*[[getDynamicDoorObjectOpenRatio]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function tells you how open a dynamic door is in a range from 0 to 1.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementObject]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function tells you if an element is an object or no.&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-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;
=== Engine functions ===&lt;br /&gt;
*[[engineGetCOLsFromLibrary]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the collision data from the col library.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[engineLoadIMGContainer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function loads the IMG container.&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-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-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-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-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;
*[[checkPassiveTimer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use passive timers in your conditions. For example you want to prevent players repeatedly using a command.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[compact]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function create table containing variables and their values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; 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-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;
*[[getSkinNameFromID]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the name of the skin from the given id.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[isCharInString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This shared function allows you to check if a char specified is in a string value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLastExecuteInTimer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function check if the execute is the last execute in the timer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInCircle]] &amp;lt;span style=&amp;quot;color:gray; 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-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-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;
*[[PlotTrajectoryAtTime]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Calculate projectile/water trajectory.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[preprocessor]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to use gcc macros.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[vector3:compare]] &amp;lt;span style=&amp;quot;color:gray; 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;
*[[svgCreateRoundedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a rectangle with rounded edges.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[debounce]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is removing unwanted input noise.&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>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SplitMultiple&amp;diff=78591</id>
		<title>SplitMultiple</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SplitMultiple&amp;diff=78591"/>
		<updated>2023-11-15T16:55:29Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &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 splits a string into a table when the specified character(s) are detected.&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;table splitMultiple( string str, string chars )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''str''': The string to split.&lt;br /&gt;
* '''chars''': The characters to detect and split the string at.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table containing the pieces of the split string.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&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 splitMultiple(str, word)&lt;br /&gt;
    local result = {}&lt;br /&gt;
    local pattern = &amp;quot;(.-)&amp;quot; .. word&lt;br /&gt;
&lt;br /&gt;
    for match in string.gmatch(str, pattern) do&lt;br /&gt;
        table.insert(result, match)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Add the remaining part of the string, if any&lt;br /&gt;
    local lastPart = string.match(str, word .. &amp;quot;(.*)&amp;quot;)&lt;br /&gt;
    if lastPart then&lt;br /&gt;
        table.insert(result, lastPart)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return result&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;
==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&amp;gt;&lt;br /&gt;
local text = &amp;quot;This is an example string with some words to split.&amp;quot;&lt;br /&gt;
local word = &amp;quot;word&amp;quot;&lt;br /&gt;
local parts = splitStringByWord(text, word)&lt;br /&gt;
&lt;br /&gt;
for i, part in ipairs(parts) do&lt;br /&gt;
    print(&amp;quot;Part &amp;quot; .. i .. &amp;quot;: &amp;quot; .. part)&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;
Author: ChatGPT-4&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SplitMultiple&amp;diff=78590</id>
		<title>SplitMultiple</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SplitMultiple&amp;diff=78590"/>
		<updated>2023-11-15T16:55:10Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function splits a string into a table when the specified character(s) are detected.&amp;lt;br/&amp;gt;  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table splitMultiple( string str )&amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments=== * '''str''': The string to split. * '''chars''': The characters to detect and split the string at.  ===Returns=== Returns a table containing the pieces of the split string.  ==Code== &amp;lt;section name=&amp;quot;S...&amp;quot;&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 splits a string into a table when the specified character(s) are detected.&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;table splitMultiple( string str )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''str''': The string to split.&lt;br /&gt;
* '''chars''': The characters to detect and split the string at.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table containing the pieces of the split string.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&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 splitMultiple(str, word)&lt;br /&gt;
    local result = {}&lt;br /&gt;
    local pattern = &amp;quot;(.-)&amp;quot; .. word&lt;br /&gt;
&lt;br /&gt;
    for match in string.gmatch(str, pattern) do&lt;br /&gt;
        table.insert(result, match)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Add the remaining part of the string, if any&lt;br /&gt;
    local lastPart = string.match(str, word .. &amp;quot;(.*)&amp;quot;)&lt;br /&gt;
    if lastPart then&lt;br /&gt;
        table.insert(result, lastPart)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return result&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;
==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&amp;gt;&lt;br /&gt;
local text = &amp;quot;This is an example string with some words to split.&amp;quot;&lt;br /&gt;
local word = &amp;quot;word&amp;quot;&lt;br /&gt;
local parts = splitStringByWord(text, word)&lt;br /&gt;
&lt;br /&gt;
for i, part in ipairs(parts) do&lt;br /&gt;
    print(&amp;quot;Part &amp;quot; .. i .. &amp;quot;: &amp;quot; .. part)&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;
Author: ChatGPT-4&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Math.clamp&amp;diff=77242</id>
		<title>Math.clamp</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Math.clamp&amp;diff=77242"/>
		<updated>2023-08-02T17:43:49Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful_Function}}&lt;br /&gt;
This function returns the number between range of numbers or it's minimum or maximum. Alternatively if you can remember &amp;quot;min max min max&amp;quot; do math.min(math.max(x, min), max)&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float math.clamp( float number, float min, float max )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''number''': Number that will be compared with range.&lt;br /&gt;
* '''min''': Minimum of range.&lt;br /&gt;
* '''max''': Maximum of range.&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 math.clamp(number, min, max)&lt;br /&gt;
	if number &amp;lt; min then&lt;br /&gt;
		return min&lt;br /&gt;
	elseif number &amp;gt; max then&lt;br /&gt;
		return max    &lt;br /&gt;
	end&lt;br /&gt;
	return number&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Author''': Olez14&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local num = math.clamp(50, 1, 100)&lt;br /&gt;
print(num)&lt;br /&gt;
-- This prints 50.0&lt;br /&gt;
&lt;br /&gt;
local num = math.clamp(-10, 1, 100)&lt;br /&gt;
print(num)&lt;br /&gt;
-- This prints 1.0&lt;br /&gt;
&lt;br /&gt;
local num = math.clamp(225, 1, 100)&lt;br /&gt;
print(num)&lt;br /&gt;
-- This prints 100.0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=77241</id>
		<title>Scripting Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=77241"/>
		<updated>2023-08-02T17:30:14Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: /* General Lua */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a variety of things that knowing, make life easier for MTA scripters.&lt;br /&gt;
&lt;br /&gt;
== General Lua ==&lt;br /&gt;
* The ''infinite loop / too long execution error'' which aborts execution can be disabled with ''debug.sethook(nil)''&lt;br /&gt;
* Be careful when looping a table where you intend to delete multiple rows, if 2 of them are in a row the 2nd one will get skipped! You must loop the table backwards (reverse ipairs). For example: ''for i = #table, 1, -1 do''&lt;br /&gt;
* Rather than having if checks inside if checks inside if checks, consider using ''return'' for example ''if (not ready) then return false end''&lt;br /&gt;
* A quick way to clamp a number between a lower and upper value: math.min(math.max(x, min), max) and easy to remember, just think: &amp;quot;min max min max&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting ==&lt;br /&gt;
* Remember that 'false' boolean has a value - If you want to delete a variable or element/account data, use 'nil' instead - this will reduce memory and disk usage (minuscule optimization, only notable on larger servers)&lt;br /&gt;
* Remember that 99% of the time it's a bug in your script, not an MTA bug! Don't report something to GitHub Issues until you're absolutely certain the bug can be reproduced with a small piece of script.&lt;br /&gt;
* As MTA already has so many functions and events virtually everything you want to do is already possible, as long as you're willing to do the work! You'll find better solutions to problems as there are many ways to achieve the same thing as long as you know all the functions and events.&lt;br /&gt;
* If a script is getting too complicated, try putting back-end stuff in another file so the main script calls the functions in the 2nd one. For example rather than having meaningless things like ''vehicleTable[vehicle][7]'' in the main file, put that in a function in the 2nd file and have the main file call a meaningfully named function so rather than seeing a useless ''7'' you'd see something like ''getFuel'' and although this might take longer to set-up you'll save time in the long run as you'll spend less time being confused when you come back to it in a weeks time to debug a problem.&lt;br /&gt;
* Your client side scripts can cause desync if you're not careful, try to keep the psychical world equal with every player. For example if your script creates a client side object make sure your script will create it for everyone nearby, else people will be wondering why a player appears to be constantly floating and falling.&lt;br /&gt;
* Instead of using ''onClientResourceStart'' or ''onResourceStart'' events attached to ''resourceRoot'' like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function warnPeopleThatThisResourceStarted()&lt;br /&gt;
    outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, warnPeopleThatThisResourceStarted)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also use this outside of any function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And the result will be the same, because Lua executes every instruction in every script file of a resource when it starts.&lt;br /&gt;
* string.dump produces unsigned compiled Lua code which is not allowed for security reasons. The only way to transport code now is by using the source code. e.g.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exampleFunction = [===[&lt;br /&gt;
    return param&lt;br /&gt;
]===]&lt;br /&gt;
&lt;br /&gt;
local loadedFunction = loadstring(exampleFunction)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting - Element IDs Being Reused ==&lt;br /&gt;
* If your script is covered in [[isTimer]] and [[isElement]] checks to hide debug warnings from deleted elements not being dereferenced (making the variable nil) you will regret it when that element ID or timer pointer has to be re-used by MTA in a weeks time and your script starts acting strangely and you won't have a clue why. Dereference destroyed elements and disconnected players!&lt;br /&gt;
* Why would MTA reuse it in a weeks time? Everything has a userdata value whether it's a function or an element, there is a limited amount of these available meaning that eventually the server will be forced to use the same userdata value twice, as long as whatever that userdata value was for is no longer valid. This could happen within hours, weeks or even never depending on how many elements are being created and destroyed by your scripts.&lt;br /&gt;
* For example if you have a race server that has 100 objects in every map and the map was changing every 5 minutes your server would go through at least 1200 an hour, 28,800 a day, 201,600 a week in userdata values, it can't keep going up and up though eventually it will have to reuse the same userdata values and as long as you're dereferencing in your scripts, it won't be a problem.&lt;br /&gt;
&lt;br /&gt;
The is an example of a script which fails to dereference, because when the player quits their userdata value remains in the table, but what if in a weeks time another player joins and they get assigned the same userdata value?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local admins = {}&lt;br /&gt;
local secretPasswordOnlyAdminsShouldKnow = &amp;quot;12345678&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function adminLogin()&lt;br /&gt;
    if (hasObjectPermissionTo(source, &amp;quot;command.ban&amp;quot;, false)) then&lt;br /&gt;
        admins[source] = true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root, adminLogin)&lt;br /&gt;
&lt;br /&gt;
function cmdGetSecretPassword(plr)&lt;br /&gt;
    if (not admins[plr]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    outputChatBox(&amp;quot;The secret password is &amp;quot;..secretPasswordOnlyAdminsShouldKnow, plr)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getsecretpass&amp;quot;, cmdGetSecretPassword)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some random player who joins in a weeks time gets the same userdata value as an admin, that player can now use &amp;quot;getsecretpass&amp;quot;. Solution? De-reference on destruction!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function onQuit()&lt;br /&gt;
    admins[source] = nil&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, onQuit)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Server Performance ==&lt;br /&gt;
* Server lagging? Check [[Debugging#Debugging_Performance_Issues|this page of debugging performance issues]]&lt;br /&gt;
* Using resourceRoot in event handlers for events from clients is much more efficient than using root.&lt;br /&gt;
* Try to be efficient, but if what you're doing is too time consuming or complex, is it really efficient?&lt;br /&gt;
* It's much more efficient to [[SetElementHealth]] and [[setElementRotation]] on a player client side, consider a client event all your server scripts can call to set a players health.&lt;br /&gt;
* Unless you have hundreds of players, don't worry about making little optimizations, check ''performancebrowser'' or ''ipb'' (ingame performancebrowser) and make sure no resource is using significantly more than the others.&lt;br /&gt;
&lt;br /&gt;
== Client Performance ==&lt;br /&gt;
* The biggest cause of client script CPU usage is anything done in onClient/Pre/Hud/Render because it is called so often. For example if you have a script which calls dxDrawLine3D 20 times, 60 times a second, if those lines are only in 1 part of the map, consider adding a [[getDistanceBetweenPoints3D]] check between the local player and the general area that those lines are in and if they're no where near the player, don't draw the lines.&lt;br /&gt;
* Another thing that gets called a lot and could therefore be quite consuming if not careful are events like [[onClientPlayerWeaponFire]] and [[onClientPlayerDamage]] so any scripts that use these should only be bound to the necessary elements (such as localPlayer instead of root) and run the simplest if statements for example if you wanted to handle a certain weapon being fired in a certain dimension it's better to check weapon first as that's a simple weaponID == x rather than getElementDimension(source) == y.&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between local and global variables ==&lt;br /&gt;
&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   a = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;global&amp;quot;, stop - start ) -- more than 500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
local b = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   b = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;local&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between structural and OOP scripting ==&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   a = localPlayer.position&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;variable&amp;quot;, stop - start ) -- more than 1500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
b = nil&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   b = getElementPosition(localPlayer)&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;structural&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77220</id>
		<title>GetLocalization</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77220"/>
		<updated>2023-07-27T18:00:07Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
This function gets the player's localization setting as set in the MTA client.&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 getLocalization ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with the following entries:&lt;br /&gt;
*'''code :''' The language code ''(eg. &amp;quot;en_US&amp;quot; for &amp;quot;English (United States)&amp;quot; or &amp;quot;ar&amp;quot; for &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
*'''name :''' The name of the language ''(eg. &amp;quot;English (United States)&amp;quot; or &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs simple ''Welcome'' message at the resource start (also when player joins the game if the resource is already running).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local msg = {cs = &amp;quot;Vítejte&amp;quot;, fr = &amp;quot;Accueil&amp;quot;, de = &amp;quot;Willkommen&amp;quot;, pl = &amp;quot;Powitanie&amp;quot;, hu = &amp;quot;Üdv&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, &lt;br /&gt;
	function ()&lt;br /&gt;
		local languageCode = getLocalization()[&amp;quot;code&amp;quot;]&lt;br /&gt;
		if msg[languageCode] then --Check if the message is avaible in client's language&lt;br /&gt;
			outputChatBox(msg[languageCode] .. &amp;quot;!&amp;quot;) --Output it&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome!&amp;quot;) --Output English for any other language&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a list of all the language codes used in MTA in a table with the full name of the language.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
langTable = {&lt;br /&gt;
	[&amp;quot;ar_SA&amp;quot;] = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
	[&amp;quot;az_AZ&amp;quot;] = &amp;quot;Azerbaijani&amp;quot;,&lt;br /&gt;
	[&amp;quot;bg_BG&amp;quot;] = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;bs_BA&amp;quot;] = &amp;quot;Bosnian&amp;quot;,&lt;br /&gt;
	[&amp;quot;cs_CZ&amp;quot;] = &amp;quot;Czech&amp;quot;,&lt;br /&gt;
	[&amp;quot;da_DK&amp;quot;] = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
	[&amp;quot;de_DE&amp;quot;] = &amp;quot;German&amp;quot;,&lt;br /&gt;
	[&amp;quot;en_US&amp;quot;] = &amp;quot;English&amp;quot;,&lt;br /&gt;
	[&amp;quot;el_GR&amp;quot;] = &amp;quot;Greek&amp;quot;,&lt;br /&gt;
	[&amp;quot;es_ES&amp;quot;] = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
	[&amp;quot;et_EE&amp;quot;] = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fa_IR&amp;quot;] = &amp;quot;Persian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fi_FI&amp;quot;] = &amp;quot;Finnish&amp;quot;,&lt;br /&gt;
	[&amp;quot;fil_PH&amp;quot;] = &amp;quot;Filipino&amp;quot;,&lt;br /&gt;
	[&amp;quot;fr_FR&amp;quot;] = &amp;quot;French&amp;quot;,&lt;br /&gt;
	[&amp;quot;he_IL&amp;quot;] = &amp;quot;Hebrew&amp;quot;,&lt;br /&gt;
	[&amp;quot;hi_IN&amp;quot;] = &amp;quot;Hindi&amp;quot;,&lt;br /&gt;
	[&amp;quot;hr_HR&amp;quot;] = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
	[&amp;quot;hu_HU&amp;quot;] = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;id_ID&amp;quot;] = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
	[&amp;quot;it_IT&amp;quot;] = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ja_JP&amp;quot;] = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
	[&amp;quot;ka_GE&amp;quot;] = &amp;quot;Georgian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ko_KR&amp;quot;] = &amp;quot;Korean&amp;quot;,&lt;br /&gt;
	[&amp;quot;lt_LT&amp;quot;] = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;lv_LV&amp;quot;] = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
	[&amp;quot;mk_MK&amp;quot;] = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nb_NO&amp;quot;] = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nl_NL&amp;quot;] = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_BR&amp;quot;] = &amp;quot;Portuguese, Brazilian&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_PT&amp;quot;] = &amp;quot;Portuguese&amp;quot;,&lt;br /&gt;
	[&amp;quot;pl_PL&amp;quot;] = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
	[&amp;quot;ru_RU&amp;quot;] = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ro_RO&amp;quot;] = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl_SL&amp;quot;] = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sv_SE&amp;quot;] = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
	[&amp;quot;sk_SK&amp;quot;] = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
	[&amp;quot;srp&amp;quot;] = &amp;quot;Serbian&amp;quot;,&lt;br /&gt;
	[&amp;quot;tr_TR&amp;quot;] = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
	[&amp;quot;uk_UA&amp;quot;] = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
	[&amp;quot;vi_VN&amp;quot;] = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_CN&amp;quot;] = &amp;quot;Chinese Simplified&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_TW&amp;quot;] = &amp;quot;Chinese Traditional&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- Or... just update the scripts? Why complicate everything? --&amp;gt;&lt;br /&gt;
This function is useful for fixing any scripts that were made before MTA 1.6 as some of the language codes were changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function getLanguageCode(c)&lt;br /&gt;
	if (c == &amp;quot;fr_FR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;fr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ru_RU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ru&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pt_PT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pt_BR&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pl_PL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;tr_TR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;tr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;es_ES&amp;quot;) then&lt;br /&gt;
		return &amp;quot;es&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;de_DE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;de&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;vi_VN&amp;quot;) then&lt;br /&gt;
		return &amp;quot;vi&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ar_SA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ar&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;bg_BG&amp;quot;) then&lt;br /&gt;
		return &amp;quot;bg&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hu_HU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hu&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ro_RO&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ro&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sv_SE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sv&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hr_HR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;uk_UA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;uk&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sl_SL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;id_ID&amp;quot;) then&lt;br /&gt;
		return &amp;quot;id&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;nl_NL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;nl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;it_IT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;it&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;nb_NO&amp;quot;) then&lt;br /&gt;
		return &amp;quot;nb&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;el_GR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;el&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;lt_LT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;lt&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;da_DK&amp;quot;) then&lt;br /&gt;
		return &amp;quot;da&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
code = getLanguageCode(getLocalization().code)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_utility_functions}}&lt;br /&gt;
[[ru:GetLocalization]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77219</id>
		<title>GetLocalization</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77219"/>
		<updated>2023-07-27T17:51:51Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
This function gets the player's localization setting as set in the MTA client.&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 getLocalization ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with the following entries:&lt;br /&gt;
*'''code :''' The language code ''(eg. &amp;quot;en_US&amp;quot; for &amp;quot;English (United States)&amp;quot; or &amp;quot;ar&amp;quot; for &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
*'''name :''' The name of the language ''(eg. &amp;quot;English (United States)&amp;quot; or &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs simple ''Welcome'' message at the resource start (also when player joins the game if the resource is already running).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local msg = {cs = &amp;quot;Vítejte&amp;quot;, fr = &amp;quot;Accueil&amp;quot;, de = &amp;quot;Willkommen&amp;quot;, pl = &amp;quot;Powitanie&amp;quot;, hu = &amp;quot;Üdv&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, &lt;br /&gt;
	function ()&lt;br /&gt;
		local languageCode = getLocalization()[&amp;quot;code&amp;quot;]&lt;br /&gt;
		if msg[languageCode] then --Check if the message is avaible in client's language&lt;br /&gt;
			outputChatBox(msg[languageCode] .. &amp;quot;!&amp;quot;) --Output it&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome!&amp;quot;) --Output English for any other language&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a list of all the language codes used in MTA in a table with the full name of the language.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
langTable = {&lt;br /&gt;
	[&amp;quot;ar_SA&amp;quot;] = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
	[&amp;quot;az_AZ&amp;quot;] = &amp;quot;Azerbaijani&amp;quot;,&lt;br /&gt;
	[&amp;quot;bg_BG&amp;quot;] = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;bs_BA&amp;quot;] = &amp;quot;Bosnian&amp;quot;,&lt;br /&gt;
	[&amp;quot;cs_CZ&amp;quot;] = &amp;quot;Czech&amp;quot;,&lt;br /&gt;
	[&amp;quot;da_DK&amp;quot;] = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
	[&amp;quot;de_DE&amp;quot;] = &amp;quot;German&amp;quot;,&lt;br /&gt;
	[&amp;quot;en_US&amp;quot;] = &amp;quot;English&amp;quot;,&lt;br /&gt;
	[&amp;quot;el_GR&amp;quot;] = &amp;quot;Greek&amp;quot;,&lt;br /&gt;
	[&amp;quot;es_ES&amp;quot;] = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
	[&amp;quot;et_EE&amp;quot;] = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fa_IR&amp;quot;] = &amp;quot;Persian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fi_FI&amp;quot;] = &amp;quot;Finnish&amp;quot;,&lt;br /&gt;
	[&amp;quot;fil_PH&amp;quot;] = &amp;quot;Filipino&amp;quot;,&lt;br /&gt;
	[&amp;quot;fr_FR&amp;quot;] = &amp;quot;French&amp;quot;,&lt;br /&gt;
	[&amp;quot;he_IL&amp;quot;] = &amp;quot;Hebrew&amp;quot;,&lt;br /&gt;
	[&amp;quot;hi_IN&amp;quot;] = &amp;quot;Hindi&amp;quot;,&lt;br /&gt;
	[&amp;quot;hr_HR&amp;quot;] = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
	[&amp;quot;hu_HU&amp;quot;] = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;id_ID&amp;quot;] = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
	[&amp;quot;it_IT&amp;quot;] = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ja_JP&amp;quot;] = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
	[&amp;quot;ka_GE&amp;quot;] = &amp;quot;Georgian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ko_KR&amp;quot;] = &amp;quot;Korean&amp;quot;,&lt;br /&gt;
	[&amp;quot;lt_LT&amp;quot;] = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;lv_LV&amp;quot;] = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
	[&amp;quot;mk_MK&amp;quot;] = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nb_NO&amp;quot;] = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nl_NL&amp;quot;] = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_BR&amp;quot;] = &amp;quot;Portuguese, Brazilian&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_PT&amp;quot;] = &amp;quot;Portuguese&amp;quot;,&lt;br /&gt;
	[&amp;quot;pl_PL&amp;quot;] = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
	[&amp;quot;ru_RU&amp;quot;] = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ro_RO&amp;quot;] = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl_SL&amp;quot;] = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sv_SE&amp;quot;] = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
	[&amp;quot;sk_SK&amp;quot;] = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
	[&amp;quot;srp&amp;quot;] = &amp;quot;Serbian&amp;quot;,&lt;br /&gt;
	[&amp;quot;tr_TR&amp;quot;] = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
	[&amp;quot;uk_UA&amp;quot;] = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
	[&amp;quot;vi_VN&amp;quot;] = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_CN&amp;quot;] = &amp;quot;Chinese Simplified&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_TW&amp;quot;] = &amp;quot;Chinese Traditional&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- Or... just update the scripts? Why complicate everything? --&amp;gt;&lt;br /&gt;
This function is useful for fixing any scripts that were made before MTA 1.6 as some of the language codes were changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function getLanguageCode(c)&lt;br /&gt;
	if (c == &amp;quot;fr_FR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;fr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ru_RU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ru&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pt_PT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pt_BR&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pl_PL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;tr_TR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;tr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;es_ES&amp;quot;) then&lt;br /&gt;
		return &amp;quot;es&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;de_DE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;de&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;vi_VN&amp;quot;) then&lt;br /&gt;
		return &amp;quot;vi&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ar_SA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ar&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;bg_BG&amp;quot;) then&lt;br /&gt;
		return &amp;quot;bg&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hu_HU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hu&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ro_RO&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ro&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sv_SE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sv&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hr_HR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;uk_UA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;uk&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sl_SL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sl&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
code = getLanguageCode(getLocalization().code)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_utility_functions}}&lt;br /&gt;
[[ru:GetLocalization]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77143</id>
		<title>GetLocalization</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77143"/>
		<updated>2023-07-03T12:51:43Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
This function gets the player's localization setting as set in the MTA client.&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 getLocalization ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with the following entries:&lt;br /&gt;
*'''code :''' The language code ''(eg. &amp;quot;en_US&amp;quot; for &amp;quot;English (United States)&amp;quot; or &amp;quot;ar&amp;quot; for &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
*'''name :''' The name of the language ''(eg. &amp;quot;English (United States)&amp;quot; or &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs simple ''Welcome'' message at the resource start (also when player joins the game if the resource is already running).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local msg = {cs = &amp;quot;Vítejte&amp;quot;, fr = &amp;quot;Accueil&amp;quot;, de = &amp;quot;Willkommen&amp;quot;, pl = &amp;quot;Powitanie&amp;quot;, hu = &amp;quot;Üdv&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, &lt;br /&gt;
	function ()&lt;br /&gt;
		local languageCode = getLocalization()[&amp;quot;code&amp;quot;]&lt;br /&gt;
		if msg[languageCode] then --Check if the message is avaible in client's language&lt;br /&gt;
			outputChatBox(msg[languageCode] .. &amp;quot;!&amp;quot;) --Output it&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome!&amp;quot;) --Output English for any other language&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a list of all the language codes used in MTA in a table with the full name of the language.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
langTable = {&lt;br /&gt;
	[&amp;quot;ar_SA&amp;quot;] = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
	[&amp;quot;az_AZ&amp;quot;] = &amp;quot;Azerbaijani&amp;quot;,&lt;br /&gt;
	[&amp;quot;bg_BG&amp;quot;] = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;bs_BA&amp;quot;] = &amp;quot;Bosnian&amp;quot;,&lt;br /&gt;
	[&amp;quot;cs_CZ&amp;quot;] = &amp;quot;Czech&amp;quot;,&lt;br /&gt;
	[&amp;quot;da_DK&amp;quot;] = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
	[&amp;quot;de_DE&amp;quot;] = &amp;quot;German&amp;quot;,&lt;br /&gt;
	[&amp;quot;en_US&amp;quot;] = &amp;quot;English&amp;quot;,&lt;br /&gt;
	[&amp;quot;el_GR&amp;quot;] = &amp;quot;Greek&amp;quot;,&lt;br /&gt;
	[&amp;quot;es_ES&amp;quot;] = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
	[&amp;quot;et_EE&amp;quot;] = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fa_IR&amp;quot;] = &amp;quot;Persian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fi_FI&amp;quot;] = &amp;quot;Finnish&amp;quot;,&lt;br /&gt;
	[&amp;quot;fil_PH&amp;quot;] = &amp;quot;Filipino&amp;quot;,&lt;br /&gt;
	[&amp;quot;fr_FR&amp;quot;] = &amp;quot;French&amp;quot;,&lt;br /&gt;
	[&amp;quot;he_IL&amp;quot;] = &amp;quot;Hebrew&amp;quot;,&lt;br /&gt;
	[&amp;quot;hi_IN&amp;quot;] = &amp;quot;Hindi&amp;quot;,&lt;br /&gt;
	[&amp;quot;hr_HR&amp;quot;] = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
	[&amp;quot;hu_HU&amp;quot;] = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;id_ID&amp;quot;] = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
	[&amp;quot;it_IT&amp;quot;] = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ja_JP&amp;quot;] = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
	[&amp;quot;ka_GE&amp;quot;] = &amp;quot;Georgian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ko_KR&amp;quot;] = &amp;quot;Korean&amp;quot;,&lt;br /&gt;
	[&amp;quot;lt_LT&amp;quot;] = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;lv_LV&amp;quot;] = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
	[&amp;quot;mk_MK&amp;quot;] = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nb_NO&amp;quot;] = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nl_NL&amp;quot;] = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_BR&amp;quot;] = &amp;quot;Portuguese, Brazilian&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_PT&amp;quot;] = &amp;quot;Portuguese&amp;quot;,&lt;br /&gt;
	[&amp;quot;pl_PL&amp;quot;] = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
	[&amp;quot;ru_RU&amp;quot;] = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ro_RO&amp;quot;] = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl_SL&amp;quot;] = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sv_SE&amp;quot;] = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
	[&amp;quot;sk_SK&amp;quot;] = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
	[&amp;quot;srp&amp;quot;] = &amp;quot;Serbian&amp;quot;,&lt;br /&gt;
	[&amp;quot;tr_TR&amp;quot;] = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
	[&amp;quot;uk_UA&amp;quot;] = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
	[&amp;quot;vi_VN&amp;quot;] = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_CN&amp;quot;] = &amp;quot;Chinese Simplified&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_TW&amp;quot;] = &amp;quot;Chinese Traditional&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- Or... just update the scripts? Why complicate everything? --&amp;gt;&lt;br /&gt;
This function is useful for fixing any scripts that were made before MTA 1.6 as some of the language codes were changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function getLanguageCode(c)&lt;br /&gt;
	if (c == &amp;quot;fr_FR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;fr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ru_RU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ru&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pt_PT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pt_BR&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pl_PL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;tr_TR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;tr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;es_ES&amp;quot;) then&lt;br /&gt;
		return &amp;quot;es&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;de_DE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;de&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;vi_VN&amp;quot;) then&lt;br /&gt;
		return &amp;quot;vi&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ar_SA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ar&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;bg_BG&amp;quot;) then&lt;br /&gt;
		return &amp;quot;bg&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hu_HU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hu&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ro_RO&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ro&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sv_SE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sv&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hr_HR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;uk_UA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;uk&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
code = getLanguageCode(getLocalization().code)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_utility_functions}}&lt;br /&gt;
[[ru:GetLocalization]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77142</id>
		<title>GetLocalization</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77142"/>
		<updated>2023-07-03T12:51:16Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
This function gets the player's localization setting as set in the MTA client.&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 getLocalization ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with the following entries:&lt;br /&gt;
*'''code :''' The language code ''(eg. &amp;quot;en_US&amp;quot; for &amp;quot;English (United States)&amp;quot; or &amp;quot;ar&amp;quot; for &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
*'''name :''' The name of the language ''(eg. &amp;quot;English (United States)&amp;quot; or &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs simple ''Welcome'' message at the resource start (also when player joins the game if the resource is already running).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local msg = {cs = &amp;quot;Vítejte&amp;quot;, fr = &amp;quot;Accueil&amp;quot;, de = &amp;quot;Willkommen&amp;quot;, pl = &amp;quot;Powitanie&amp;quot;, hu = &amp;quot;Üdv&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, &lt;br /&gt;
	function ()&lt;br /&gt;
		local languageCode = getLocalization()[&amp;quot;code&amp;quot;]&lt;br /&gt;
		if msg[languageCode] then --Check if the message is avaible in client's language&lt;br /&gt;
			outputChatBox(msg[languageCode] .. &amp;quot;!&amp;quot;) --Output it&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome!&amp;quot;) --Output English for any other language&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a list of all the language codes used in MTA in a table with the full name of the language.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
langTable = {&lt;br /&gt;
	[&amp;quot;ar_SA&amp;quot;] = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
	[&amp;quot;az_AZ&amp;quot;] = &amp;quot;Azerbaijani&amp;quot;,&lt;br /&gt;
	[&amp;quot;bg_BG&amp;quot;] = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;bs_BA&amp;quot;] = &amp;quot;Bosnian&amp;quot;,&lt;br /&gt;
	[&amp;quot;cs_CZ= &amp;quot;Czech&amp;quot;,&lt;br /&gt;
	[&amp;quot;da_DK&amp;quot;] = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
	[&amp;quot;de_DE&amp;quot;] = &amp;quot;German&amp;quot;,&lt;br /&gt;
	[&amp;quot;en_US&amp;quot;] = &amp;quot;English&amp;quot;,&lt;br /&gt;
	[&amp;quot;el_GR&amp;quot;] = &amp;quot;Greek&amp;quot;,&lt;br /&gt;
	[&amp;quot;es_ES&amp;quot;] = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
	[&amp;quot;et_EE&amp;quot;] = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fa_IR&amp;quot;] = &amp;quot;Persian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fi_FI&amp;quot;] = &amp;quot;Finnish&amp;quot;,&lt;br /&gt;
	[&amp;quot;fil_PH&amp;quot;] = &amp;quot;Filipino&amp;quot;,&lt;br /&gt;
	[&amp;quot;fr_FR&amp;quot;] = &amp;quot;French&amp;quot;,&lt;br /&gt;
	[&amp;quot;he_IL&amp;quot;] = &amp;quot;Hebrew&amp;quot;,&lt;br /&gt;
	[&amp;quot;hi_IN&amp;quot;] = &amp;quot;Hindi&amp;quot;,&lt;br /&gt;
	[&amp;quot;hr_HR&amp;quot;] = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
	[&amp;quot;hu_HU&amp;quot;] = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;id_ID&amp;quot;] = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
	[&amp;quot;it_IT&amp;quot;] = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ja_JP&amp;quot;] = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
	[&amp;quot;ka_GE&amp;quot;] = &amp;quot;Georgian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ko_KR&amp;quot;] = &amp;quot;Korean&amp;quot;,&lt;br /&gt;
	[&amp;quot;lt_LT&amp;quot;] = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;lv_LV&amp;quot;] = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
	[&amp;quot;mk_MK&amp;quot;] = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nb_NO&amp;quot;] = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nl_NL&amp;quot;] = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_BR&amp;quot;] = &amp;quot;Portuguese, Brazilian&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_PT&amp;quot;] = &amp;quot;Portuguese&amp;quot;,&lt;br /&gt;
	[&amp;quot;pl_PL&amp;quot;] = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
	[&amp;quot;ru_RU&amp;quot;] = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ro_RO&amp;quot;] = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl_SL&amp;quot;] = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sv_SE&amp;quot;] = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
	[&amp;quot;sk_SK&amp;quot;] = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
	[&amp;quot;srp&amp;quot;] = &amp;quot;Serbian&amp;quot;,&lt;br /&gt;
	[&amp;quot;tr_TR&amp;quot;] = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
	[&amp;quot;uk_UA&amp;quot;] = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
	[&amp;quot;vi_VN&amp;quot;] = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_CN&amp;quot;] = &amp;quot;Chinese Simplified&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_TW&amp;quot;] = &amp;quot;Chinese Traditional&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- Or... just update the scripts? Why complicate everything? --&amp;gt;&lt;br /&gt;
This function is useful for fixing any scripts that were made before MTA 1.6 as some of the language codes were changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function getLanguageCode(c)&lt;br /&gt;
	if (c == &amp;quot;fr_FR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;fr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ru_RU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ru&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pt_PT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pt_BR&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pl_PL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;tr_TR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;tr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;es_ES&amp;quot;) then&lt;br /&gt;
		return &amp;quot;es&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;de_DE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;de&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;vi_VN&amp;quot;) then&lt;br /&gt;
		return &amp;quot;vi&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ar_SA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ar&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;bg_BG&amp;quot;) then&lt;br /&gt;
		return &amp;quot;bg&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hu_HU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hu&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ro_RO&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ro&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sv_SE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sv&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hr_HR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;uk_UA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;uk&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
code = getLanguageCode(getLocalization().code)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_utility_functions}}&lt;br /&gt;
[[ru:GetLocalization]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77120</id>
		<title>GetLocalization</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77120"/>
		<updated>2023-06-26T19:44:23Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
This function gets the player's localization setting as set in the MTA client.&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 getLocalization ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with the following entries:&lt;br /&gt;
*'''code :''' The language code ''(eg. &amp;quot;en_US&amp;quot; for &amp;quot;English (United States)&amp;quot; or &amp;quot;ar&amp;quot; for &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
*'''name :''' The name of the language ''(eg. &amp;quot;English (United States)&amp;quot; or &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs simple ''Welcome'' message at the resource start (also when player joins the game if the resource is already running).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local msg = {cs = &amp;quot;Vítejte&amp;quot;, fr = &amp;quot;Accueil&amp;quot;, de = &amp;quot;Willkommen&amp;quot;, pl = &amp;quot;Powitanie&amp;quot;, hu = &amp;quot;Üdv&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, &lt;br /&gt;
	function ()&lt;br /&gt;
		local languageCode = getLocalization()[&amp;quot;code&amp;quot;]&lt;br /&gt;
		if msg[languageCode] then --Check if the message is avaible in client's language&lt;br /&gt;
			outputChatBox(msg[languageCode] .. &amp;quot;!&amp;quot;) --Output it&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome!&amp;quot;) --Output English for any other language&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a list of all (probably all) the language codes used in MTA in a table with the full name of the language. Note that when MTA 1.6 was released some of these have changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
langTable = {&lt;br /&gt;
	[&amp;quot;ar&amp;quot;] = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
	[&amp;quot;bg&amp;quot;] = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;cs&amp;quot;] = &amp;quot;Czech&amp;quot;,&lt;br /&gt;
	[&amp;quot;da&amp;quot;] = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
	[&amp;quot;de&amp;quot;] = &amp;quot;German&amp;quot;,&lt;br /&gt;
	[&amp;quot;en_US&amp;quot;] = &amp;quot;English&amp;quot;,&lt;br /&gt;
	[&amp;quot;el&amp;quot;] = &amp;quot;Greek&amp;quot;,&lt;br /&gt;
	[&amp;quot;es&amp;quot;] = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
	[&amp;quot;et&amp;quot;] = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fr&amp;quot;] = &amp;quot;French&amp;quot;,&lt;br /&gt;
	[&amp;quot;hr&amp;quot;] = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
	[&amp;quot;hu&amp;quot;] = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;id&amp;quot;] = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
	[&amp;quot;it&amp;quot;] = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ja&amp;quot;] = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
	[&amp;quot;lt&amp;quot;] = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;lv&amp;quot;] = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
	[&amp;quot;mk&amp;quot;] = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nb&amp;quot;] = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nl&amp;quot;] = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_BR&amp;quot;] = &amp;quot;Brazilian&amp;quot;,&lt;br /&gt;
	[&amp;quot;pl&amp;quot;] = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
	[&amp;quot;ru&amp;quot;] = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ro&amp;quot;] = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sv&amp;quot;] = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
	[&amp;quot;sk&amp;quot;] = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
	[&amp;quot;tr&amp;quot;] = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
	[&amp;quot;uk&amp;quot;] = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
	[&amp;quot;vi&amp;quot;] = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_CN&amp;quot;] = &amp;quot;Chinese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_TW&amp;quot;] = &amp;quot;Taiwanese&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This function is useful for fixing any scripts that were made before MTA 1.6 as some of the language codes were changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function getLanguageCode(c)&lt;br /&gt;
	if (c == &amp;quot;fr_FR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;fr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ru_RU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ru&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pt_PT&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pt_BR&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;pl_PL&amp;quot;) then&lt;br /&gt;
		return &amp;quot;pl&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;tr_TR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;tr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;es_ES&amp;quot;) then&lt;br /&gt;
		return &amp;quot;es&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;de_DE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;de&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;vi_VN&amp;quot;) then&lt;br /&gt;
		return &amp;quot;vi&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ar_SA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ar&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;bg_BG&amp;quot;) then&lt;br /&gt;
		return &amp;quot;bg&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hu_HU&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hu&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;ro_RO&amp;quot;) then&lt;br /&gt;
		return &amp;quot;ro&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;sv_SE&amp;quot;) then&lt;br /&gt;
		return &amp;quot;sv&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;hr_HR&amp;quot;) then&lt;br /&gt;
		return &amp;quot;hr&amp;quot;&lt;br /&gt;
	elseif (c == &amp;quot;uk_UA&amp;quot;) then&lt;br /&gt;
		return &amp;quot;uk&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
code = getLanguageCode(getLocalization().code)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_utility_functions}}&lt;br /&gt;
[[ru:GetLocalization]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77119</id>
		<title>GetLocalization</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetLocalization&amp;diff=77119"/>
		<updated>2023-06-26T19:26:25Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.4|&lt;br /&gt;
This function gets the player's localization setting as set in the MTA client.&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 getLocalization ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with the following entries:&lt;br /&gt;
*'''code :''' The language code ''(eg. &amp;quot;en_US&amp;quot; for &amp;quot;English (United States)&amp;quot; or &amp;quot;ar&amp;quot; for &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
*'''name :''' The name of the language ''(eg. &amp;quot;English (United States)&amp;quot; or &amp;quot;Arabic&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs simple ''Welcome'' message at the resource start (also when player joins the game if the resource is already running).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local msg = {cs = &amp;quot;Vítejte&amp;quot;, fr = &amp;quot;Accueil&amp;quot;, de = &amp;quot;Willkommen&amp;quot;, pl = &amp;quot;Powitanie&amp;quot;, hu = &amp;quot;Üdv&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, &lt;br /&gt;
	function ()&lt;br /&gt;
		local languageCode = getLocalization()[&amp;quot;code&amp;quot;]&lt;br /&gt;
		if msg[languageCode] then --Check if the message is avaible in client's language&lt;br /&gt;
			outputChatBox(msg[languageCode] .. &amp;quot;!&amp;quot;) --Output it&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome!&amp;quot;) --Output English for any other language&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a list of all (probably all) the language codes used in MTA in a table with the full name of the language. Note that when MTA 1.6 was released some of these have changed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
langTable = {&lt;br /&gt;
	[&amp;quot;ar&amp;quot;] = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
	[&amp;quot;bg&amp;quot;] = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;cs&amp;quot;] = &amp;quot;Czech&amp;quot;,&lt;br /&gt;
	[&amp;quot;da&amp;quot;] = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
	[&amp;quot;de&amp;quot;] = &amp;quot;German&amp;quot;,&lt;br /&gt;
	[&amp;quot;en_US&amp;quot;] = &amp;quot;English&amp;quot;,&lt;br /&gt;
	[&amp;quot;el&amp;quot;] = &amp;quot;Greek&amp;quot;,&lt;br /&gt;
	[&amp;quot;es&amp;quot;] = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
	[&amp;quot;et&amp;quot;] = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;fr&amp;quot;] = &amp;quot;French&amp;quot;,&lt;br /&gt;
	[&amp;quot;hr&amp;quot;] = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
	[&amp;quot;hu&amp;quot;] = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
	[&amp;quot;id&amp;quot;] = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
	[&amp;quot;it&amp;quot;] = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ja&amp;quot;] = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
	[&amp;quot;lt&amp;quot;] = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;lv&amp;quot;] = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
	[&amp;quot;mk&amp;quot;] = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nb&amp;quot;] = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
	[&amp;quot;nl&amp;quot;] = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
	[&amp;quot;pt_BR&amp;quot;] = &amp;quot;Brazilian&amp;quot;,&lt;br /&gt;
	[&amp;quot;pl&amp;quot;] = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
	[&amp;quot;ru&amp;quot;] = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
	[&amp;quot;ro&amp;quot;] = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
	[&amp;quot;sv&amp;quot;] = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
	[&amp;quot;sk&amp;quot;] = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
	[&amp;quot;tr&amp;quot;] = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
	[&amp;quot;uk&amp;quot;] = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
	[&amp;quot;vi&amp;quot;] = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_CN&amp;quot;] = &amp;quot;Chinese&amp;quot;,&lt;br /&gt;
	[&amp;quot;zh_TW&amp;quot;] = &amp;quot;Taiwanese&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_utility_functions}}&lt;br /&gt;
[[ru:GetLocalization]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=75635</id>
		<title>Scripting Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Tips&amp;diff=75635"/>
		<updated>2022-10-31T17:22:08Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a variety of things that knowing, make life easier for MTA scripters.&lt;br /&gt;
&lt;br /&gt;
== General Lua ==&lt;br /&gt;
* The ''infinite loop / too long execution error'' which aborts execution can be disabled with ''debug.sethook(nil)''&lt;br /&gt;
* Be careful when looping a table where you intend to delete multiple rows, if 2 of them are in a row the 2nd one will get skipped! You must loop the table backwards (reverse ipairs). For example: ''for i = #table, 1, -1 do''&lt;br /&gt;
* Rather than having if checks inside if checks inside if checks, consider using ''return'' for example ''if (not ready) then return false end''&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting ==&lt;br /&gt;
* Remember that 'false' boolean has a value - If you want to delete a variable or element/account data, use 'nil' instead - this will reduce memory and disk usage (minuscule optimization, only notable on larger servers)&lt;br /&gt;
* Remember that 99% of the time it's a bug in your script, not an MTA bug! Don't report something to GitHub Issues until you're absolutely certain the bug can be reproduced with a small piece of script.&lt;br /&gt;
* As MTA already has so many functions and events virtually everything you want to do is already possible, as long as you're willing to do the work! You'll find better solutions to problems as there are many ways to achieve the same thing as long as you know all the functions and events.&lt;br /&gt;
* If a script is getting too complicated, try putting back-end stuff in another file so the main script calls the functions in the 2nd one. For example rather than having meaningless things like ''vehicleTable[vehicle][7]'' in the main file, put that in a function in the 2nd file and have the main file call a meaningfully named function so rather than seeing a useless ''7'' you'd see something like ''getFuel'' and although this might take longer to set-up you'll save time in the long run as you'll spend less time being confused when you come back to it in a weeks time to debug a problem.&lt;br /&gt;
* Your client side scripts can cause desync if you're not careful, try to keep the psychical world equal with every player. For example if your script creates a client side object make sure your script will create it for everyone nearby, else people will be wondering why a player appears to be constantly floating and falling.&lt;br /&gt;
* Instead of using ''onClientResourceStart'' or ''onResourceStart'' events attached to ''resourceRoot'' like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function warnPeopleThatThisResourceStarted()&lt;br /&gt;
    outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, warnPeopleThatThisResourceStarted)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also use this outside of any function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;The resource &amp;quot; .. getResourceName(resource) .. &amp;quot; has just started!&amp;quot;, 0, 255, 0)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And the result will be the same, because Lua executes every instruction in every script file of a resource when it starts.&lt;br /&gt;
* string.dump produces unsigned compiled Lua code which is not allowed for security reasons. The only way to transport code now is by using the source code. e.g.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exampleFunction = [===[&lt;br /&gt;
    return param&lt;br /&gt;
]===]&lt;br /&gt;
&lt;br /&gt;
local loadedFunction = loadstring(exampleFunction)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== MTA Scripting - Element IDs Being Reused ==&lt;br /&gt;
* If your script is covered in [[isTimer]] and [[isElement]] checks to hide debug warnings from deleted elements not being dereferenced (making the variable nil) you will regret it when that element ID or timer pointer has to be re-used by MTA in a weeks time and your script starts acting strangely and you won't have a clue why. Dereference destroyed elements and disconnected players!&lt;br /&gt;
* Why would MTA reuse it in a weeks time? Everything has a userdata value whether it's a function or an element, there is a limited amount of these available meaning that eventually the server will be forced to use the same userdata value twice, as long as whatever that userdata value was for is no longer valid. This could happen within hours, weeks or even never depending on how many elements are being created and destroyed by your scripts.&lt;br /&gt;
* For example if you have a race server that has 100 objects in every map and the map was changing every 5 minutes your server would go through at least 1200 an hour, 28,800 a day, 201,600 a week in userdata values, it can't keep going up and up though eventually it will have to reuse the same userdata values and as long as you're dereferencing in your scripts, it won't be a problem.&lt;br /&gt;
&lt;br /&gt;
The is an example of a script which fails to dereference, because when the player quits their userdata value remains in the table, but what if in a weeks time another player joins and they get assigned the same userdata value?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local admins = {}&lt;br /&gt;
local secretPasswordOnlyAdminsShouldKnow = &amp;quot;12345678&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function adminLogin()&lt;br /&gt;
    if (hasObjectPermissionTo(source, &amp;quot;command.ban&amp;quot;, false)) then&lt;br /&gt;
        admins[source] = true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root, adminLogin)&lt;br /&gt;
&lt;br /&gt;
function cmdGetSecretPassword(plr)&lt;br /&gt;
    if (not admins[plr]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    outputChatBox(&amp;quot;The secret password is &amp;quot;..secretPasswordOnlyAdminsShouldKnow, plr)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;getsecretpass&amp;quot;, cmdGetSecretPassword)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some random player who joins in a weeks time gets the same userdata value as an admin, that player can now use &amp;quot;getsecretpass&amp;quot;. Solution? De-reference on destruction!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function onQuit()&lt;br /&gt;
    admins[source] = nil&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, onQuit)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Server Performance ==&lt;br /&gt;
* Server lagging? Check [[Debugging#Debugging_Performance_Issues|this page of debugging performance issues]]&lt;br /&gt;
* Using resourceRoot in event handlers for events from clients is much more efficient than using root.&lt;br /&gt;
* Try to be efficient, but if what you're doing is too time consuming or complex, is it really efficient?&lt;br /&gt;
* It's much more efficient to [[SetElementHealth]] and [[setElementRotation]] on a player client side, consider a client event all your server scripts can call to set a players health.&lt;br /&gt;
* Unless you have hundreds of players, don't worry about making little optimizations, check ''performancebrowser'' or ''ipb'' (ingame performancebrowser) and make sure no resource is using significantly more than the others.&lt;br /&gt;
&lt;br /&gt;
== Client Performance ==&lt;br /&gt;
* The biggest cause of client script CPU usage is anything done in onClient/Pre/Hud/Render because it is called so often. For example if you have a script which calls dxDrawLine3D 20 times, 60 times a second, if those lines are only in 1 part of the map, consider adding a [[getDistanceBetweenPoints3D]] check between the local player and the general area that those lines are in and if they're no where near the player, don't draw the lines.&lt;br /&gt;
* Another thing that gets called a lot and could therefore be quite consuming if not careful are events like [[onClientPlayerWeaponFire]] and [[onClientPlayerDamage]] so any scripts that use these should only be bound to the necessary elements (such as localPlayer instead of root) and run the simplest if statements for example if you wanted to handle a certain weapon being fired in a certain dimension it's better to check weapon first as that's a simple weaponID == x rather than getElementDimension(source) == y.&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between local and global variables ==&lt;br /&gt;
&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   a = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;global&amp;quot;, stop - start ) -- more than 500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
local b = 1&lt;br /&gt;
for i=1,10000000 do&lt;br /&gt;
   b = 1&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;local&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Speed comparison between structural and OOP scripting ==&lt;br /&gt;
=== Slower ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
a = 1&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   a = localPlayer.position&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;variable&amp;quot;, stop - start ) -- more than 1500ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
start = getTickCount()&lt;br /&gt;
b = nil&lt;br /&gt;
for i=1,1000000 do&lt;br /&gt;
   b = getElementPosition(localPlayer)&lt;br /&gt;
end&lt;br /&gt;
stop = getTickCount()&lt;br /&gt;
print(&amp;quot;structural&amp;quot;, stop - start ) -- less than 200ms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=73027</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=73027"/>
		<updated>2021-11-15T16:42:12Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Updated again, should be right now, will ask a dev about it.&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 3 items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''MSVC v142 - VS 2019 C++ x64/x86 build tools''&lt;br /&gt;
## In the 'Individual Components' tab search 'MFC v142' and select 'C++ v14.29 (16.11) MFC for 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 Microsoft DirectX SDK (August 2009) (DXSDK_Aug09.exe):'''&lt;br /&gt;
* [https://archive.org/download/dxsdk_aug09/DXSDK_Aug09.exe Mirror 1]&lt;br /&gt;
* [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe Mirror 2]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-top: 0px; width: 70%; word-break: break-all;&amp;quot;&lt;br /&gt;
|+ File verification&lt;br /&gt;
|- style=&amp;quot;vertical-align:bottom;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Algorithm and variant&lt;br /&gt;
! Hash&lt;br /&gt;
! Hash file&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | '''{{nowrap|SHA-3}}''' || ''SHA3-224'' || 8bfcdc03518d7edd34689534fd4d21291469ff2f2eb10437ad648c58 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-224 DXSDK_Aug09.exe.sha3-224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-256'' || 45bf3e08da3b3636ddb4f4a74243430f8d65759c074c0d79756ef810c4701c5a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256 DXSDK_Aug09.exe.sha3-256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-384'' || b358e529963d6f5fd7f8bd4b530fb18f6a2e6a442009a54e981b2f9967589ed48150af310f283640d56f9b60d41100c9 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-384 DXSDK_Aug09.exe.sha3-384]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-512'' || 43522187053af744250059ef69c0f3083cecd1157fe56daac16b9497ebc6fb5b525875144e42898367c55f757cffd3526f37074d544470578602a5a944a45a75 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-512 DXSDK_Aug09.exe.sha3-512]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHAKE128'' || 2a7c81bde9e867cbb5ef00b72ad8de66a3ee64c1d59f16465fa712479b6a84d28a02cc5ed08afa1d51e72011657453dbd4656cc9340d32e18179c39d03982dfc35c8f0c2a5c99e11dc74d0e23ed21b1e55f19c809a5a152bde39a2d46fcd12421f373f2d691ade1b57faf6c2ab7aded5a7d174f1f1c77127c0d6a1523b4775c569c5e1b4efa2da4bf2f708a96707a709e245a7f507382e69a81777919c90e95a091c0b699ce7f517 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-128000 DXSDK_Aug09.exe.sha3-128000]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHAKE256'' || 9c100dac5245a61774f3a2752bf9e941bdcd5654b18035155161c63b20936dfc9bd7334feb9a6fe9a99a65491161083b39ac3bd578e2cf4f90cba3c786e9924fa0611f65a725331b77b63e7c8b552e1637bc77531ba0f2c9cac72115b28e523929ede4e5b246a0755e8d5c4089d94bf16627fb08672cfffa523bba3d976489a0eec60d3c6a96ca2b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256000 DXSDK_Aug09.exe.sha3-256000]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | '''{{nowrap|SHA-2}}''' || ''SHA-224'' || a3a74b89cccfe314b79418d5598aac5e94800221e5d945c74f15c004 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-224 DXSDK_Aug09.exe.sha2-224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-256'' || 4ab1de69312f10f6b41310a5218d80c478bbd823bc0f86627318d690b128fb9f || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-256 DXSDK_Aug09.exe.sha2-256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-384'' || 254ed29c6ad2cadc6f013d2d51c0ac78a6bbe236a2c94ca99610eba8b2c1200d1a62c445ca9ee51bb09354875d5eca8a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-384 DXSDK_Aug09.exe.sha2-384]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512'' || style=&amp;quot;width: 60%;&amp;quot; | 736393c0dfa32221e229890f87eb330174d70dd2a02fa0cace303816d3e7a10a332a44129748de39665d1b339e627d6028c2080268f7afdd5240c447fec8ff0b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512 DXSDK_Aug09.exe.sha2-512]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512/224'' || 7e23d9ba916000782a17e23abf48e25237f45590cfe767aed9d79f10 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512224 DXSDK_Aug09.exe.sha2-512224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512/256'' || 0c833a56046fe7e4213fcb1862c730acf313d1b8f60b51eebf64dc3e79730c1c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512256 DXSDK_Aug09.exe.sha2-512256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''MD5''' || 66e5379ecf46b014688779621bcc677c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.md5 DXSDK_Aug09.exe.md5]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''{{nowrap|SHA-1}}''' || 5b9b969ed7b6cf5534bb7350e44c09b3573b0e71 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha1 DXSDK_Aug09.exe.sha1]&lt;br /&gt;
|}&lt;br /&gt;
CRC32 e9f5c61d ([https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sfv DXSDK_Aug09.exe.sfv])&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;
== ERROR: Loading network library (net_d.dll) failed! ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[en:Compiling MTASA]]&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>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=73026</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=73026"/>
		<updated>2021-11-15T16:00:10Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added an error solution&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 v143 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
## ''MSVC v142 - VS 2019 C++ x64/x86 build tools''&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 Microsoft DirectX SDK (August 2009) (DXSDK_Aug09.exe):'''&lt;br /&gt;
* [https://archive.org/download/dxsdk_aug09/DXSDK_Aug09.exe Mirror 1]&lt;br /&gt;
* [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe Mirror 2]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-top: 0px; width: 70%; word-break: break-all;&amp;quot;&lt;br /&gt;
|+ File verification&lt;br /&gt;
|- style=&amp;quot;vertical-align:bottom;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Algorithm and variant&lt;br /&gt;
! Hash&lt;br /&gt;
! Hash file&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | '''{{nowrap|SHA-3}}''' || ''SHA3-224'' || 8bfcdc03518d7edd34689534fd4d21291469ff2f2eb10437ad648c58 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-224 DXSDK_Aug09.exe.sha3-224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-256'' || 45bf3e08da3b3636ddb4f4a74243430f8d65759c074c0d79756ef810c4701c5a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256 DXSDK_Aug09.exe.sha3-256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-384'' || b358e529963d6f5fd7f8bd4b530fb18f6a2e6a442009a54e981b2f9967589ed48150af310f283640d56f9b60d41100c9 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-384 DXSDK_Aug09.exe.sha3-384]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-512'' || 43522187053af744250059ef69c0f3083cecd1157fe56daac16b9497ebc6fb5b525875144e42898367c55f757cffd3526f37074d544470578602a5a944a45a75 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-512 DXSDK_Aug09.exe.sha3-512]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHAKE128'' || 2a7c81bde9e867cbb5ef00b72ad8de66a3ee64c1d59f16465fa712479b6a84d28a02cc5ed08afa1d51e72011657453dbd4656cc9340d32e18179c39d03982dfc35c8f0c2a5c99e11dc74d0e23ed21b1e55f19c809a5a152bde39a2d46fcd12421f373f2d691ade1b57faf6c2ab7aded5a7d174f1f1c77127c0d6a1523b4775c569c5e1b4efa2da4bf2f708a96707a709e245a7f507382e69a81777919c90e95a091c0b699ce7f517 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-128000 DXSDK_Aug09.exe.sha3-128000]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHAKE256'' || 9c100dac5245a61774f3a2752bf9e941bdcd5654b18035155161c63b20936dfc9bd7334feb9a6fe9a99a65491161083b39ac3bd578e2cf4f90cba3c786e9924fa0611f65a725331b77b63e7c8b552e1637bc77531ba0f2c9cac72115b28e523929ede4e5b246a0755e8d5c4089d94bf16627fb08672cfffa523bba3d976489a0eec60d3c6a96ca2b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256000 DXSDK_Aug09.exe.sha3-256000]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | '''{{nowrap|SHA-2}}''' || ''SHA-224'' || a3a74b89cccfe314b79418d5598aac5e94800221e5d945c74f15c004 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-224 DXSDK_Aug09.exe.sha2-224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-256'' || 4ab1de69312f10f6b41310a5218d80c478bbd823bc0f86627318d690b128fb9f || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-256 DXSDK_Aug09.exe.sha2-256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-384'' || 254ed29c6ad2cadc6f013d2d51c0ac78a6bbe236a2c94ca99610eba8b2c1200d1a62c445ca9ee51bb09354875d5eca8a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-384 DXSDK_Aug09.exe.sha2-384]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512'' || style=&amp;quot;width: 60%;&amp;quot; | 736393c0dfa32221e229890f87eb330174d70dd2a02fa0cace303816d3e7a10a332a44129748de39665d1b339e627d6028c2080268f7afdd5240c447fec8ff0b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512 DXSDK_Aug09.exe.sha2-512]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512/224'' || 7e23d9ba916000782a17e23abf48e25237f45590cfe767aed9d79f10 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512224 DXSDK_Aug09.exe.sha2-512224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512/256'' || 0c833a56046fe7e4213fcb1862c730acf313d1b8f60b51eebf64dc3e79730c1c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512256 DXSDK_Aug09.exe.sha2-512256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''MD5''' || 66e5379ecf46b014688779621bcc677c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.md5 DXSDK_Aug09.exe.md5]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''{{nowrap|SHA-1}}''' || 5b9b969ed7b6cf5534bb7350e44c09b3573b0e71 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha1 DXSDK_Aug09.exe.sha1]&lt;br /&gt;
|}&lt;br /&gt;
CRC32 e9f5c61d ([https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sfv DXSDK_Aug09.exe.sfv])&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;
== ERROR: Loading network library (net_d.dll) failed! ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[en:Compiling MTASA]]&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>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=73025</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=73025"/>
		<updated>2021-11-15T15:45:49Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Update based on changes to visual studio installer&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 v143 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
## ''MSVC v142 - VS 2019 C++ x64/x86 build tools''&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 Microsoft DirectX SDK (August 2009) (DXSDK_Aug09.exe):'''&lt;br /&gt;
* [https://archive.org/download/dxsdk_aug09/DXSDK_Aug09.exe Mirror 1]&lt;br /&gt;
* [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe Mirror 2]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-top: 0px; width: 70%; word-break: break-all;&amp;quot;&lt;br /&gt;
|+ File verification&lt;br /&gt;
|- style=&amp;quot;vertical-align:bottom;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Algorithm and variant&lt;br /&gt;
! Hash&lt;br /&gt;
! Hash file&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | '''{{nowrap|SHA-3}}''' || ''SHA3-224'' || 8bfcdc03518d7edd34689534fd4d21291469ff2f2eb10437ad648c58 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-224 DXSDK_Aug09.exe.sha3-224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-256'' || 45bf3e08da3b3636ddb4f4a74243430f8d65759c074c0d79756ef810c4701c5a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256 DXSDK_Aug09.exe.sha3-256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-384'' || b358e529963d6f5fd7f8bd4b530fb18f6a2e6a442009a54e981b2f9967589ed48150af310f283640d56f9b60d41100c9 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-384 DXSDK_Aug09.exe.sha3-384]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA3-512'' || 43522187053af744250059ef69c0f3083cecd1157fe56daac16b9497ebc6fb5b525875144e42898367c55f757cffd3526f37074d544470578602a5a944a45a75 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-512 DXSDK_Aug09.exe.sha3-512]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHAKE128'' || 2a7c81bde9e867cbb5ef00b72ad8de66a3ee64c1d59f16465fa712479b6a84d28a02cc5ed08afa1d51e72011657453dbd4656cc9340d32e18179c39d03982dfc35c8f0c2a5c99e11dc74d0e23ed21b1e55f19c809a5a152bde39a2d46fcd12421f373f2d691ade1b57faf6c2ab7aded5a7d174f1f1c77127c0d6a1523b4775c569c5e1b4efa2da4bf2f708a96707a709e245a7f507382e69a81777919c90e95a091c0b699ce7f517 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-128000 DXSDK_Aug09.exe.sha3-128000]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHAKE256'' || 9c100dac5245a61774f3a2752bf9e941bdcd5654b18035155161c63b20936dfc9bd7334feb9a6fe9a99a65491161083b39ac3bd578e2cf4f90cba3c786e9924fa0611f65a725331b77b63e7c8b552e1637bc77531ba0f2c9cac72115b28e523929ede4e5b246a0755e8d5c4089d94bf16627fb08672cfffa523bba3d976489a0eec60d3c6a96ca2b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256000 DXSDK_Aug09.exe.sha3-256000]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;6&amp;quot; | '''{{nowrap|SHA-2}}''' || ''SHA-224'' || a3a74b89cccfe314b79418d5598aac5e94800221e5d945c74f15c004 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-224 DXSDK_Aug09.exe.sha2-224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-256'' || 4ab1de69312f10f6b41310a5218d80c478bbd823bc0f86627318d690b128fb9f || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-256 DXSDK_Aug09.exe.sha2-256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-384'' || 254ed29c6ad2cadc6f013d2d51c0ac78a6bbe236a2c94ca99610eba8b2c1200d1a62c445ca9ee51bb09354875d5eca8a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-384 DXSDK_Aug09.exe.sha2-384]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512'' || style=&amp;quot;width: 60%;&amp;quot; | 736393c0dfa32221e229890f87eb330174d70dd2a02fa0cace303816d3e7a10a332a44129748de39665d1b339e627d6028c2080268f7afdd5240c447fec8ff0b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512 DXSDK_Aug09.exe.sha2-512]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512/224'' || 7e23d9ba916000782a17e23abf48e25237f45590cfe767aed9d79f10 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512224 DXSDK_Aug09.exe.sha2-512224]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| ''SHA-512/256'' || 0c833a56046fe7e4213fcb1862c730acf313d1b8f60b51eebf64dc3e79730c1c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512256 DXSDK_Aug09.exe.sha2-512256]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''MD5''' || 66e5379ecf46b014688779621bcc677c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.md5 DXSDK_Aug09.exe.md5]&lt;br /&gt;
|- style=&amp;quot;text-align:center;vertical-align:center;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''{{nowrap|SHA-1}}''' || 5b9b969ed7b6cf5534bb7350e44c09b3573b0e71 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha1 DXSDK_Aug09.exe.sha1]&lt;br /&gt;
|}&lt;br /&gt;
CRC32 e9f5c61d ([https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sfv DXSDK_Aug09.exe.sfv])&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;
[[en:Compiling MTASA]]&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>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerPing&amp;diff=72064</id>
		<title>GetPlayerPing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerPing&amp;diff=72064"/>
		<updated>2021-09-15T13:31:48Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added clarification that VPN usage won't give incorrect ping (tested)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the ping of a specified [[player]]. The ping is the number of milliseconds that data takes to travel from the player's client to the server or vice versa. If a player is using a VPN their ping will still be returned correctly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getPlayerPing ( player thePlayer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[player]]:getPing|ping|}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': The [[player]] whose ping you want to determine.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the ping as an [[int]], or ''false'' if the player is 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 example checks every players ping every 5 seconds and if it's over 500 they get kicked.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function kickPing() -- Creates a function called kickPing&lt;br /&gt;
	for i, player in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do -- Loop every player&lt;br /&gt;
		if (getPlayerPing(player) &amp;gt;= 500) then -- If their ping is over 500&lt;br /&gt;
			kickPlayer(player, &amp;quot;Ping over 500!&amp;quot;) -- Kick them&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
setTimer(kickPing, 5000, 0) -- Every 5 seconds, the kickPing function is called.&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;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example checks the ping of every player entering the 'ping' command and warns him if it's over 100.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkPing()&lt;br /&gt;
        local ping = getPlayerPing(localPlayer)  -- get the ping from the source element (the player who joined)&lt;br /&gt;
        if (ping &amp;gt; 100) then                          -- if it's higher than 100...&lt;br /&gt;
                outputChatBox(&amp;quot;Your ping is pretty high! Please try to lower it if possible.&amp;quot;) -- output a message to the player&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;ping&amp;quot;, checkPing)&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;
{{Player functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:getPlayerPing]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=UnbindKey&amp;diff=71505</id>
		<title>UnbindKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=UnbindKey&amp;diff=71505"/>
		<updated>2021-07-29T17:42:47Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Added note about annoying bug that causes an hour lost debugging.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Removes an existing key bind from the specified player.&lt;br /&gt;
{{Note|unbindKey will only work on binds that were added by the same resource}}&lt;br /&gt;
{{Note|unbindKey on the server may return ''true'' on failure}}&lt;br /&gt;
{{Note|If you call unbindKey twice, it will break other scripts: [https://github.com/multitheftauto/mtasa-blue/issues/497 Issue 497]}}&lt;br /&gt;
==Syntax== &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;
bool unbindKey ( player thePlayer, string key, string keyState, string command )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool unbindKey ( player thePlayer, string key [, string keyState, function handler ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player you wish to unbind the key of.&lt;br /&gt;
*'''key:''' The key you wish to unbind. See [[Key names]] for a list of valid key names.&lt;br /&gt;
*'''keyState:''' Can be either:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key triggered a function when the key was released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key triggered a function when the key was pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key triggered a function when the key was pressed and released&lt;br /&gt;
*'''command :''' (Syntax 1) The command you wish to unbind.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''keyState:''' is optional in Syntax 2.&lt;br /&gt;
*'''handler:''' (Syntax 2) The function you wish to unbind.&lt;br /&gt;
Note: If you do not specify ''handler'', any instances of ''key'' being bound will be unbound, whatever function they are bound to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''true'' if the key was unbound, ''false'' if it was not previously bound or invalid arguments were passed to the function.&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;
bool unbindKey ( string key, string keyState, string command )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool unbindKey ( string key [, string keyState, function handler ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''key:''' The key you wish to unbind. See [[Key names]] for a list of valid key names.&lt;br /&gt;
*'''keyState:''' Can be either:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' If the bound key triggered a function when the key was released&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' If the bound key triggered a function when the key was pressed&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' If the bound key triggered a function when the key was pressed and released&lt;br /&gt;
*'''command :''' (Syntax 1) The command you wish to unbind.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''keyState:''' is optional in Syntax 2.&lt;br /&gt;
*'''handler:''' (Syntax 2) The function you wish to unbind.&lt;br /&gt;
Note: If you do not specify ''handler'', any instances of ''key'' being bound will be unbound, whatever function they are bound to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''true'' if the key was unbound, ''false'' if it was not previously bound or invalid arguments were passed to the function.&lt;br /&gt;
&amp;lt;/section&amp;gt;&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 function binds the player's ''F1'' key to a function ''goMoo'' which outputs a chat message when pressed. The key is then unbound so that it can effectively only be used once per life.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define the function that will be called when F1 is pressed&lt;br /&gt;
function goMoo( player )&lt;br /&gt;
    outputChatBox ( getPlayerName ( player ) .. &amp;quot; says Mooooooo!&amp;quot; )&lt;br /&gt;
    unbindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, goMoo )   -- this function will no longer be triggered by the player, after removing the bind.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function playerSpawn ( )&lt;br /&gt;
    bindKey ( source, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, goMoo ) -- bind the player's F1 key to the 'goMoo' function defined above&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, root, playerSpawn ) -- make the playerSpawn function be called when a player spawns&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;
&lt;br /&gt;
[[pt-br:unbindKey]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientGUITabSwitched&amp;diff=71355</id>
		<title>OnClientGUITabSwitched</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientGUITabSwitched&amp;diff=71355"/>
		<updated>2021-06-16T17:42:09Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event is triggered each time the user switch from GUI tab.&lt;br /&gt;
&lt;br /&gt;
When adding the event handler on the tab panel, propagate must be true.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element theElement&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
* '''theElement''': the [[Element/GUI/Tab|tab]] which was selected.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the tab.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a window with a tabpanel with two tabs. Every time a user changes tabpage a notification will be shown.&lt;br /&gt;
&lt;br /&gt;
First we'll create the window. Then add a tabpanel and couple tabs with some labels in them. Qoute: [[GuiCreateWindow#Example]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, &amp;quot;Information&amp;quot;, true )  -- create a window which has &amp;quot;Information&amp;quot; in the title bar.&lt;br /&gt;
local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, myWindow )       -- create a tab panel which fills the whole window&lt;br /&gt;
local tabMap = guiCreateTab( &amp;quot;Map Information&amp;quot;, tabPanel )                -- create a tab named &amp;quot;Map Information&amp;quot; on 'tabPanel'&lt;br /&gt;
local tabHelp = guiCreateTab( &amp;quot;Help&amp;quot;, tabPanel )                          -- create another tab named &amp;quot;Help&amp;quot; on 'tabPanel'&lt;br /&gt;
 &lt;br /&gt;
-- adds a label (text) to each tab&lt;br /&gt;
guiCreateLabel( 0.02, 0.04, 0.94, 0.2, &amp;quot;This is information about the current map&amp;quot;, true, tabMap )&lt;br /&gt;
guiCreateLabel( 0.02, 0.04, 0.94, 0.92, &amp;quot;This is help text.&amp;quot;, true, tabHelp )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let's add the event handler.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function OnChange(selectedTab)&lt;br /&gt;
	-- If there is a selected tab.&lt;br /&gt;
	if selectedTab ~= nil then &lt;br /&gt;
		outputChatBox( &amp;quot;You've changed your active tab.&amp;quot; )&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUITabSwitched&amp;quot;, root, OnChange)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateColPolygon&amp;diff=68424</id>
		<title>CreateColPolygon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateColPolygon&amp;diff=68424"/>
		<updated>2021-01-27T09:53:31Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note|For this function to work correctly, get/set your bound points in an anti-clockwise fashion.}}&lt;br /&gt;
{{Note|Even though this is a 2D colshape, [[isElementWithinColShape]] returns false if an element is in the area but below 0 Z height.}}&lt;br /&gt;
This function creates a collision polygon. See [http://en.wikipedia.org/wiki/Polygon Wikipedia] for a definition of a polygon. The first set of X Y of this shape is not part of the colshape bounds, so can set anywhere in the game world, however for performance, place it as close to the centre of the polygon as you can. It should be noted this shape is '''2D'''. There should be at least 3 bound points set. &lt;br /&gt;
{{VisualizeColshape}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
colshape createColPolygon ( float fCenterX, float fCenterY, float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, ... )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP| |ColShape.Polygon||}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''fCenterX:''' The X position of the collision polygon's position - the position that will be returned from [[getElementPosition]].&lt;br /&gt;
*'''fCenterY:''' The Y position of the collision polygon's position - the position that will be returned from [[getElementPosition]].&lt;br /&gt;
*'''fX1:''' The 1st X position of the collision polygon's bound point&lt;br /&gt;
*'''fY1:''' The 1st Y position of the collision polygon's bound point&lt;br /&gt;
*'''fX2:''' The 2nd X position of the collision polygon's bound point&lt;br /&gt;
*'''fY2:''' The 2nd Y position of the collision polygon's bound point&lt;br /&gt;
*'''fX3:''' The 3rd X position of the collision polygon's bound point&lt;br /&gt;
*'''fY3:''' The 3rd Y position of the collision polygon's bound point&lt;br /&gt;
*'''... :''' From the 3rd position you can have as many points as you require to create the colshape.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[colshape]] element if successful, ''false'' if invalid arguments were passed to the function.&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 example displays a chat message when any element hits the colshape and allows the colshape to be created using a console function ''set_zone''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local theZone = false&lt;br /&gt;
&lt;br /&gt;
function shapeHit( element )&lt;br /&gt;
    local descriptor = &amp;quot;undefined&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if getElementType( element ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
        -- Use the player's name&lt;br /&gt;
        descriptor = getPlayerName( element )&lt;br /&gt;
    elseif getElementType( element ) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        -- Use the vehicle's model name&lt;br /&gt;
        descriptor = getVehicleName( element ) or descriptor&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Output a message in the chat box for everyone on the server&lt;br /&gt;
    outputChatBox( descriptor .. &amp;quot; is in the zone!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function createZoneCommandHandler( playerSource, commandName, fX, fY, fX1, fY1, fX2, fY2, fX3, fY3, ... )&lt;br /&gt;
    -- Verify the player has given us the minimum amount of bound points&lt;br /&gt;
    if not ( fY and fX and fX1 and fY1 and fX2 and fX3 and fY3 ) then&lt;br /&gt;
        return outputChatBox( &amp;quot;Syntax: set_zone &amp;lt;X&amp;gt; &amp;lt;Y&amp;gt; &amp;lt;X1&amp;gt; &amp;lt;Y1&amp;gt; &amp;lt;X2&amp;gt; &amp;lt;Y2&amp;gt; &amp;lt;X3&amp;gt; &amp;lt;Y3&amp;gt; [&amp;lt;Xn&amp;gt; &amp;lt;Yn&amp;gt; ...]&amp;quot;, playerSource, 255, 100, 100 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Create the collision shape with the numbers from the arguments&lt;br /&gt;
    local tempCol = createColPolygon( fX, fY, fX1, fY1, fX2, fY2, fX3, fY3, ... )&lt;br /&gt;
&lt;br /&gt;
    if not tempCol then&lt;br /&gt;
        return outputChatBox( &amp;quot;Error: Couldn't create collision polygon&amp;quot;, playerSource, 255, 100, 100 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Destroy the previous collision polygon shape in case we already have one&lt;br /&gt;
    if isElement( theZone ) then&lt;br /&gt;
        destroyElement( theZone )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Use a variable out-of-scope to keep track of the most recently created collision shape element&lt;br /&gt;
    theZone = tempCol&lt;br /&gt;
&lt;br /&gt;
    -- Attach an event handler to the element to get notified whenever an element hits our collision shape&lt;br /&gt;
    addEventHandler( &amp;quot;onColShapeHit&amp;quot;, tempCol, shapeHit, false )&lt;br /&gt;
&lt;br /&gt;
    outputChatBox( &amp;quot;Success: Collision shape has been created!&amp;quot;, playerSource, 100, 255, 100 )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;set_zone&amp;quot;, createZoneCommandHandler )&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
This example displays a chat message when any element hits the colshape and allows the colshape to be created using a console function ''set_wall''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local theWall = false&lt;br /&gt;
&lt;br /&gt;
function shapeHit( element )&lt;br /&gt;
    local descriptor = &amp;quot;undefined&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if getElementType( element ) == &amp;quot;player&amp;quot; then&lt;br /&gt;
        -- Use the player's name&lt;br /&gt;
        descriptor = getPlayerName( element )&lt;br /&gt;
    elseif getElementType( element ) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        -- Use the vehicle's model name&lt;br /&gt;
        descriptor = getVehicleName( element ) or descriptor&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Output a message in the chat box for everyone on the server&lt;br /&gt;
    outputChatBox( descriptor .. &amp;quot; is in the zone!&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function createWallCommandHandler( playerSource, commandName, fromX, fromY, toX, toY )&lt;br /&gt;
    -- Verify the player has given us the minimum amount of bound points&lt;br /&gt;
    if not ( fromX and fromY and  toX and toY ) then&lt;br /&gt;
        return outputChatBox( &amp;quot;Syntax: set_wall &amp;lt;fromX&amp;gt; &amp;lt;fromY&amp;gt; &amp;lt;toX&amp;gt; &amp;lt;toY&amp;gt;&amp;quot;, playerSource, 255, 100, 100 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Calculate the 90° angle for the line between the two coordinates from the arguments&lt;br /&gt;
    local radian90DegreeAngle = math.atan2(toY - fromY, toX - fromX) + math.pi / 2&lt;br /&gt;
&lt;br /&gt;
    -- Depth/width of the wall&lt;br /&gt;
    local depth = 1&lt;br /&gt;
&lt;br /&gt;
    -- Pre-calculate the cosinus/sinus distances&lt;br /&gt;
    local cosinusDepth = math.cos(radian90DegreeAngle) * depth / 2&lt;br /&gt;
    local sinusDepth = math.sin(radian90DegreeAngle) * depth / 2&lt;br /&gt;
&lt;br /&gt;
    -- Calculate the points in the game world&lt;br /&gt;
    local x1, y1 = fromX - cosinusDepth, fromY - sinusDepth&lt;br /&gt;
    local x2, y2 = toX - cosinusDepth, toY - sinusDepth&lt;br /&gt;
    local x3, y3 = toX + cosinusDepth, toY + sinusDepth&lt;br /&gt;
    local x4, y4 = fromX + cosinusDepth, fromY + sinusDepth&lt;br /&gt;
&lt;br /&gt;
    -- Create the collision shape with the calculated numbers&lt;br /&gt;
    local tempCol = createColPolygon( fromX + (toX - fromX) / 2, fromY + (toY - fromY) / 2, x1, y1, x2, y2, x3, y3, x4, y4 )&lt;br /&gt;
&lt;br /&gt;
    if not tempCol then&lt;br /&gt;
        return outputChatBox( &amp;quot;Error: Couldn't create collision polygon&amp;quot;, playerSource, 255, 100, 100 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Destroy the previous collision polygon shape in case we already have one&lt;br /&gt;
    if isElement( theWall ) then&lt;br /&gt;
        destroyElement( theWall )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Use a variable out-of-scope to keep track of the most recently created collision shape element&lt;br /&gt;
    theWall = tempCol&lt;br /&gt;
&lt;br /&gt;
    -- Attach an event handler to the element to get notified whenever an element hits our collision shape&lt;br /&gt;
    addEventHandler( &amp;quot;onColShapeHit&amp;quot;, tempCol, shapeHit, false )&lt;br /&gt;
&lt;br /&gt;
    outputChatBox( &amp;quot;Success: Collision shape has been created!&amp;quot;, playerSource, 100, 255, 100 )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;set_wall&amp;quot;, createWallCommandHandler )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|9742|[Fixed in 1.5.5-3.12343] Passing this function [[Vector2|Vector2s]] are not fully supported}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Collision shape functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:createColPolygon]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySoundFrontEnd&amp;diff=68210</id>
		<title>PlaySoundFrontEnd</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySoundFrontEnd&amp;diff=68210"/>
		<updated>2021-01-08T20:10:31Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function plays a frontend sound for the specified player.&lt;br /&gt;
{{Note|These sounds can be disabled with [[setWorldSoundEnabled]] so if these sounds stop working you should check if you're disabling the sounds.}}&lt;br /&gt;
{{Note|These sounds don't work when [[fadeCamera]] has been used to make the screen black.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &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;
bool playSoundFrontEnd ( player thePlayer, int sound )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{New feature/item|3.0141|1.4.0|6987|{{OOP||[[player]]:playSoundFrontEnd}}}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' the [[player]] you want the sound to play for.&lt;br /&gt;
*'''sound:''' a whole [[int]] specifying the sound id to play. Valid values are:&lt;br /&gt;
{{Sounds}}&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;false&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool playSoundFrontEnd ( int sound )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{New feature/item|3.0141|1.4.0|6987|{{OOP||[[Sound]].playFrontEnd}}}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a whole [[int]] specifying the sound id to play. Valid values are:&lt;br /&gt;
{{Sounds}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully played, ''false'' 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;
This example plays a sound when a player spawns.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerSpawn ( theSpawnpoint, theTeam )&lt;br /&gt;
    playSoundFrontEnd ( source, 16 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, root, onPlayerSpawn )&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;
This example plays a sound when the player types the command '/sound'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onSoundEvent ( )&lt;br /&gt;
    playSoundFrontEnd ( 16 )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sound&amp;quot;, onSoundEvent)&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;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:playSoundFrontEnd]]&lt;br /&gt;
[[de:playSoundFrontEnd]]&lt;br /&gt;
[[ar:playSoundFrontEnd]]&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileExists&amp;diff=68077</id>
		<title>FileExists</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileExists&amp;diff=68077"/>
		<updated>2020-12-20T19:05:53Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This functions checks whether a specified file exists inside a resource.&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 fileExists ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This function is a static function underneath the File class.|[[File]].exists}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''filePath:''' The [[filepath]] of the file, whose existence is going to be checked, in the following format: '''&amp;quot;:resourceName/path&amp;quot;'''. 'resourceName' is the name of the resource the file is checked to be in, and 'path' is the path from the root directory of the resource to the file.&lt;br /&gt;
:For example, if you want to check whether a file named 'myfile.txt' exists in the resource 'mapcreator', it can be done from another resource this way: ''fileExists(&amp;quot;:mapcreator/myfile.txt&amp;quot;)''.&lt;br /&gt;
:If the file, whose existence is going to be checked, is in the current resource, only the file path is necessary, e.g. ''fileExists(&amp;quot;myfile.txt&amp;quot;)''. Note that you must use forward slashes '/' for the folders, backslashes '\' will return false.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the file exists, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks if a file exists in a resource directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkExistingFile(player,cmd,filename,resourcename)&lt;br /&gt;
	if not filename then -- if the player didn't include a filename&lt;br /&gt;
		outputChatBox(&amp;quot;ERROR: Syntax '/checkfile filename resourcename(optional)'.&amp;quot;,player) -- display error&lt;br /&gt;
		return false  -- stop function&lt;br /&gt;
	end&lt;br /&gt;
	if not resourcename then -- if the player didn't specify the resource he wants to check, use current resource&lt;br /&gt;
		resourcename = getResourceName(resource) --every resource has a predefined global variable called resource that contains the resource pointer for that resource, in other words, the value that getThisResource() function returns.&lt;br /&gt;
	else&lt;br /&gt;
		if not getResourceFromName(resourcename) then -- if a resource with that name doesn't exist, output error and stop function&lt;br /&gt;
			outputChatBox(&amp;quot;ERROR: Resource &amp;quot;..resourcename..&amp;quot; doesn't exist.&amp;quot;,player) -- output error message&lt;br /&gt;
			return false -- stop the function here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- as it hasn't stopped anywhere, we have both correct resourcename and filename&lt;br /&gt;
	local exists = fileExists((&amp;quot;:%s/%s&amp;quot;):format(resourcename,filename)) -- using shorter format of string.format, see StringLibraryTutorial in lua wiki for that&lt;br /&gt;
	if exists then&lt;br /&gt;
		outputChatBox((&amp;quot;The file %q in resource %q exists&amp;quot;):format(filename,resourcename))&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox((&amp;quot;The file %q in resource %q doesn't exist&amp;quot;):format(filename,resourcename))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;exists&amp;quot;,checkExistingFile)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerVehicleEnter&amp;diff=67081</id>
		<title>OnClientPlayerVehicleEnter</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerVehicleEnter&amp;diff=67081"/>
		<updated>2020-07-21T20:08:50Z</updated>

		<summary type="html">&lt;p&gt;Arran Fortuna: Fixed example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event is fired when a player or ped enters a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicle theVehicle, int seat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''theVehicle:''' the [[vehicle]] that the player entered&lt;br /&gt;
*'''seat:''' the seat that the player now is on. Driver's seat = 0, higher numbers are passenger seats.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] or [[ped]] that entered the vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will tell you the name of the vehicle you enter.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkVehicles(theVehicle)&lt;br /&gt;
	outputChatBox(&amp;quot;You entered a &amp;quot;..getVehicleName(theVehicle)..&amp;quot;!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerVehicleEnter&amp;quot;, localPlayer, checkVehicles)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client player events===&lt;br /&gt;
{{Client_player_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
</feed>