<?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=WASSIm.</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=WASSIm."/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/WASSIm."/>
	<updated>2026-04-04T14:48:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetResourcePriority&amp;diff=64557</id>
		<title>SetResourcePriority</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetResourcePriority&amp;diff=64557"/>
		<updated>2019-10-22T18:22:13Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Required Arguments */&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 set resource download priority group.&lt;br /&gt;
{{Note|This function requires the resource to have 'ModifyOtherObjects' [[ACL]] right.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setResourcePriority ( resource theResource, int priority )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theResource:''' the resource we are setting download priority group.&lt;br /&gt;
*'''priority:''' if this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the download priority group was successfully set, ''false'' otherwise&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setResourcePriority(theResource, priority)&lt;br /&gt;
    local resourceName = getResourceName(theResource)&lt;br /&gt;
    local theMeta = resourceName and xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    if (theMeta) then&lt;br /&gt;
        local node = xmlFindChild(theMeta, &amp;quot;download_priority_group&amp;quot;, 0)&lt;br /&gt;
        if (node) then &lt;br /&gt;
            xmlNodeSetValue(node, tonumber(priority))&lt;br /&gt;
        else&lt;br /&gt;
            local newNode = xmlCreateChild(theMeta, &amp;quot;download_priority_group&amp;quot;)&lt;br /&gt;
            xmlNodeSetValue(newNode, tonumber(priority))&lt;br /&gt;
        end&lt;br /&gt;
        xmlSaveFile(theMeta)&lt;br /&gt;
        xmlUnloadFile(theMeta)&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
==Credits==&lt;br /&gt;
*'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetResourcePriority&amp;diff=64556</id>
		<title>SetResourcePriority</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetResourcePriority&amp;diff=64556"/>
		<updated>2019-10-22T18:21:06Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &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 set resource download priority group.&lt;br /&gt;
{{Note|This function requires the resource to have 'ModifyOtherObjects' [[ACL]] right.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setResourcePriority ( resource theResource, int priority )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theResource:''' the resource we are setting download priority group.&lt;br /&gt;
*'''priority:''' if not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the download priority group was successfully set, ''false'' otherwise&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setResourcePriority(theResource, priority)&lt;br /&gt;
    local resourceName = getResourceName(theResource)&lt;br /&gt;
    local theMeta = resourceName and xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    if (theMeta) then&lt;br /&gt;
        local node = xmlFindChild(theMeta, &amp;quot;download_priority_group&amp;quot;, 0)&lt;br /&gt;
        if (node) then &lt;br /&gt;
            xmlNodeSetValue(node, tonumber(priority))&lt;br /&gt;
        else&lt;br /&gt;
            local newNode = xmlCreateChild(theMeta, &amp;quot;download_priority_group&amp;quot;)&lt;br /&gt;
            xmlNodeSetValue(newNode, tonumber(priority))&lt;br /&gt;
        end&lt;br /&gt;
        xmlSaveFile(theMeta)&lt;br /&gt;
        xmlUnloadFile(theMeta)&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
==Credits==&lt;br /&gt;
*'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=64553</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=64553"/>
		<updated>2019-10-20T16:27:35Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Code */&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 returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, groupName)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    outputChatBox(&amp;quot;You're in the following ACL groups: &amp;quot;.. tostring( table.concat(acl, &amp;quot;, &amp;quot;) ), thePlayer, 255, 0, 0)&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;
==Credits==&lt;br /&gt;
*'''Author:''': WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=64552</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=64552"/>
		<updated>2019-10-20T16:25:19Z</updated>

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

		<summary type="html">&lt;p&gt;WASSIm.: &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 set resource download priority group.&lt;br /&gt;
{{Note|This function requires the resource to have 'ModifyOtherObjects' [[ACL]] right.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setResourcePriority ( resource theResource, int priority )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theResource:''' the resource we are setting download priority group.&lt;br /&gt;
*'''priority:''' if not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the download priority group was successfully set, ''false'' otherwise&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setResourcePriority(theResource, priority)&lt;br /&gt;
    local resourceName = getResourceName(theResource)&lt;br /&gt;
    local theMeta = resourceName and xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    if (theMeta) then&lt;br /&gt;
        local node = xmlFindChild(theMeta, &amp;quot;download_priority_group&amp;quot;, 0)&lt;br /&gt;
        if (node) then &lt;br /&gt;
            xmlNodeSetValue(node, tonumber(priority))&lt;br /&gt;
        else&lt;br /&gt;
            local newNode = xmlCreateChild(theMeta, &amp;quot;download_priority_group&amp;quot;)&lt;br /&gt;
            xmlNodeSetValue(newNode, tonumber(priority))&lt;br /&gt;
        end&lt;br /&gt;
        xmlUnloadFile(theMeta)&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
==Credits==&lt;br /&gt;
*'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetResourcePriority&amp;diff=64550</id>
		<title>SetResourcePriority</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetResourcePriority&amp;diff=64550"/>
		<updated>2019-10-20T16:23:42Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function set resource download_priority group. {{Note|This function requires the resource to have 'ModifyO...&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 set resource download_priority group.&lt;br /&gt;
{{Note|This function requires the resource to have 'ModifyOtherObjects' [[ACL]] right.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setResourcePriority ( resource theResource, int priority )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theResource:''' the resource we are setting download priority group.&lt;br /&gt;
*'''priority:''' if not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the download priority group was successfully set, ''false'' otherwise&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setResourcePriority(theResource, priority)&lt;br /&gt;
    local resourceName = getResourceName(theResource)&lt;br /&gt;
    local theMeta = resourceName and xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    if (theMeta) then&lt;br /&gt;
        local node = xmlFindChild(theMeta, &amp;quot;download_priority_group&amp;quot;, 0)&lt;br /&gt;
        if (node) then &lt;br /&gt;
            xmlNodeSetValue(node, tonumber(priority))&lt;br /&gt;
        else&lt;br /&gt;
            local newNode = xmlCreateChild(theMeta, &amp;quot;download_priority_group&amp;quot;)&lt;br /&gt;
            xmlNodeSetValue(newNode, tonumber(priority))&lt;br /&gt;
        end&lt;br /&gt;
        xmlUnloadFile(theMeta)&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
==Credits==&lt;br /&gt;
*'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=64482</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=64482"/>
		<updated>2019-10-06T09:07:06Z</updated>

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

		<summary type="html">&lt;p&gt;WASSIm.: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks is vehicle upgraded by upgrade ID.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleUpgraded ( vehicle theVehicle, int upgrade )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[element]] representing the [[vehicle]] you wish to check the upgrade to.&lt;br /&gt;
*'''upgrade''': The id of the upgrade you wish to check. (1000 to 1193), ''see [[Vehicle Upgrades]]''&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the upgrade is on the vehicle, ''false'' if it is not..&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 isVehicleUpgraded(theVehicle, upgrade)&lt;br /&gt;
	if not (isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;) then return end&lt;br /&gt;
	if not (upgrade and type(upgrade) == &amp;quot;number&amp;quot;) then return end&lt;br /&gt;
	for slot=0, 16 do&lt;br /&gt;
		local upgradeSlot = getVehicleUpgradeOnSlot(theVehicle, slot)&lt;br /&gt;
		if (upgradeSlot) and (upgradeSlot == upgrade) then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&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;
==Credits==&lt;br /&gt;
*'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleUpgraded&amp;diff=64442</id>
		<title>IsVehicleUpgraded</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleUpgraded&amp;diff=64442"/>
		<updated>2019-09-30T21:50:42Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function checks is vehicle upgraded by upgrade ID.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleU...&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 checks is vehicle upgraded by upgrade ID.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleUpgraded ( vehicle theVehicle, int upgrade )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[element]] representing the [[vehicle]] you wish to check the upgrade to.&lt;br /&gt;
*'''upgrade''': The id of the upgrade you wish to check. (1000 to 1193), ''see [[Vehicle Upgrades]]''&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the upgrade is on the vehicle, ''false'' if it is not..&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 isVehicleUpgraded(theVehicle, upgrade)&lt;br /&gt;
	if not (isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;) then return end&lt;br /&gt;
	if not (upgrade and type(upgrade) == &amp;quot;number&amp;quot;) then return end&lt;br /&gt;
	for slot=0, 16 do&lt;br /&gt;
		local upgradeSlot = getVehicleUpgradeOnSlot(theVehicle, slot)&lt;br /&gt;
		if (upgradeSlot) and (upgradeSlot == upgrade) then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&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;
==Credits==&lt;br /&gt;
*'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39677</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39677"/>
		<updated>2014-05-31T21:31:39Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Code */&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 returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&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 getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, groupName)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    outputChatBox(&amp;quot;You're in the following ACL groups: &amp;quot;..tostring(table.concat(acl, &amp;quot;, &amp;quot;), thePlayer, 255, 0, 0)&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;
==Credits==&lt;br /&gt;
*'''Author:''': WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=39676</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=39676"/>
		<updated>2014-05-31T21:27:18Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource where you want to get the scripts from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
                fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
            end&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;
==Credits==&lt;br /&gt;
*'''Author:''': WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39675</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39675"/>
		<updated>2014-05-31T21:24:55Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&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 getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        acls = {}&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, groupName)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    outputChatBox(&amp;quot;You're in the following ACL groups: &amp;quot;..tostring(table.concat(acl, &amp;quot;, &amp;quot;), thePlayer, 255, 0, 0)&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;
==Credits==&lt;br /&gt;
*'''Author:''': WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=39674</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=39674"/>
		<updated>2014-05-31T21:24:37Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource where you want to get the scripts from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
==Credits==&lt;br /&gt;
*'''Author:''': WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=39398</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=39398"/>
		<updated>2014-04-17T20:03:49Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts large numbers and adds commas to it. (Example: 100000 -&amp;gt; 100,000)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Create Animated Dx Window&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 2D line in a circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPartialCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 2D line in a partial circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawEmptyRec]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This funcions draws an empty rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Accurately measures the pixel height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» 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-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can generate a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getFewPlayersOnTeams]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a team from it's few Players.!&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a list of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» 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;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the elements that are in a markers colshape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all online staff, names separated by two spaces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets players who have data name you passed to it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets an online player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all ACL's group on player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAllGroups]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets groups from Player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[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 percentage requested.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position. The returned rotation can be used in dxDrawImage&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a team from it's color. (Related to: [[getTeamFromName]])&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table containing valid MTA Vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all children of a node&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleRespawnPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get the spawn position of a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Adjusts the combobox to have a correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GuiMoveRightToCenter]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function move it Gui right to center.!&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementTeam]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if element is team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the [[element]] is in a [[colshape]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a ped is aiming.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will check to see if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if the player in the team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks sound finished or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the clientside floating-point precision of 24-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Return the porcent from one number.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside 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;
*[[setAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to change existing accounts name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function allows you to create a cinematic camera flight.&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow 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;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if both tables is equal. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check is empty table or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Merges two or more tables in the first.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random variable from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a phisical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=39369</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=39369"/>
		<updated>2014-04-16T21:59:04Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts large numbers and adds commas to it. (Example: 100000 -&amp;gt; 100,000)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Create Animated Dx Window&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 2D line in a circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPartialCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 2D line in a partial circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawEmptyRec]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This funcions draws an empty rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Accurately measures the pixel height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» 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-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can generate a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getFewPlayersOnTeams]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a team from it's few Players.!&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a list of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» 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;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the elements that are in a markers colshape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all online staff, names separated by two spaces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets players who have data name you passed to it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets an online player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all ACL's group on player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[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 percentage requested.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position. The returned rotation can be used in dxDrawImage&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a team from it's color. (Related to: [[getTeamFromName]])&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table containing valid MTA Vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all children of a node&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleRespawnPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get the spawn position of a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Adjusts the combobox to have a correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GuiMoveRightToCenter]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function move it Gui right to center.!&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementTeam]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if element is team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the [[element]] is in a [[colshape]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a ped is aiming.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will check to see if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if the player in the team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks sound finished or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the clientside floating-point precision of 24-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Return the porcent from one number.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside 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;
*[[setAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is used to change existing accounts name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function allows you to create a cinematic camera flight.&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow 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;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if both tables is equal. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check is empty table or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Merges two or more tables in the first.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random variable from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a phisical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39263</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39263"/>
		<updated>2014-04-07T09:14:14Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &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 returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&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 getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        acls = {}&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, groupName)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    outputChatBox(&amp;quot;You're in the following ACL groups: &amp;quot;..tostring(table.concat(acl, &amp;quot;, &amp;quot;), thePlayer, 255, 0, 0)&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:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=39262</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=39262"/>
		<updated>2014-04-07T09:14:09Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinished ( element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function isSoundFinished(theSound)&lt;br /&gt;
    local length = getSoundLength(theSound)&lt;br /&gt;
    local post = getSoundPosition(theSound)&lt;br /&gt;
    if (post == length) then&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
addCommandHandler(&amp;quot;checkfinish&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
    local sound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
    if (isSoundFinished(sound)) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finish!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finish!&amp;quot;)&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;
'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39257</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39257"/>
		<updated>2014-04-06T20:48:33Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&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 getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        acls = {}&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, {[groupName] = group})&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    for i,group in ipairs(acl) do&lt;br /&gt;
        outputChatBox(&amp;quot;You'r on group acl: &amp;quot;..group, thePlayer, 255, 0, 0)&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;
'''Author:''' WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39256</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39256"/>
		<updated>2014-04-06T20:31:59Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&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 getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        acls = {}&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, {[groupName] = group})&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    for i,group in ipairs(acl) do&lt;br /&gt;
        outputChatBox(&amp;quot;You'r on group acl: &amp;quot;..group, thePlayer, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39255</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39255"/>
		<updated>2014-04-06T20:30:31Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&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 getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        acls = {}&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, {[groupName] = group})&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    for i,group in ipairs(acl) do&lt;br /&gt;
		outputChatBox(&amp;quot;You'r on group acl: &amp;quot;..group, thePlayer, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39254</id>
		<title>GetPlayerAcls</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerAcls&amp;diff=39254"/>
		<updated>2014-04-06T20:28:03Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: Created page with &amp;quot;__NOTOC__  {{Useful Function}} This function returns a table over all the ACL's Player.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; table getPlayerAcls ( player thePlayer ) &amp;lt;/syntaxhighlight&amp;gt;   ===Required ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function returns a table over all the ACL's Player.&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 getPlayerAcls ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The Player to get the ACL's elements from&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns a ''table'' over the ''string''. This table might be empty if player invalid or player account is guest.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerAcls(thePlayer)&lt;br /&gt;
    local acls = {}&lt;br /&gt;
    local account = getPlayerAccount(thePlayer)&lt;br /&gt;
    if (account) and not (isGuestAccount(account)) then&lt;br /&gt;
        local accountName = getAccountName(account)&lt;br /&gt;
        acls = {}&lt;br /&gt;
        for i,group in ipairs(aclGroupList()) do&lt;br /&gt;
            if (isObjectInACLGroup( &amp;quot;user.&amp;quot; ..accountName, group)) then&lt;br /&gt;
                local groupName = aclGroupGetName(group)&lt;br /&gt;
                table.insert(acls, {[groupName] = group})&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return acls&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside script&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the list of ACL's player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addCommandHandler(&amp;quot;getacls&amp;quot;,&lt;br /&gt;
function (thePlayer)&lt;br /&gt;
    local acl = getPlayerAcls(thePlayer)&lt;br /&gt;
    for i,group in ipairs(acl) do&lt;br /&gt;
		outputChatBox(&amp;quot;You'r on group acl: &amp;quot;..group, thePlayer, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38648</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38648"/>
		<updated>2014-01-27T23:05:07Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource where you want to get the scripts from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38221</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38221"/>
		<updated>2014-01-10T03:59:22Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource where you want to get the scripts from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=38211</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=38211"/>
		<updated>2014-01-07T16:03:27Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts large numbers and adds commas to it. (Example: 100000 -&amp;gt; 100,000)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Create Animated Dx Window&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 2D line in a circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPartialCircle]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 2D line in a partial circle shape on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Accurately measures the pixel height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» 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-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can generate a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)|getAlivePlayers]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a list of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» 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;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets the elements that are in a markers colshape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all online staff, names separated by two spaces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets players who have data name you passed to it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets an online player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[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 percentage requested.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets a team from it's color. (Related to: [[getTeamFromName]])&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table containing valid MTA Vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all children of a node&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleRespawnPosition]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get the spawn position of a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Adjusts the combobox to have a correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the [[element]] is in a [[colshape]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a ped is aiming.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will check to see if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if the player in the team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks sound finished or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the clientside floating-point precision of 24-bits&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside 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;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function allows you to create a cinematic camera flight.&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow 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;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check if both tables is equal. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check is empty table or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Merges two or more tables in the first.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random variable from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a phisical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38210</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38210"/>
		<updated>2014-01-07T16:01:25Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Required Arguments */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource where you want to get the scripts from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38209</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38209"/>
		<updated>2014-01-07T15:56:39Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to get scriptt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38208</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38208"/>
		<updated>2014-01-07T15:56:22Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Code */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to get scriptt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38207</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38207"/>
		<updated>2014-01-07T15:53:27Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Syntax */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts ( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to get scriptt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38206</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38206"/>
		<updated>2014-01-07T15:47:42Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to get scriptt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..theScript..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38205</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38205"/>
		<updated>2014-01-07T15:46:56Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to get scriptt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputConsole(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, source)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Successfully compiled&amp;quot;, source)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputConsole(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Failed to compiled&amp;quot;, source)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38204</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38204"/>
		<updated>2014-01-07T15:43:59Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Syntax */&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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to get scriptt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputDebugString(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, 3)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Successfully compiled&amp;quot;, 3)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Failed to compiled&amp;quot;, 3)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38203</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38203"/>
		<updated>2014-01-07T15:42:36Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to check the last starting time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputDebugString(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, 3)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Successfully compiled&amp;quot;, 3)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Failed to compiled&amp;quot;, 3)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38202</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38202"/>
		<updated>2014-01-07T15:41:52Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: &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 show all scripts in resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to check the last starting time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputDebugString(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, 3)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Successfully compiled&amp;quot;, 3)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Failed to compiled&amp;quot;, 3)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38201</id>
		<title>GetResourceScripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceScripts&amp;diff=38201"/>
		<updated>2014-01-07T15:40:27Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: Created page with &amp;quot;==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments=== * '''theResource''': The resource of which you'd like to check the last s...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool getResourceScripts( resource theResource )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theResource''': The resource of which you'd like to check the last starting time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''table'' scripts on [[resource]].&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function getResourceScripts(resource)&lt;br /&gt;
    local scripts = {}&lt;br /&gt;
    local resourceName = getResourceName(resource)&lt;br /&gt;
    local theMeta = xmlLoadFile(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/meta.xml&amp;quot;)&lt;br /&gt;
    for i, node in ipairs (xmlNodeGetChildren(theMeta)) do&lt;br /&gt;
        if (xmlNodeGetName(node) == &amp;quot;script&amp;quot;) then&lt;br /&gt;
            local script = xmlNodeGetAttribute(node, &amp;quot;src&amp;quot;)&lt;br /&gt;
            if (script) then&lt;br /&gt;
                table.insert(scripts, script)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return scripts&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will compile all script on resource&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;
addCommandHandler(&amp;quot;compile&amp;quot;, &lt;br /&gt;
function (source, cmd, resourceName)&lt;br /&gt;
    local resource = getResourceFromName(resourceName)&lt;br /&gt;
    for i, script in ipairs (getResourceScripts(resource)) do&lt;br /&gt;
        local theScript = fileOpen(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..script..&amp;quot;&amp;quot;, true)&lt;br /&gt;
        if (theScript) then&lt;br /&gt;
            function myCallback(responseData, errno)&lt;br /&gt;
                if errno == 0 then&lt;br /&gt;
                    if (string.find(responseData, &amp;quot;ERROR&amp;quot;)) then&lt;br /&gt;
                        outputDebugString(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: &amp;quot;..responseData..&amp;quot;&amp;quot;, 3)&lt;br /&gt;
                    else&lt;br /&gt;
                        local theScriptC = fileCreate(&amp;quot;:&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;&amp;quot;)&lt;br /&gt;
                        fileWrite(theScriptC, responseData)&lt;br /&gt;
                        fileClose(theScriptC)&lt;br /&gt;
                        if (responseData) then&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Successfully compiled&amp;quot;, 3)&lt;br /&gt;
                        else&lt;br /&gt;
                            outputDebugString(&amp;quot;&amp;quot;..resourceName..&amp;quot;/&amp;quot;..src..&amp;quot;: Failed to compiled&amp;quot;, 3)&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    fetchRemote(&amp;quot;http://luac.mtasa.com/?compile=1&amp;amp;debug=0&amp;amp;blockdecompile=1&amp;amp;encrypt=1&amp;quot;, myCallback, fileRead(theScript, 500000000), true)&lt;br /&gt;
                end&lt;br /&gt;
            end&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;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Voice&amp;diff=37206</id>
		<title>Resource:Voice</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Voice&amp;diff=37206"/>
		<updated>2013-09-19T14:13:01Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* getPlayerMutedByList */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
The introduction of voice support in 1.1 comes with very basic, yet flexible scripting interface for it.&lt;br /&gt;
&lt;br /&gt;
The purpose of the '''Voice''' resource is to provide a typical interface which wraps on top of MTA's own basic scripting, to provide typical features a user would expect of voice chat - including team assignment, channel assignment, and muting.&lt;br /&gt;
&lt;br /&gt;
The '''Voice''' resource currently does not provide a GUI interface for muting other players clientside, though this is planned.&lt;br /&gt;
&lt;br /&gt;
= Concepts =&lt;br /&gt;
The Voice resource provides '''channel''' functionality.  A channel is a way of controlling who you can speak to and hear from.  There are three main types of channels:&lt;br /&gt;
* '''Scripted channel:'''  This channel is set using the [[Resource:Voice#getPlayerChannel|setPlayerChannel]] function, and is in the format of a number.  Players in channel ''1'' cannot hear players who are in channel ''2''.&lt;br /&gt;
&lt;br /&gt;
* '''Team channel:''' Scripts do not have access to this type of channel, but it is quite similar to a scripted channel.  This type of channel is automatically assigned based upon the [[Resource:Voice#Team_autoassignment|Team autoassignment]] setting.  When players are in a team, [[Resource:Voice#getPlayerChannel|getPlayerChannel]] will return the actual [[team]] element.  Players of one team channel cannot hear players in another team channel.  Equally, players in a team channel cannot hear players in a ''Scripted Channel''.&lt;br /&gt;
&lt;br /&gt;
* '''The &amp;quot;root&amp;quot; channel:'''  Players are placed into this channel by default.  This channel is associated to the [[getRootElement|root]] element concept, and [[Resource:Voice#getPlayerChannel|getPlayerChannel]] will actually return the root element.  When a player is in the root channel, he is broadcasting to '''everyone''' in the server, and they will be able to hear him.  However, he will not be able to hear from people who are either in a ''Team channel'' or a ''Scripted channel''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Settings =&lt;br /&gt;
All settings can be modified using MTA's set() functions, modifying the meta.xml of the resource, or modifying the settings.xml.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Chat Icons===&lt;br /&gt;
* '''Setting name:''' ''show_chat_icon''&lt;br /&gt;
* '''Description:''' A boolean value which allows you to disable or enable the voice chat broadcast icon that appears above a player when he speaks.&lt;br /&gt;
* '''XML Example:''' &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;setting name=&amp;quot;show_chat_icon&amp;quot; value=&amp;quot;[false]&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team autoassignment===&lt;br /&gt;
* '''Setting name:''' ''autoassign_to_teams''&lt;br /&gt;
* '''Description:''' A boolean value which allows you to disable or enable the voice resource automatically managing players into voice channels according to the team they're in.&lt;br /&gt;
* '''XML Example:''' &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;setting name=&amp;quot;autoassign_to_teams&amp;quot; value=&amp;quot;[false]&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
=Clientside Scripting functions=&lt;br /&gt;
All these scripting functions are '''clientside''' and therefore only affect the '''local player'''.  All functions must be called using the [[call|exports]]  system.&lt;br /&gt;
&lt;br /&gt;
===isPlayerVoiceMuted===&lt;br /&gt;
This function allows you to determine if a remote player is muted to the local player.  In other words, can I hear this other player?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:isPlayerVoiceMuted ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player for which you wish to check if they are muted&lt;br /&gt;
Returns a bool - '''true'' if muted, '''false''' if not&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerVoiceMuted===&lt;br /&gt;
This function allows you to set whether a remote player is muted to the local player.  In simple terms, I can set whether I can hear this other player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerVoiceMuted ( player playerToMute, bool muted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToMute:''' The player for which you wish to mute or unmute&lt;br /&gt;
* '''muted :''' A bool of whether they should be muted or unmuted.  '''true''' for muted, '''false''' for unmuted.&lt;br /&gt;
Returns a '''true''' if the operation was successful, '''false''' otherwise&lt;br /&gt;
&lt;br /&gt;
=Serverside Scripting functions=&lt;br /&gt;
All these scripting functions are '''serverside''' and can affect all players in the server.  All functions must be called using the [[call|exports]]  system.&lt;br /&gt;
&lt;br /&gt;
===isPlayerVoiceMuted===&lt;br /&gt;
This function allows you to determine if a player is muted to everyone in the server.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:isPlayerVoiceMuted ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player for which you wish to check if they are muted&lt;br /&gt;
Returns a bool - '''true'' if muted, '''false''' if not&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerVoiceMuted===&lt;br /&gt;
This function allows you to set whether a player is muted to everyone in the server.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerVoiceMuted ( player playerToMute, bool muted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToMute:''' The player for which you wish to mute or unmute&lt;br /&gt;
* '''muted :''' A bool of whether they should be muted or unmuted.  '''true''' for muted, '''false''' for unmuted.&lt;br /&gt;
Returns a '''true''' if the operation was successful, '''false''' otherwise&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayerMutedByList===&lt;br /&gt;
This function allows you to retrive a list of the players who have muted a specified player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table exports.voice:getPlayerVoiceMutedByList( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to retrieve the list of who  has muted this player&lt;br /&gt;
Returns a table of players who have muted the specified player.&lt;br /&gt;
&lt;br /&gt;
===getPlayerChannel===&lt;br /&gt;
This function allows you to get what voice chat channel the specified player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int/element exports.voice:getPlayerChannel ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to retrieve the channel of&lt;br /&gt;
Returns an integer of the channel ID they are in, or a [[team]] element if they have been assigned to a team channel, or the [[getRootElement|root]] element if they are not in a specific channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerChannel===&lt;br /&gt;
This function allows you to set what voice chat channel the specified player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerChannel ( player playerToCheck, [ int channelID ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to set the channel of&lt;br /&gt;
* '''channelID :''' ''Optional:'' The channel ID you wish to assign to this player.  Not passing this argument will allow the Voice resource to automatically manage this player (e.g. Team assignment).&lt;br /&gt;
Returns '''true''' if the operation was successful, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayersInChannel===&lt;br /&gt;
This function allows you to retrive a list of the players who are in a certain channel.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table exports.voice:getPlayersInChannel ( int channelID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''channelID :''' The channelID which you want to get the list of players from.&lt;br /&gt;
Returns a table of players are in the specified channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getNextEmptyChannel===&lt;br /&gt;
This function allows you to get the next channel ID which is completely empty, allowing for easy creation of new channels&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getNextEmptyChannel ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns an integer of the first channel ID which is completely empty.&lt;br /&gt;
&lt;br /&gt;
[[ru:Resource:Voice]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Voice&amp;diff=37205</id>
		<title>Resource:Voice</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Voice&amp;diff=37205"/>
		<updated>2013-09-19T14:12:44Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Serverside Scripting functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
The introduction of voice support in 1.1 comes with very basic, yet flexible scripting interface for it.&lt;br /&gt;
&lt;br /&gt;
The purpose of the '''Voice''' resource is to provide a typical interface which wraps on top of MTA's own basic scripting, to provide typical features a user would expect of voice chat - including team assignment, channel assignment, and muting.&lt;br /&gt;
&lt;br /&gt;
The '''Voice''' resource currently does not provide a GUI interface for muting other players clientside, though this is planned.&lt;br /&gt;
&lt;br /&gt;
= Concepts =&lt;br /&gt;
The Voice resource provides '''channel''' functionality.  A channel is a way of controlling who you can speak to and hear from.  There are three main types of channels:&lt;br /&gt;
* '''Scripted channel:'''  This channel is set using the [[Resource:Voice#getPlayerChannel|setPlayerChannel]] function, and is in the format of a number.  Players in channel ''1'' cannot hear players who are in channel ''2''.&lt;br /&gt;
&lt;br /&gt;
* '''Team channel:''' Scripts do not have access to this type of channel, but it is quite similar to a scripted channel.  This type of channel is automatically assigned based upon the [[Resource:Voice#Team_autoassignment|Team autoassignment]] setting.  When players are in a team, [[Resource:Voice#getPlayerChannel|getPlayerChannel]] will return the actual [[team]] element.  Players of one team channel cannot hear players in another team channel.  Equally, players in a team channel cannot hear players in a ''Scripted Channel''.&lt;br /&gt;
&lt;br /&gt;
* '''The &amp;quot;root&amp;quot; channel:'''  Players are placed into this channel by default.  This channel is associated to the [[getRootElement|root]] element concept, and [[Resource:Voice#getPlayerChannel|getPlayerChannel]] will actually return the root element.  When a player is in the root channel, he is broadcasting to '''everyone''' in the server, and they will be able to hear him.  However, he will not be able to hear from people who are either in a ''Team channel'' or a ''Scripted channel''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Settings =&lt;br /&gt;
All settings can be modified using MTA's set() functions, modifying the meta.xml of the resource, or modifying the settings.xml.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Chat Icons===&lt;br /&gt;
* '''Setting name:''' ''show_chat_icon''&lt;br /&gt;
* '''Description:''' A boolean value which allows you to disable or enable the voice chat broadcast icon that appears above a player when he speaks.&lt;br /&gt;
* '''XML Example:''' &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;setting name=&amp;quot;show_chat_icon&amp;quot; value=&amp;quot;[false]&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team autoassignment===&lt;br /&gt;
* '''Setting name:''' ''autoassign_to_teams''&lt;br /&gt;
* '''Description:''' A boolean value which allows you to disable or enable the voice resource automatically managing players into voice channels according to the team they're in.&lt;br /&gt;
* '''XML Example:''' &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;setting name=&amp;quot;autoassign_to_teams&amp;quot; value=&amp;quot;[false]&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
=Clientside Scripting functions=&lt;br /&gt;
All these scripting functions are '''clientside''' and therefore only affect the '''local player'''.  All functions must be called using the [[call|exports]]  system.&lt;br /&gt;
&lt;br /&gt;
===isPlayerVoiceMuted===&lt;br /&gt;
This function allows you to determine if a remote player is muted to the local player.  In other words, can I hear this other player?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:isPlayerVoiceMuted ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player for which you wish to check if they are muted&lt;br /&gt;
Returns a bool - '''true'' if muted, '''false''' if not&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerVoiceMuted===&lt;br /&gt;
This function allows you to set whether a remote player is muted to the local player.  In simple terms, I can set whether I can hear this other player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerVoiceMuted ( player playerToMute, bool muted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToMute:''' The player for which you wish to mute or unmute&lt;br /&gt;
* '''muted :''' A bool of whether they should be muted or unmuted.  '''true''' for muted, '''false''' for unmuted.&lt;br /&gt;
Returns a '''true''' if the operation was successful, '''false''' otherwise&lt;br /&gt;
&lt;br /&gt;
=Serverside Scripting functions=&lt;br /&gt;
All these scripting functions are '''serverside''' and can affect all players in the server.  All functions must be called using the [[call|exports]]  system.&lt;br /&gt;
&lt;br /&gt;
===isPlayerVoiceMuted===&lt;br /&gt;
This function allows you to determine if a player is muted to everyone in the server.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:isPlayerVoiceMuted ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player for which you wish to check if they are muted&lt;br /&gt;
Returns a bool - '''true'' if muted, '''false''' if not&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerVoiceMuted===&lt;br /&gt;
This function allows you to set whether a player is muted to everyone in the server.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerVoiceMuted ( player playerToMute, bool muted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToMute:''' The player for which you wish to mute or unmute&lt;br /&gt;
* '''muted :''' A bool of whether they should be muted or unmuted.  '''true''' for muted, '''false''' for unmuted.&lt;br /&gt;
Returns a '''true''' if the operation was successful, '''false''' otherwise&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayerMutedByList===&lt;br /&gt;
This function allows you to retrive a list of the players who have muted a specified player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table exports.voice:getPlayerMutedByList( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to retrieve the list of who  has muted this player&lt;br /&gt;
Returns a table of players who have muted the specified player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayerChannel===&lt;br /&gt;
This function allows you to get what voice chat channel the specified player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int/element exports.voice:getPlayerChannel ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to retrieve the channel of&lt;br /&gt;
Returns an integer of the channel ID they are in, or a [[team]] element if they have been assigned to a team channel, or the [[getRootElement|root]] element if they are not in a specific channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerChannel===&lt;br /&gt;
This function allows you to set what voice chat channel the specified player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerChannel ( player playerToCheck, [ int channelID ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to set the channel of&lt;br /&gt;
* '''channelID :''' ''Optional:'' The channel ID you wish to assign to this player.  Not passing this argument will allow the Voice resource to automatically manage this player (e.g. Team assignment).&lt;br /&gt;
Returns '''true''' if the operation was successful, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayersInChannel===&lt;br /&gt;
This function allows you to retrive a list of the players who are in a certain channel.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table exports.voice:getPlayersInChannel ( int channelID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''channelID :''' The channelID which you want to get the list of players from.&lt;br /&gt;
Returns a table of players are in the specified channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getNextEmptyChannel===&lt;br /&gt;
This function allows you to get the next channel ID which is completely empty, allowing for easy creation of new channels&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getNextEmptyChannel ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns an integer of the first channel ID which is completely empty.&lt;br /&gt;
&lt;br /&gt;
[[ru:Resource:Voice]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Voice&amp;diff=37204</id>
		<title>Resource:Voice</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Voice&amp;diff=37204"/>
		<updated>2013-09-19T14:12:22Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Clientside Scripting functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
The introduction of voice support in 1.1 comes with very basic, yet flexible scripting interface for it.&lt;br /&gt;
&lt;br /&gt;
The purpose of the '''Voice''' resource is to provide a typical interface which wraps on top of MTA's own basic scripting, to provide typical features a user would expect of voice chat - including team assignment, channel assignment, and muting.&lt;br /&gt;
&lt;br /&gt;
The '''Voice''' resource currently does not provide a GUI interface for muting other players clientside, though this is planned.&lt;br /&gt;
&lt;br /&gt;
= Concepts =&lt;br /&gt;
The Voice resource provides '''channel''' functionality.  A channel is a way of controlling who you can speak to and hear from.  There are three main types of channels:&lt;br /&gt;
* '''Scripted channel:'''  This channel is set using the [[Resource:Voice#getPlayerChannel|setPlayerChannel]] function, and is in the format of a number.  Players in channel ''1'' cannot hear players who are in channel ''2''.&lt;br /&gt;
&lt;br /&gt;
* '''Team channel:''' Scripts do not have access to this type of channel, but it is quite similar to a scripted channel.  This type of channel is automatically assigned based upon the [[Resource:Voice#Team_autoassignment|Team autoassignment]] setting.  When players are in a team, [[Resource:Voice#getPlayerChannel|getPlayerChannel]] will return the actual [[team]] element.  Players of one team channel cannot hear players in another team channel.  Equally, players in a team channel cannot hear players in a ''Scripted Channel''.&lt;br /&gt;
&lt;br /&gt;
* '''The &amp;quot;root&amp;quot; channel:'''  Players are placed into this channel by default.  This channel is associated to the [[getRootElement|root]] element concept, and [[Resource:Voice#getPlayerChannel|getPlayerChannel]] will actually return the root element.  When a player is in the root channel, he is broadcasting to '''everyone''' in the server, and they will be able to hear him.  However, he will not be able to hear from people who are either in a ''Team channel'' or a ''Scripted channel''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Settings =&lt;br /&gt;
All settings can be modified using MTA's set() functions, modifying the meta.xml of the resource, or modifying the settings.xml.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Chat Icons===&lt;br /&gt;
* '''Setting name:''' ''show_chat_icon''&lt;br /&gt;
* '''Description:''' A boolean value which allows you to disable or enable the voice chat broadcast icon that appears above a player when he speaks.&lt;br /&gt;
* '''XML Example:''' &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;setting name=&amp;quot;show_chat_icon&amp;quot; value=&amp;quot;[false]&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team autoassignment===&lt;br /&gt;
* '''Setting name:''' ''autoassign_to_teams''&lt;br /&gt;
* '''Description:''' A boolean value which allows you to disable or enable the voice resource automatically managing players into voice channels according to the team they're in.&lt;br /&gt;
* '''XML Example:''' &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;setting name=&amp;quot;autoassign_to_teams&amp;quot; value=&amp;quot;[false]&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
=Clientside Scripting functions=&lt;br /&gt;
All these scripting functions are '''clientside''' and therefore only affect the '''local player'''.  All functions must be called using the [[call|exports]]  system.&lt;br /&gt;
&lt;br /&gt;
===isPlayerVoiceMuted===&lt;br /&gt;
This function allows you to determine if a remote player is muted to the local player.  In other words, can I hear this other player?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:isPlayerVoiceMuted ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player for which you wish to check if they are muted&lt;br /&gt;
Returns a bool - '''true'' if muted, '''false''' if not&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerVoiceMuted===&lt;br /&gt;
This function allows you to set whether a remote player is muted to the local player.  In simple terms, I can set whether I can hear this other player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerVoiceMuted ( player playerToMute, bool muted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToMute:''' The player for which you wish to mute or unmute&lt;br /&gt;
* '''muted :''' A bool of whether they should be muted or unmuted.  '''true''' for muted, '''false''' for unmuted.&lt;br /&gt;
Returns a '''true''' if the operation was successful, '''false''' otherwise&lt;br /&gt;
&lt;br /&gt;
=Serverside Scripting functions=&lt;br /&gt;
All these scripting functions are '''serverside''' and can affect all players in the server.  All functions must be called using the [[call|exports]]  system.&lt;br /&gt;
&lt;br /&gt;
===isPlayerMuted===&lt;br /&gt;
This function allows you to determine if a player is muted to everyone in the server.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:isPlayerMuted ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player for which you wish to check if they are muted&lt;br /&gt;
Returns a bool - '''true'' if muted, '''false''' if not&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerMuted===&lt;br /&gt;
This function allows you to set whether a player is muted to everyone in the server.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerMuted ( player playerToMute, bool muted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToMute:''' The player for which you wish to mute or unmute&lt;br /&gt;
* '''muted :''' A bool of whether they should be muted or unmuted.  '''true''' for muted, '''false''' for unmuted.&lt;br /&gt;
Returns a '''true''' if the operation was successful, '''false''' otherwise&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayerMutedByList===&lt;br /&gt;
This function allows you to retrive a list of the players who have muted a specified player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table exports.voice:getPlayerMutedByList( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to retrieve the list of who  has muted this player&lt;br /&gt;
Returns a table of players who have muted the specified player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayerChannel===&lt;br /&gt;
This function allows you to get what voice chat channel the specified player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int/element exports.voice:getPlayerChannel ( player playerToCheck )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to retrieve the channel of&lt;br /&gt;
Returns an integer of the channel ID they are in, or a [[team]] element if they have been assigned to a team channel, or the [[getRootElement|root]] element if they are not in a specific channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===setPlayerChannel===&lt;br /&gt;
This function allows you to set what voice chat channel the specified player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool exports.voice:setPlayerChannel ( player playerToCheck, [ int channelID ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''playerToCheck:''' The player who you wish to set the channel of&lt;br /&gt;
* '''channelID :''' ''Optional:'' The channel ID you wish to assign to this player.  Not passing this argument will allow the Voice resource to automatically manage this player (e.g. Team assignment).&lt;br /&gt;
Returns '''true''' if the operation was successful, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getPlayersInChannel===&lt;br /&gt;
This function allows you to retrive a list of the players who are in a certain channel.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table exports.voice:getPlayersInChannel ( int channelID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''channelID :''' The channelID which you want to get the list of players from.&lt;br /&gt;
Returns a table of players are in the specified channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===getNextEmptyChannel===&lt;br /&gt;
This function allows you to get the next channel ID which is completely empty, allowing for easy creation of new channels&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getNextEmptyChannel ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns an integer of the first channel ID which is completely empty.&lt;br /&gt;
&lt;br /&gt;
[[ru:Resource:Voice]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37096</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37096"/>
		<updated>2013-09-13T09:29:37Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinished(  element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function isSoundFinished ( theSound )&lt;br /&gt;
    local length = getSoundLength( theSound )&lt;br /&gt;
    local post = getSoundPosition( theSound )&lt;br /&gt;
    if (post==length) then&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&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;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongFinish()&lt;br /&gt;
    local finish = isSoundFinished(theSound)&lt;br /&gt;
    if(finish == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finish!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finish!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;, checkSongFinish)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37095</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37095"/>
		<updated>2013-09-13T09:21:34Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinish(  element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function isSoundFinished ( theSound )&lt;br /&gt;
    local length = getSoundLength( theSound )&lt;br /&gt;
    local post = getSoundPosition( theSound )&lt;br /&gt;
    if (post==length) then&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&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;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongFinish()&lt;br /&gt;
    local finish = isSoundFinished(theSound)&lt;br /&gt;
    if(finish == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finish!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finish!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;, checkSongFinish)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37072</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37072"/>
		<updated>2013-09-09T07:09:52Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinish(  element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function isSoundFinish ( theSound )&lt;br /&gt;
    local length = getSoundLength( sound )&lt;br /&gt;
    local post = getSoundPosition( sound )&lt;br /&gt;
    if (post==length) then&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&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;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongFinish()&lt;br /&gt;
    local finish = isSoundFinished(theSound)&lt;br /&gt;
    if(finish == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finish!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finish!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;, checkSongFinish)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: WASSIm.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37071</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37071"/>
		<updated>2013-09-09T07:07:27Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinish(  element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function isSoundFinish ( theSound )&lt;br /&gt;
    local length = getSoundLength( sound )&lt;br /&gt;
    local post = getSoundPosition( sound )&lt;br /&gt;
    if (post==length) then&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&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;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongFinish()&lt;br /&gt;
    local finish = isSoundFinished(theSound)&lt;br /&gt;
    if(finish == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finish!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finish!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;, checkSongFinish)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another: WASSIm.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37070</id>
		<title>IsSoundFinished</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundFinished&amp;diff=37070"/>
		<updated>2013-09-09T07:03:13Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function check if sound finish.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinish(  element theSound )&amp;lt;/syntaxhighlight&amp;gt;  ===R...&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 check if sound finish.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundFinish(  element theSound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theSound''': The sound element which finish state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is finished, ''false'' if unfinished or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Code==&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;
function isSoundFinish ( theSound )&lt;br /&gt;
    local length = getSoundLength( sound )&lt;br /&gt;
    local post = getSoundPosition( sound )&lt;br /&gt;
    if (post==length) then&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&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;
==Example== &lt;br /&gt;
This example will check and see if the sound is finished or not, and tell the player.&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;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongFinish()&lt;br /&gt;
    local finish = isSoundFinished(theSound)&lt;br /&gt;
    if(finish == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is finish!&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not finish!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkfinish&amp;quot;, checkSongFinish)&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>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=36983</id>
		<title>CreateWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=36983"/>
		<updated>2013-08-26T20:34:24Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|&amp;quot;Some weapon types do not work.&amp;quot;... needs investigating. Shotguns do not work because the pellet code was complex and its actually 8 very clustered pellets. All other bullet weapons should work and be synced. Exact weapons this works with needs documenting still.}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a custom weapon that can fire bullets not related to player held weapons.&lt;br /&gt;
'''Note:''' Some weapon types do not work.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;weapon createWeapon ( string theType, float x, float y, float z )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theType:''' The weapon type which can be:&lt;br /&gt;
{{Custom Weapon Types}}&lt;br /&gt;
&lt;br /&gt;
* '''x:''' The x position to create the weapon.&lt;br /&gt;
* '''y:''' The y position to create the weapon.&lt;br /&gt;
* '''z:''' The z position to create the weapon.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a custom weapon [[element]] type and creates a simulated weapon at that position.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&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;
'''Example 1:''' This example create weapon and firing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMinigunWeapon()&lt;br /&gt;
    local x, y, z = getElementPosition(getLocalPlayer())&lt;br /&gt;
    local weapon = createWeapon(&amp;quot;minigun&amp;quot;, x, y, z + 1)&lt;br /&gt;
    setWeaponClipAmmo ( weapon,99999)&lt;br /&gt;
    setWeaponState ( weapon,&amp;quot;firing&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createminigun&amp;quot;, createMinigunWeapon)&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 weapon creation functions}}&lt;br /&gt;
[[ru:createWeapon]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=36982</id>
		<title>CreateWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=36982"/>
		<updated>2013-08-26T20:33:55Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|&amp;quot;Some weapon types do not work.&amp;quot;... needs investigating. Shotguns do not work because the pellet code was complex and its actually 8 very clustered pellets. All other bullet weapons should work and be synced. Exact weapons this works with needs documenting still.}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a custom weapon that can fire bullets not related to player held weapons.&lt;br /&gt;
'''Note:''' Some weapon types do not work.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;weapon createWeapon ( string theType, float x, float y, float z )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theType:''' The weapon type which can be:&lt;br /&gt;
{{Custom Weapon Types}}&lt;br /&gt;
&lt;br /&gt;
* '''x:''' The x position to create the weapon.&lt;br /&gt;
* '''y:''' The y position to create the weapon.&lt;br /&gt;
* '''z:''' The z position to create the weapon.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a custom weapon [[element]] type and creates a simulated weapon at that position.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==Examples ==&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;
'''Example 1:''' This example create weapon and firing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMinigunWeapon()&lt;br /&gt;
    local x, y, z = getElementPosition(getLocalPlayer())&lt;br /&gt;
    local weapon = createWeapon(&amp;quot;minigun&amp;quot;, x, y, z + 1)&lt;br /&gt;
    setWeaponClipAmmo ( weapon,99999)&lt;br /&gt;
    setWeaponState ( weapon,&amp;quot;firing&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createminigun&amp;quot;, createMinigunWeapon)&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 weapon creation functions}}&lt;br /&gt;
[[ru:createWeapon]]&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=36981</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=36981"/>
		<updated>2013-08-26T20:26:20Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will smoothly move an object from its current position to a specified rotation and position.&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 moveObject ( object theObject, int time,&lt;br /&gt;
                  float targetx, float targety, float targetz, &lt;br /&gt;
                [ float moverx, float movery, float moverz,&lt;br /&gt;
                  string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theObject:''' The object that will be moved.&lt;br /&gt;
* '''time:''' The time in milliseconds the object will arrive at the destination.&lt;br /&gt;
* '''targetx:''' The X value of the target position&lt;br /&gt;
* '''targety:''' The Y value of the target position&lt;br /&gt;
* '''targetz:''' The Z value of the target position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''moverx:''' The rotation along the X axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''movery:''' The rotation along the Y axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''moverz:''' The rotation along the Z axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation (default is &amp;quot;Linear&amp;quot;)&lt;br /&gt;
*'''fEasingPeriod:''' the period of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingAmplitude:''' the amplitude of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingOvershoot:''' the overshoot of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function moved the object succesfully, and returns ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples ==&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;
'''Example 1:''' This example moves every object in the game up 100 units in ten seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
allObjects = getElementsByType ( &amp;quot;object&amp;quot; )&lt;br /&gt;
for key, theObject in ipairs ( allObjects ) do&lt;br /&gt;
	local origX, origY, origZ = getElementPosition ( theObject ) --get the origanal position&lt;br /&gt;
	local newZ = origZ + 100 -- make a new z position&lt;br /&gt;
	moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 2:''' This example created a model (of a bed) near a player called ''someguy'', if they exist in the game. It will then move the model towards the player over 3 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find a player called 'someguy'&lt;br /&gt;
someGuy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If a player called someguy was found then&lt;br /&gt;
if ( someGuy ) then&lt;br /&gt;
	-- Get the player's position&lt;br /&gt;
	x, y, z = getElementPosition ( someGuy )&lt;br /&gt;
	-- Create a bed (1700) object near to the player&lt;br /&gt;
	bed = createObject ( 1700, x + 5, y, z )&lt;br /&gt;
	-- Move the bed towards the player over 3 seconds (3000 milliseconds)&lt;br /&gt;
	moveObject ( bed, 3000, x, y, z )&lt;br /&gt;
	-- Tell the player in the chat box&lt;br /&gt;
	outputChatBox ( &amp;quot;Moving a bed towards you!&amp;quot;, someGuy )&lt;br /&gt;
else&lt;br /&gt;
	-- Tell everyone that a player called 'someguy' could not be found&lt;br /&gt;
	outputChatBox ( &amp;quot;Player someguy doesn't exist&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 3:''' This example creates a ball moving (in front of CJ's house in Grove Street) using easing functions. Test command is &amp;quot;/smove&amp;quot; for instance &amp;quot;/smove OutBounce&amp;quot;. This example is a serverside code but the same could be done clientside (adapting the command handler)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local START_POS = {2497.203125, -1672.4864501953, 12.640947341919}&lt;br /&gt;
local STOP_POS = {2480.2595214844, -1666.521484375, 12.640114784241}&lt;br /&gt;
local MOTION_DURATION = 5000&lt;br /&gt;
local WAIT_DURATION = 1000&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;smove&amp;quot;,&lt;br /&gt;
function (player, cmd, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	local x, y, z = unpack(START_POS)&lt;br /&gt;
	local object = createObject(1598, x, y, z)&lt;br /&gt;
	x, y, z = unpack(STOP_POS)&lt;br /&gt;
	&lt;br /&gt;
	period = period or 0.3&lt;br /&gt;
	amplitude = amplitude or 1.0&lt;br /&gt;
	overshoot = overshoot or 1.70158&lt;br /&gt;
	&lt;br /&gt;
	outputChatBox(string.format(&amp;quot;Server Easing %s %s %s %s&amp;quot;, strEasingType, tostring(period), tostring(amplitude), tostring(overshoot)))&lt;br /&gt;
	moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 4:''' This example move gate with easing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&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;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=36980</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=36980"/>
		<updated>2013-08-26T20:26:01Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will smoothly move an object from its current position to a specified rotation and position.&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 moveObject ( object theObject, int time,&lt;br /&gt;
                  float targetx, float targety, float targetz, &lt;br /&gt;
                [ float moverx, float movery, float moverz,&lt;br /&gt;
                  string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theObject:''' The object that will be moved.&lt;br /&gt;
* '''time:''' The time in milliseconds the object will arrive at the destination.&lt;br /&gt;
* '''targetx:''' The X value of the target position&lt;br /&gt;
* '''targety:''' The Y value of the target position&lt;br /&gt;
* '''targetz:''' The Z value of the target position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''moverx:''' The rotation along the X axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''movery:''' The rotation along the Y axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''moverz:''' The rotation along the Z axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation (default is &amp;quot;Linear&amp;quot;)&lt;br /&gt;
*'''fEasingPeriod:''' the period of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingAmplitude:''' the amplitude of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingOvershoot:''' the overshoot of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function moved the object succesfully, and returns ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples ==&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;
'''Example 1:''' This example moves every object in the game up 100 units in ten seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
allObjects = getElementsByType ( &amp;quot;object&amp;quot; )&lt;br /&gt;
for key, theObject in ipairs ( allObjects ) do&lt;br /&gt;
	local origX, origY, origZ = getElementPosition ( theObject ) --get the origanal position&lt;br /&gt;
	local newZ = origZ + 100 -- make a new z position&lt;br /&gt;
	moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 2:''' This example created a model (of a bed) near a player called ''someguy'', if they exist in the game. It will then move the model towards the player over 3 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find a player called 'someguy'&lt;br /&gt;
someGuy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If a player called someguy was found then&lt;br /&gt;
if ( someGuy ) then&lt;br /&gt;
	-- Get the player's position&lt;br /&gt;
	x, y, z = getElementPosition ( someGuy )&lt;br /&gt;
	-- Create a bed (1700) object near to the player&lt;br /&gt;
	bed = createObject ( 1700, x + 5, y, z )&lt;br /&gt;
	-- Move the bed towards the player over 3 seconds (3000 milliseconds)&lt;br /&gt;
	moveObject ( bed, 3000, x, y, z )&lt;br /&gt;
	-- Tell the player in the chat box&lt;br /&gt;
	outputChatBox ( &amp;quot;Moving a bed towards you!&amp;quot;, someGuy )&lt;br /&gt;
else&lt;br /&gt;
	-- Tell everyone that a player called 'someguy' could not be found&lt;br /&gt;
	outputChatBox ( &amp;quot;Player someguy doesn't exist&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 3:''' This example creates a ball moving (in front of CJ's house in Grove Street) using easing functions. Test command is &amp;quot;/smove&amp;quot; for instance &amp;quot;/smove OutBounce&amp;quot;. This example is a serverside code but the same could be done clientside (adapting the command handler)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local START_POS = {2497.203125, -1672.4864501953, 12.640947341919}&lt;br /&gt;
local STOP_POS = {2480.2595214844, -1666.521484375, 12.640114784241}&lt;br /&gt;
local MOTION_DURATION = 5000&lt;br /&gt;
local WAIT_DURATION = 1000&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;smove&amp;quot;,&lt;br /&gt;
function (player, cmd, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	local x, y, z = unpack(START_POS)&lt;br /&gt;
	local object = createObject(1598, x, y, z)&lt;br /&gt;
	x, y, z = unpack(STOP_POS)&lt;br /&gt;
	&lt;br /&gt;
	period = period or 0.3&lt;br /&gt;
	amplitude = amplitude or 1.0&lt;br /&gt;
	overshoot = overshoot or 1.70158&lt;br /&gt;
	&lt;br /&gt;
	outputChatBox(string.format(&amp;quot;Server Easing %s %s %s %s&amp;quot;, strEasingType, tostring(period), tostring(amplitude), tostring(overshoot)))&lt;br /&gt;
	moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 4:''' This example move gate with easing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&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;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Easing&amp;diff=36979</id>
		<title>Easing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Easing&amp;diff=36979"/>
		<updated>2013-08-26T20:25:03Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Easing functions describe functions that control the way an interpolation between 0 and 1 is done.&lt;br /&gt;
&lt;br /&gt;
The most basic easing function, linear, is just a linear interpolation at constant speed. Other more advanced easing functions can have acceleration at the beginning, the end or both or deceleration, or even bouncing or elastic effects.&lt;br /&gt;
&lt;br /&gt;
= Preliminary note =&lt;br /&gt;
&lt;br /&gt;
In the functions using easing, there are usually 3 optional parameters. Most functions don't need them at all, the ones needing one or more parameters are listed in the table below. When providing optional parameters, all the parameters before a given parameter must be filled, even if the easing function you intend to use doesn't require such a parameter. In this case, simply use 0 for the parameters you don't need.&lt;br /&gt;
Examples:&lt;br /&gt;
* ''&amp;quot;Linear&amp;quot;'' can be used simply with ''getEasingValue( fProgress, &amp;quot;Linear&amp;quot; )''&lt;br /&gt;
* ''&amp;quot;OutElastic&amp;quot;'' can define ''fEasingPeriod'' and ''fEasingAmplitude'' so it can be used with ''getEasingValue( fProgress, &amp;quot;OutElastic&amp;quot;, 0.3, 1.0 )''&lt;br /&gt;
* ''&amp;quot;InBack&amp;quot;'' can define ''fEasingOvershoot'', but since it comes after ''fEasingPeriod'' and ''fEasingAmplitude'' in the order of parameters, 0 must be used for the others with ''getEasingValue( fProgress, &amp;quot;InBack&amp;quot;, 0, 0, 1.7015 )''&lt;br /&gt;
&lt;br /&gt;
= Easing functions =&lt;br /&gt;
&lt;br /&gt;
Default values are (when a function can use a parameter but it's not defined by the user):&lt;br /&gt;
* ''fEasingPeriod:'' 0.3&lt;br /&gt;
* ''fEasingAmplitude :'' 1.0&lt;br /&gt;
* ''fEasingOvershoot:'' 1.701&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; class=&amp;quot;unnamed1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Easing function&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Function profile&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingPeriod&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingAmplitude&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingOvershoot&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Comments&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Linear&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-linear.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;lt; 0&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;lt;0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;SineCurve&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-sincurve.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;This easing function doesn't end at 1 but goes back to 0. In this case, for interpolation, the target value is just an edge but doesn't represent the stop value.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;CosineCurve&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-coscurve.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;This easing function both starts and stops at 0.5, going first to 1 then 0. In this case, for interpolation, the source and target values are just the edges but don't represent the start/stop values.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples ==&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example move gate with easing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Source =&lt;br /&gt;
&lt;br /&gt;
The naming conventions of the functions below, available in [[moveObject]], [[interpolateBetween]], or [[getEasingValue]] have been extracted from [http://doc.qt.nokia.com/latest/qeasingcurve.html Qt documentation]. Only a subset of those functions is available in MTA since some of them are a bit redundant (only the profile of the acceleration/deceleration changes).&lt;br /&gt;
The pictures of the easing functions are directly extracted from Qt documentation, © 2008-2010 Nokia Corporation and/or its subsidiaries.&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Easing&amp;diff=36978</id>
		<title>Easing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Easing&amp;diff=36978"/>
		<updated>2013-08-26T20:24:49Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Easing functions describe functions that control the way an interpolation between 0 and 1 is done.&lt;br /&gt;
&lt;br /&gt;
The most basic easing function, linear, is just a linear interpolation at constant speed. Other more advanced easing functions can have acceleration at the beginning, the end or both or deceleration, or even bouncing or elastic effects.&lt;br /&gt;
&lt;br /&gt;
= Preliminary note =&lt;br /&gt;
&lt;br /&gt;
In the functions using easing, there are usually 3 optional parameters. Most functions don't need them at all, the ones needing one or more parameters are listed in the table below. When providing optional parameters, all the parameters before a given parameter must be filled, even if the easing function you intend to use doesn't require such a parameter. In this case, simply use 0 for the parameters you don't need.&lt;br /&gt;
Examples:&lt;br /&gt;
* ''&amp;quot;Linear&amp;quot;'' can be used simply with ''getEasingValue( fProgress, &amp;quot;Linear&amp;quot; )''&lt;br /&gt;
* ''&amp;quot;OutElastic&amp;quot;'' can define ''fEasingPeriod'' and ''fEasingAmplitude'' so it can be used with ''getEasingValue( fProgress, &amp;quot;OutElastic&amp;quot;, 0.3, 1.0 )''&lt;br /&gt;
* ''&amp;quot;InBack&amp;quot;'' can define ''fEasingOvershoot'', but since it comes after ''fEasingPeriod'' and ''fEasingAmplitude'' in the order of parameters, 0 must be used for the others with ''getEasingValue( fProgress, &amp;quot;InBack&amp;quot;, 0, 0, 1.7015 )''&lt;br /&gt;
&lt;br /&gt;
= Easing functions =&lt;br /&gt;
&lt;br /&gt;
Default values are (when a function can use a parameter but it's not defined by the user):&lt;br /&gt;
* ''fEasingPeriod:'' 0.3&lt;br /&gt;
* ''fEasingAmplitude :'' 1.0&lt;br /&gt;
* ''fEasingOvershoot:'' 1.701&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; class=&amp;quot;unnamed1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Easing function&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Function profile&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingPeriod&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingAmplitude&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingOvershoot&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Comments&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Linear&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-linear.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;lt; 0&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;lt;0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;SineCurve&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-sincurve.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;This easing function doesn't end at 1 but goes back to 0. In this case, for interpolation, the target value is just an edge but doesn't represent the stop value.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;CosineCurve&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-coscurve.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;This easing function both starts and stops at 0.5, going first to 1 then 0. In this case, for interpolation, the source and target values are just the edges but don't represent the start/stop values.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples ==&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example move gate with anim.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Source =&lt;br /&gt;
&lt;br /&gt;
The naming conventions of the functions below, available in [[moveObject]], [[interpolateBetween]], or [[getEasingValue]] have been extracted from [http://doc.qt.nokia.com/latest/qeasingcurve.html Qt documentation]. Only a subset of those functions is available in MTA since some of them are a bit redundant (only the profile of the acceleration/deceleration changes).&lt;br /&gt;
The pictures of the easing functions are directly extracted from Qt documentation, © 2008-2010 Nokia Corporation and/or its subsidiaries.&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Easing&amp;diff=36977</id>
		<title>Easing</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Easing&amp;diff=36977"/>
		<updated>2013-08-26T20:24:25Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Easing functions describe functions that control the way an interpolation between 0 and 1 is done.&lt;br /&gt;
&lt;br /&gt;
The most basic easing function, linear, is just a linear interpolation at constant speed. Other more advanced easing functions can have acceleration at the beginning, the end or both or deceleration, or even bouncing or elastic effects.&lt;br /&gt;
&lt;br /&gt;
= Preliminary note =&lt;br /&gt;
&lt;br /&gt;
In the functions using easing, there are usually 3 optional parameters. Most functions don't need them at all, the ones needing one or more parameters are listed in the table below. When providing optional parameters, all the parameters before a given parameter must be filled, even if the easing function you intend to use doesn't require such a parameter. In this case, simply use 0 for the parameters you don't need.&lt;br /&gt;
Examples:&lt;br /&gt;
* ''&amp;quot;Linear&amp;quot;'' can be used simply with ''getEasingValue( fProgress, &amp;quot;Linear&amp;quot; )''&lt;br /&gt;
* ''&amp;quot;OutElastic&amp;quot;'' can define ''fEasingPeriod'' and ''fEasingAmplitude'' so it can be used with ''getEasingValue( fProgress, &amp;quot;OutElastic&amp;quot;, 0.3, 1.0 )''&lt;br /&gt;
* ''&amp;quot;InBack&amp;quot;'' can define ''fEasingOvershoot'', but since it comes after ''fEasingPeriod'' and ''fEasingAmplitude'' in the order of parameters, 0 must be used for the others with ''getEasingValue( fProgress, &amp;quot;InBack&amp;quot;, 0, 0, 1.7015 )''&lt;br /&gt;
&lt;br /&gt;
= Easing functions =&lt;br /&gt;
&lt;br /&gt;
Default values are (when a function can use a parameter but it's not defined by the user):&lt;br /&gt;
* ''fEasingPeriod:'' 0.3&lt;br /&gt;
* ''fEasingAmplitude :'' 1.0&lt;br /&gt;
* ''fEasingOvershoot:'' 1.701&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; class=&amp;quot;unnamed1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Easing function&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Function profile&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingPeriod&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingAmplitude&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th align=&amp;quot;center&amp;quot;&amp;gt;Uses fEasingOvershoot&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Comments&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;Linear&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-linear.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInQuad&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinquad.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInElastic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinelastic.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to the elastic effect, this easing function produces some values &amp;lt; 0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;lt; 0&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Due to overshoot, this easing function produces some values &amp;lt;0 and &amp;gt; 1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInBack&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinback.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;InOutBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-inoutbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;OutInBounce&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-outinbounce.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;yes&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;SineCurve&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-sincurve.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;This easing function doesn't end at 1 but goes back to 0. In this case, for interpolation, the target value is just an edge but doesn't represent the stop value.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;CosineCurve&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;[[File:Qeasingcurve-coscurve.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;This easing function both starts and stops at 0.5, going first to 1 then 0. In this case, for interpolation, the source and target values are just the edges but don't represent the start/stop values.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples ==&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 4:''' This example move gate with anim.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Source =&lt;br /&gt;
&lt;br /&gt;
The naming conventions of the functions below, available in [[moveObject]], [[interpolateBetween]], or [[getEasingValue]] have been extracted from [http://doc.qt.nokia.com/latest/qeasingcurve.html Qt documentation]. Only a subset of those functions is available in MTA since some of them are a bit redundant (only the profile of the acceleration/deceleration changes).&lt;br /&gt;
The pictures of the easing functions are directly extracted from Qt documentation, © 2008-2010 Nokia Corporation and/or its subsidiaries.&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=36976</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=36976"/>
		<updated>2013-08-26T20:21:36Z</updated>

		<summary type="html">&lt;p&gt;WASSIm.: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will smoothly move an object from its current position to a specified rotation and position.&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 moveObject ( object theObject, int time,&lt;br /&gt;
                  float targetx, float targety, float targetz, &lt;br /&gt;
                [ float moverx, float movery, float moverz,&lt;br /&gt;
                  string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theObject:''' The object that will be moved.&lt;br /&gt;
* '''time:''' The time in milliseconds the object will arrive at the destination.&lt;br /&gt;
* '''targetx:''' The X value of the target position&lt;br /&gt;
* '''targety:''' The Y value of the target position&lt;br /&gt;
* '''targetz:''' The Z value of the target position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''moverx:''' The rotation along the X axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''movery:''' The rotation along the Y axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
* '''moverz:''' The rotation along the Z axis '''relative''' to its current rotation, which is its starting angle.&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation (default is &amp;quot;Linear&amp;quot;)&lt;br /&gt;
*'''fEasingPeriod:''' the period of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingAmplitude:''' the amplitude of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
*'''fEasingOvershoot:''' the overshoot of the [[Easing|easing function]] (only some easing functions use this parameter)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function moved the object succesfully, and returns ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples ==&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;
'''Example 1:''' This example moves every object in the game up 100 units in ten seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
allObjects = getElementsByType ( &amp;quot;object&amp;quot; )&lt;br /&gt;
for key, theObject in ipairs ( allObjects ) do&lt;br /&gt;
	local origX, origY, origZ = getElementPosition ( theObject ) --get the origanal position&lt;br /&gt;
	local newZ = origZ + 100 -- make a new z position&lt;br /&gt;
	moveObject ( theObject, 10000, origX, origY, newZ ) --move the object to this position in 10 seconds.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 2:''' This example created a model (of a bed) near a player called ''someguy'', if they exist in the game. It will then move the model towards the player over 3 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find a player called 'someguy'&lt;br /&gt;
someGuy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If a player called someguy was found then&lt;br /&gt;
if ( someGuy ) then&lt;br /&gt;
	-- Get the player's position&lt;br /&gt;
	x, y, z = getElementPosition ( someGuy )&lt;br /&gt;
	-- Create a bed (1700) object near to the player&lt;br /&gt;
	bed = createObject ( 1700, x + 5, y, z )&lt;br /&gt;
	-- Move the bed towards the player over 3 seconds (3000 milliseconds)&lt;br /&gt;
	moveObject ( bed, 3000, x, y, z )&lt;br /&gt;
	-- Tell the player in the chat box&lt;br /&gt;
	outputChatBox ( &amp;quot;Moving a bed towards you!&amp;quot;, someGuy )&lt;br /&gt;
else&lt;br /&gt;
	-- Tell everyone that a player called 'someguy' could not be found&lt;br /&gt;
	outputChatBox ( &amp;quot;Player someguy doesn't exist&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 3:''' This example creates a ball moving (in front of CJ's house in Grove Street) using easing functions. Test command is &amp;quot;/smove&amp;quot; for instance &amp;quot;/smove OutBounce&amp;quot;. This example is a serverside code but the same could be done clientside (adapting the command handler)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local START_POS = {2497.203125, -1672.4864501953, 12.640947341919}&lt;br /&gt;
local STOP_POS = {2480.2595214844, -1666.521484375, 12.640114784241}&lt;br /&gt;
local MOTION_DURATION = 5000&lt;br /&gt;
local WAIT_DURATION = 1000&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;smove&amp;quot;,&lt;br /&gt;
function (player, cmd, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	local x, y, z = unpack(START_POS)&lt;br /&gt;
	local object = createObject(1598, x, y, z)&lt;br /&gt;
	x, y, z = unpack(STOP_POS)&lt;br /&gt;
	&lt;br /&gt;
	period = period or 0.3&lt;br /&gt;
	amplitude = amplitude or 1.0&lt;br /&gt;
	overshoot = overshoot or 1.70158&lt;br /&gt;
	&lt;br /&gt;
	outputChatBox(string.format(&amp;quot;Server Easing %s %s %s %s&amp;quot;, strEasingType, tostring(period), tostring(amplitude), tostring(overshoot)))&lt;br /&gt;
	moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot)&lt;br /&gt;
	setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 4:''' This example move gate with anim.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z = 2096.3, 1721, 12.7&lt;br /&gt;
local easing = &amp;quot;OutBounce&amp;quot;&lt;br /&gt;
local time = 2000&lt;br /&gt;
local gate = createObject(980, x,y,z, 0, 0, 63)&lt;br /&gt;
local marker = createMarker(x,y,z, &amp;quot;cylinder&amp;quot;, 12, 0, 0, 0, 0)&lt;br /&gt;
 &lt;br /&gt;
function moveGate(hitPlayer, matchingDimension)&lt;br /&gt;
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerHit&amp;quot;, marker, moveGate)&lt;br /&gt;
 &lt;br /&gt;
function moveBack()&lt;br /&gt;
    moveObject(gate, time, x, y, z, 0, 0, 0, easing)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onMarkerLeave&amp;quot;, marker, moveBack)&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;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>WASSIm.</name></author>
	</entry>
</feed>