<?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=LuXorioN</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=LuXorioN"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/LuXorioN"/>
	<updated>2026-05-13T06:22:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Bone_attach&amp;diff=62833</id>
		<title>Resource:Bone attach</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Bone_attach&amp;diff=62833"/>
		<updated>2019-05-28T09:49:09Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixed available bone IDs being incorrect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This resource lets you attach elements to players/peds bones using its exported functions.&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=2540 MTA community page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=5138 Devan_LT] (also known as [https://forum.mtasa.com/profile/1985-crystalmv/ CrystalMV])&lt;br /&gt;
&lt;br /&gt;
==Exported functions/events==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server or Client&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function attaches element to the bone of the ped or player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool attachElementToBone (element theElement, element theAttachToPed, int theBone[, float xPosOffset = 0, float yPosOffset = 0, float zPosOffset = 0, float xRotOffset = 0, float yRotOffset = 0, float zRotOffset = 0])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to attach..&lt;br /&gt;
*'''theAttachToPed:''' The ped or player which you want to attach element to.&lt;br /&gt;
*'''theBone:''' The number of the ped or player's bone which you want to attach element to.&lt;br /&gt;
[[Image:Bones.jpg|thumb|Bone numbers]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 3px red solid; margin-bottom:3px; padding-left:5px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''1:'''  head&lt;br /&gt;
*'''2:'''  neck&lt;br /&gt;
*'''3:'''  spine&lt;br /&gt;
*'''4:'''  pelvis&lt;br /&gt;
*'''5:'''  left clavicle&lt;br /&gt;
*'''6:'''  right clavicle&lt;br /&gt;
*'''7:'''  left shoulder&lt;br /&gt;
*'''8:'''  right shoulder&lt;br /&gt;
*'''9:'''  left elbow&lt;br /&gt;
*'''10:'''  right elbow&lt;br /&gt;
*'''11:'''  left hand&lt;br /&gt;
*'''12:'''  right hand&lt;br /&gt;
*'''13:'''  left hip&lt;br /&gt;
*'''14:'''  right hip&lt;br /&gt;
*'''15:'''  left knee&lt;br /&gt;
*'''16:'''  right knee&lt;br /&gt;
*'''17:'''  left ankle&lt;br /&gt;
*'''18:'''  right ankle&lt;br /&gt;
*'''19:'''  left foot&lt;br /&gt;
*'''20:'''  right foot&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
====Optional arguments====&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''xPosOffset:''' The x offset, if you want the elements to be a certain distance from one another (default 0).&lt;br /&gt;
*'''yPosOffset:''' The y offset (default 0).&lt;br /&gt;
*'''zPosOffset:''' The z offset (default 0).&lt;br /&gt;
*'''xRotOffset:''' The x rotation offset (default 0).&lt;br /&gt;
*'''yRotOffset:''' The y rotation offset (default 0).&lt;br /&gt;
*'''zRotOffset:''' The z rotation offset (default 0).&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if element was successfully attached, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function detaches element from the bone of the ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool detachElementFromBone (element theElement)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to detach.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if element was successfully detached, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function checks if element is attached to a bone.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isElementAttachedToBone (element theElement)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to check.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if element is attached to a bone, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function gets ped, bone and offset details of attached element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getElementBoneAttachmentDetails (element theElement)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to get attachment details of.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns ped, bone, x, y, z, rx, ry, rz used in attachElementToBone if element is attached, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function changes position offset of attached element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementBonePositionOffset (element theElement, float xPosOffset, float yPosOffset, float zPosOffset)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change offset of.&lt;br /&gt;
*'''xPosOffset:''' New x position offset.&lt;br /&gt;
*'''yPosOffset:''' New y position offset.&lt;br /&gt;
*'''zPosOffset:''' New z position offset.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if position set successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This function changes rotation offset of attached element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementBoneRotationOffset (element theElement, float xRotOffset, float yRotOffset, float zRotOffset)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theElement:''' Element which you want to change offset of.&lt;br /&gt;
*'''xRotOffset:''' New x rotation offset.&lt;br /&gt;
*'''yRotOffset:''' New y rotation offset.&lt;br /&gt;
*'''zRotOffset:''' New z rotation offset.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns true if rotation set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client-Only&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function gets position and rotation of the ped bone.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBonePositionAndRotation (element theAttachToPed, int theBone)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''theAttachToPed:''' The ped or player which bone you want to get position.&lt;br /&gt;
*'''theBone:''' The number of the ped or player's bone which you want to get position.&lt;br /&gt;
====Returns====&lt;br /&gt;
Returns bone x, y, z position and rotation if ped is streamed in and bone number is valid, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example makes the player carry a money bag when they type 'getbag':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- this function is called whenever someone types 'getbag' in the console:&lt;br /&gt;
function attachCash (thePlayer)&lt;br /&gt;
    local x, y, z = getElementPosition (thePlayer)&lt;br /&gt;
    setPedAnimation (thePlayer, &amp;quot;ROB_BANK&amp;quot;, &amp;quot;CAT_Safe_Rob&amp;quot;, -1, true, false, false)&lt;br /&gt;
    local objPick = createObject (1550, x, y, z)&lt;br /&gt;
    setTimer (function (thePlayer)&lt;br /&gt;
        setPedAnimation (thePlayer, nil)&lt;br /&gt;
        exports.bone_attach:attachElementToBone (objPick, thePlayer, 4, -0.3, 0.2, 0, -125, 0, 0)&lt;br /&gt;
    end, 1000, 1, thePlayer)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler (&amp;quot;getbag&amp;quot;, attachCash)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Connection_functions&amp;diff=43400</id>
		<title>Template:Connection functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Connection_functions&amp;diff=43400"/>
		<updated>2014-12-19T00:08:36Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Created page with &amp;quot;* create * query * exec &amp;lt;noinclude&amp;gt;Category:Functions templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[create]]&lt;br /&gt;
* [[query]]&lt;br /&gt;
* [[exec]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Connection&amp;diff=43399</id>
		<title>Element/Connection</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Connection&amp;diff=43399"/>
		<updated>2014-12-19T00:04:56Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Created page with &amp;quot;==Related scripting functions== ===Server=== {{connection functions}} Category:Scripting Concepts&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Related scripting functions==&lt;br /&gt;
===Server===&lt;br /&gt;
{{connection functions}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MTA_Classes&amp;diff=43398</id>
		<title>MTA Classes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MTA_Classes&amp;diff=43398"/>
		<updated>2014-12-19T00:01:45Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to perform operations on MTA objects via scripting, pointers to internal classes are exported to scripts as Lua userdata. Each of these classes has a number of exported scripting functions associated to them.&lt;br /&gt;
&lt;br /&gt;
Elements that have a physical representation in the game are also known as [[entity|Entities]].&lt;br /&gt;
&lt;br /&gt;
The complete list of classes to be found in scripts follows:&lt;br /&gt;
&lt;br /&gt;
* [[account|Account]]&lt;br /&gt;
* [[acl|ACL]]&lt;br /&gt;
* [[aclgroup|ACL group]]&lt;br /&gt;
* [[Ban]]&lt;br /&gt;
* [[element|Element]]&lt;br /&gt;
&amp;lt;ul&amp;gt;{{Elements}}&amp;lt;/ul&amp;gt;&lt;br /&gt;
* [[resource|Resource]]&lt;br /&gt;
* [[textdisplay|Text display]]&lt;br /&gt;
* [[textitem|Text item]]&lt;br /&gt;
* [[timer|Timer]]&lt;br /&gt;
* [[xmlnode|XML node]]&lt;br /&gt;
* [[connection|Connection]]&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[es:Clases MTA]]&lt;br /&gt;
[[it:Classi di MTA]]&lt;br /&gt;
[[ru:Классы MTA]]&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxSetShaderTransform&amp;diff=42897</id>
		<title>DxSetShaderTransform</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxSetShaderTransform&amp;diff=42897"/>
		<updated>2014-11-18T08:36:28Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function applies a 3D transformation to a [[shader]] element when it is drawn with [[dxDrawImage]].&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 dxSetShaderTransform ( element theShader, float rotationX, float rotationY, float rotationZ, [ float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, float rotationCenterOffsetZ = 0, bool bRotationCenterOffsetOriginIsScreen = false, float perspectiveCenterOffsetX = 0, float perspectiveCenterOffsetY = 0, bool bPerspectiveCenterOffsetOriginIsScreen = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theShader:''' The shader element whose transformation is to be changed&lt;br /&gt;
*'''rotationX:''' Rotation angle in degrees around the X axis (Left,right). This will make the shader rotate along its width.&lt;br /&gt;
*'''rotationY:''' Rotation angle in degrees around the Y axis (Up,down). This will make the shader rotate along its height.&lt;br /&gt;
*'''rotationZ:''' Rotation angle in degrees around the Z axis (In,out). This will make the shader rotate in a similar way to the rotation argument in [[dxDrawImage]].&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''rotationCenterOffsetX :''' The center of rotation offset X position in screen relative units.&lt;br /&gt;
*'''rotationCenterOffsetY :''' The center of rotation offset Y position in screen relative units.&lt;br /&gt;
*'''rotationCenterOffsetZ :''' The center of rotation offset Z position in screen relative units.&lt;br /&gt;
*'''bRotationCenterOffsetOriginIsScreen :''' Set to [[boolean|true]] if the center of rotation origin should be the center of the screen rather than the center of the image.&lt;br /&gt;
*'''perspectiveCenterOffsetX :''' The center of perspective offset X position in screen relative units.&lt;br /&gt;
*'''perspectiveCenterOffsetY :''' The center of perspective offset Y position in screen relative units.&lt;br /&gt;
*'''bPerspectiveCenterOffsetOriginIsScreen :''' Set to [[boolean|true]] if the center of perspective origin should be the center of the screen rather than the center of the image.&lt;br /&gt;
&lt;br /&gt;
To convert screen relative units into screen pixel coordinates, ''multiply'' by the screen size. Conversely, to convert screen pixel coordinates to screen relative units, '''''divide''''' by the screen size.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the shader element's transform was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.2.0-9.03618|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialSectionLine3D&amp;diff=42896</id>
		<title>DxDrawMaterialSectionLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialSectionLine3D&amp;diff=42896"/>
		<updated>2014-11-18T08:35:32Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&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 dxDrawMaterialSectionLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, float u, float v, float usize, float vsize, element material, int width [, int color = white, float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section &lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section &lt;br /&gt;
*'''usize:''' the absolute width of the section&lt;br /&gt;
*'''vsize:''' the absolute height of the section&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
* '''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example draws corona like effects near the player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
coronaTexture = dxCreateTexture(&amp;quot;corona.png&amp;quot;)&lt;br /&gt;
red = tocolor(255,0,0)&lt;br /&gt;
green = tocolor(0,255,0)&lt;br /&gt;
blue = tocolor(0,0,255)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
    function()&lt;br /&gt;
        local x,y,z = getElementPosition(localPlayer)&lt;br /&gt;
&lt;br /&gt;
        dxSetBlendMode(&amp;quot;add&amp;quot;)   -- Add blend mode looks best for corona effects&lt;br /&gt;
        drawCorona( x+2, y+2, z+1, 1, red )&lt;br /&gt;
        drawCorona( x+1, y+3, z+2, 1, green )&lt;br /&gt;
        drawCorona( x-1, y+2, z+3, 1, blue )&lt;br /&gt;
        dxSetBlendMode(&amp;quot;blend&amp;quot;) -- Restore default&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Draw the corona texture&lt;br /&gt;
function drawCorona( x, y, z, size, color )&lt;br /&gt;
    dxDrawMaterialSectionLine3D ( x, y, z+size,&lt;br /&gt;
                                  x, y, z-size,&lt;br /&gt;
                                  0,0,1,1, coronaTexture, size, color)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawText&amp;diff=42895</id>
		<title>DxDrawText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawText&amp;diff=42895"/>
		<updated>2014-11-18T08:34:27Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
&lt;br /&gt;
Draws a string of text on the screen for one frame. In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).&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 dxDrawText ( string text, float left, float top [, float right=left, float bottom=top, int color=white, float scale=1, mixed font=&amp;quot;default&amp;quot;, string alignX=&amp;quot;left&amp;quot;, string alignY=&amp;quot;top&amp;quot;, bool clip=false, bool wordBreak=false, bool postGUI=false, bool colorCoded=false, bool subPixelPositioning=false, float fRotation=0, float fRotationCenterX=0, float fRotationCenterY=0 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''text:''' the text to draw&lt;br /&gt;
*'''left:''' the absolute X coordinate of the top left corner of the text&lt;br /&gt;
*'''top:''' the absolute Y coordinate of the top left corner of the text&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''right:''' the absolute X coordinate of the right side of the text bounding box. Used for text aligning, clipping and word breaking.&lt;br /&gt;
*'''bottom:''' the absolute Y coordinate of the bottom side of the text bounding box. Used for text aligning, clipping and word breaking.&lt;br /&gt;
*'''color:''' the color of the text, a value produced by [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
*'''scale:''' the size of the text.{{New feature|3.0110|1.1|'''scale:''' can (optionally) be specified as two floats. i.e. '''scaleX, scaleY'''}}&lt;br /&gt;
*'''font:''' Either a custom [[DX font]] element or the name of a built-in DX font:&lt;br /&gt;
{{DxFonts}}&lt;br /&gt;
*'''alignX:''' horizontal alignment of the text within the bounding box. Can be '''&amp;quot;left&amp;quot;''', '''&amp;quot;center&amp;quot;''' or '''&amp;quot;right&amp;quot;'''.&lt;br /&gt;
*'''alignY:''' vertical alignment of the text within the bounding box. Can be '''&amp;quot;top&amp;quot;''', '''&amp;quot;center&amp;quot;''' or '''&amp;quot;bottom&amp;quot;'''.&lt;br /&gt;
*'''clip:''' if set to ''true'', the parts of the text that don't fit within the bounding box will be cut off.&lt;br /&gt;
*'''wordBreak:''' if set to ''true'', the text will wrap to a new line whenever it reaches the right side of the bounding box. If ''false'', the text will always be completely on one line.&lt;br /&gt;
* '''postGUI:''' A bool representing whether the text should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
{{New feature/item|9.03986|1.3.0|3986|&lt;br /&gt;
*'''colorCoded:''' Set to true to enable embedded #FFFFFF color codes. '''Note: clip and wordBreak are forced false if this is set.'''&lt;br /&gt;
*'''subPixelPositioning:''' A bool representing whether the text can be positioned sub-pixel-ly. Looks nicer for moving/scaling animations.&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|9.06054|1.3.5|6054|&lt;br /&gt;
*'''fRotation:''' Rotation'''&lt;br /&gt;
*'''fRotationCenterX:''' Rotation Origin X'''&lt;br /&gt;
*'''fRotationCenterY:''' Rotation Origin Y'''&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example code will add the current zone name in the lower left corner of the players' screens.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function createText ( )&lt;br /&gt;
    local playerX, playerY, playerZ = getElementPosition ( localPlayer )       -- Get our player's coordinates.&lt;br /&gt;
    local playerZoneName = getZoneName ( playerX, playerY, playerZ )          -- Get name of the zone the player is in.&lt;br /&gt;
&lt;br /&gt;
    -- Draw zone name text's shadow.&lt;br /&gt;
    dxDrawText ( playerZoneName, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, &amp;quot;pricedown&amp;quot; )&lt;br /&gt;
    -- Draw zone name text.&lt;br /&gt;
    dxDrawText ( playerZoneName, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, &amp;quot;pricedown&amp;quot; ) &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function HandleTheRendering ( )&lt;br /&gt;
    addEventHandler ( &amp;quot;onClientRender&amp;quot;, root, createText ) -- keep the text visible with onClientRender.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, HandleTheRendering )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.03986|Added colorCoded and subPixelPositioning arguments}}&lt;br /&gt;
{{ChangelogItem|1.3.5-9.06054|Added fRotation, fRotationCenterX and fRotationCenterY arguments}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&amp;diff=42894</id>
		<title>DxDrawImageSection</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImageSection&amp;diff=42894"/>
		<updated>2014-11-18T08:33:16Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
Differing from [[dxDrawImage]], this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).&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 dxDrawImageSection ( float posX, float posY, float width, float height, float u, float v, float usize, float vsize, mixed image, [ float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = white, bool postGUI = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''posX:''' the absolute X coordinate of the top left corner of the image&lt;br /&gt;
*'''posY:''' the absolute Y coordinate of the top left corner of the image&lt;br /&gt;
*'''width:''' the absolute width of the image&lt;br /&gt;
*'''height:''' the absolute height of the image&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section which should be drawn from image&lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section which should be drawn from image&lt;br /&gt;
*'''usize:''' the absolute width of the image section&lt;br /&gt;
*'''vsize:''' the absolute height of the image section&lt;br /&gt;
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''rotation:''' the rotation, in degrees for the image.&lt;br /&gt;
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''color:''' the color of the image, a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
The example draws a section of an image. (You can use [http://i1325.photobucket.com/albums/u630/Tourmalinelisa2/128x128.jpg this] image to test.)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientRender', root, function()&lt;br /&gt;
  dxDrawImageSection(400, 200, 64, 64, 0, 0, 64, 64, 'img.jpg') -- Draw a certain section&lt;br /&gt;
  dxDrawImage(400, 300, 128, 128, 'img.jpg') -- Draw the whole image to be able to identify the difference&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=42893</id>
		<title>DxDrawMaterialLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=42893"/>
		<updated>2014-11-18T08:32:16Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&lt;br /&gt;
&lt;br /&gt;
3D lines are drawn at a particular place in the [[Game_Processing_Order|game processing order]], so use [[onClientPreRender]] for drawing if you are attaching them to world elements.&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 dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, element material, int width, [, int color = white, float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Draws an Image ( &amp;quot;test.png&amp;quot; Download : [http://i.epvpimg.com/dwsTe.png test.png] ) from the Position 0,0,3 to 0,0,15&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local img = dxCreateTexture(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()  -- x,y,z, targetx,targety,targetz,texture,width,color&lt;br /&gt;
		dxDrawMaterialLine3D (0,0,3,0,0,15,img, 7, tocolor(255,255,255,255))&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;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateTexture&amp;diff=42892</id>
		<title>DxCreateTexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateTexture&amp;diff=42892"/>
		<updated>2014-11-18T08:31:31Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a [[texture]] element that can be used in the dxDraw functions.&lt;br /&gt;
&lt;br /&gt;
It is possible to use dxCreateTexture to load cubemaps and volume textures, but these will only be useable as inputs for a shader. The Microsoft utility [http://nightly.mtasa.com/files/shaders/DxTex.zip DxTex] can view and change cubemaps and volume textures. DxTex can also convert standard textures into DXT1/3/5 compressed .dds which should reduce file sizes.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element dxCreateTexture ( string filepath [, string textureFormat = &amp;quot;argb&amp;quot;, bool mipmaps = true, string textureEdge = &amp;quot;wrap&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element dxCreateTexture ( string pixels [, string textureFormat = &amp;quot;argb&amp;quot;, bool mipmaps = true, string textureEdge = &amp;quot;wrap&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element dxCreateTexture ( int width, int height [, string textureFormat = &amp;quot;argb&amp;quot;, string textureEdge = &amp;quot;wrap&amp;quot;, string textureType = &amp;quot;2d&amp;quot;, int depth = 1 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''filepath:''' The filepath of the image. (.bmp, .dds, .jpg, .png, and .tga images are supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
or&lt;br /&gt;
*'''pixels:''' [[Texture_pixels|Pixels]] containing image data. ('plain', 'jpeg' or 'png' pixels can be used here)&lt;br /&gt;
or&lt;br /&gt;
*'''width:''' Desired width (Must be a power of two. e.g. 128, 256)&lt;br /&gt;
*'''height :''' Desired height (Must be a power of two. e.g. 128, 256)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''textureFormat :''' A string representing the desired texture format, which can be one of:&lt;br /&gt;
**'''&amp;quot;argb&amp;quot;''' : ARGB uncompressed 32 bit color (default)&lt;br /&gt;
**'''&amp;quot;dxt1&amp;quot;''' : DXT1 compressed - Can take a fraction of a second longer to load (unless the file is already a DXT1 .dds). Uses 8 times less video memory than ARGB and can '''speed up drawing'''. Quality not as good as ARGB and does not support alpha blending.&lt;br /&gt;
**'''&amp;quot;dxt3&amp;quot;''' : DXT3 compressed - Can take a fraction of a second longer to load (unless the file is already a DXT3 .dds). Uses 4 times less video memory than ARGB and can '''speed up drawing'''. Quality slightly better than DXT1 and supports smooth alpha blending.&lt;br /&gt;
**'''&amp;quot;dxt5&amp;quot;''' : DXT5 compressed - Can take a fraction of a second longer to load (unless the file is already a DXT5 .dds). Uses 4 times less video memory than ARGB and can '''speed up drawing'''. Quality slightly better than DXT1 and supports crisp alpha blending.&lt;br /&gt;
*'''mipmaps :''' True to create a mip-map chain so the texture looks good when drawn at various sizes.&lt;br /&gt;
*'''textureEdge :''' A string representing the desired texture edge handling, which can be one of:&lt;br /&gt;
**'''&amp;quot;wrap&amp;quot;''' : Wrap the texture at the edges (default)&lt;br /&gt;
**'''&amp;quot;clamp&amp;quot;''' : Clamp the texture at the edges. This may help avoid edge artifacts.&lt;br /&gt;
*'''textureType :''' A string representing the desired texture type, which can be one of:&lt;br /&gt;
**'''&amp;quot;2d&amp;quot;''' : Standard texture (default)&lt;br /&gt;
**'''&amp;quot;3d&amp;quot;''' : Volume texture&lt;br /&gt;
**'''&amp;quot;cube&amp;quot;''' : Cube map&lt;br /&gt;
*'''depth:''' Desired number of slices when creating a volume texture&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a [[texture]] if successful, ''false'' if invalid arguments were passed to the function.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myImage then&lt;br /&gt;
            dxDrawImage( 100, 350, 300, 350, myImage  )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Use 'toggle' command to switch image on and off&lt;br /&gt;
addCommandHandler( &amp;quot;toggle&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not myImage then&lt;br /&gt;
            myImage = dxCreateTexture( &amp;quot;moonpig.png&amp;quot; )  -- Create texture&lt;br /&gt;
        else        &lt;br /&gt;
            destroyElement( myImage )                 -- Destroy texture&lt;br /&gt;
            myImage = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04021|Added textureType and depth argument}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04035|Added textureEdge argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=42891</id>
		<title>GetWaterLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetWaterLevel&amp;diff=42891"/>
		<updated>2014-11-18T08:30:33Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function allows you to retrieve the water level from a certain location. The water level is 0 in most places though it can vary (e.g. it's higher near the dam).&lt;br /&gt;
{{Note|Some small water areas within parts of the city do not count as water to be used with this function. For example, the shallow water area in Northwest San Fierro.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float getWaterLevel ( float posX, float posY, float posZ [ , bool bCheckWaves = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float getWaterLevel ( water theWater )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' The X axis position&lt;br /&gt;
*'''y:''' The Y axis position&lt;br /&gt;
*'''z:''' The Z axis position&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
*'''theWater:''' the water element&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''bCheckWaves''' Include the water levels of waves in the ocean, lakes and ...&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''integer'' of the water level if the [[localPlayer]]/position is near the water (-3 to 20 on the Z coordinate) else ''false'' if there's no water near the [[localPlayer]]/position.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will tell you what's the water level where the specified player is located.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptGetLevel ( command, playername ) --when getlevel is called&lt;br /&gt;
  local thePlayer = getPlayerFromName ( playername ) --get the player from nickname&lt;br /&gt;
  if ( thePlayer ~= false ) then --if there is a player from the nickname&lt;br /&gt;
    local x, y, z = getElementPosition ( thePlayer ) -- get his position&lt;br /&gt;
    local level = getWaterLevel ( x, y, z )&lt;br /&gt;
	  if level then -- if it's not false&lt;br /&gt;
        level = z - level -- calculate how far away is he from the water&lt;br /&gt;
        outputChatBox( &amp;quot;You are &amp;quot; .. level .. &amp;quot; units away from the water!&amp;quot;, source )&lt;br /&gt;
	  else outputChatBox ( &amp;quot;There's no sign of water&amp;quot; )&lt;br /&gt;
	  end&lt;br /&gt;
  else outputChatBox ( &amp;quot;Player does not exist&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;getlevel&amp;quot;, scriptGetLevel ) -- add a command &amp;quot;getloc&amp;quot; which&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawImage&amp;diff=42890</id>
		<title>DxDrawImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawImage&amp;diff=42890"/>
		<updated>2014-11-18T08:29:54Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
&lt;br /&gt;
Draws an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [[onClientRender]]).&amp;lt;br/&amp;gt;&lt;br /&gt;
Image files should ideally have dimensions that are a power of two, to prevent possible blurring.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...&amp;lt;/b&amp;gt;&lt;br /&gt;
{{Note|To help prevent edge artifacts when drawing textures, set '''textureEdge''' to '''&amp;quot;clamp&amp;quot;''' when calling [[dxCreateTexture]]}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawImage ( float posX, float posY, float width, float height, mixed image [, float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = tocolor(255,255,255,255), bool postGUI = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''posX:''' the absolute X coordinate of the top left corner of the image&lt;br /&gt;
*'''posY:''' the absolute Y coordinate of the top left corner of the image&lt;br /&gt;
*'''width:''' the absolute width of the image&lt;br /&gt;
*'''height:''' the absolute height of the image&lt;br /&gt;
*'''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''rotation:''' the rotation, in degrees for the image.&lt;br /&gt;
*'''rotationCenterOffsetX:''' the absolute X offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''rotationCenterOffsetY:''' the absolute Y offset from the image center for which to rotate the image from.&lt;br /&gt;
*'''color:''' Tints the image with a value produced by [[tocolor]] or hexadecimal number in format: 0xAARRGGBB (RR = red, GG = green, BB = blue, AA = alpha).&lt;br /&gt;
*'''postgui :''' A bool representing whether the image should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Example of a pendulum swinging from the top of the screen, made using dxDrawImage.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenWidth,screenHeight = guiGetScreenSize()  -- Get screen resolution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function renderDisplay ( )&lt;br /&gt;
	local seconds = getTickCount() / 1000&lt;br /&gt;
	local angle = math.sin(seconds) * 80&lt;br /&gt;
	-- This will draw the graphic file 'arrow.png' at the top middle of the screen&lt;br /&gt;
	-- using the size of 100 pixels wide, and 240 pixels high.&lt;br /&gt;
	-- The center of rotation is at the top of the image.&lt;br /&gt;
	dxDrawImage ( screenWidth/2 - 50, 0, 100, 240, 'arrow.png', angle, 0, -120 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function HandleTheRendering ( )&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), renderDisplay)  -- Keep everything visible with onClientRender.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;,resourceRoot, HandleTheRendering)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FxAddSparks&amp;diff=42889</id>
		<title>FxAddSparks</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FxAddSparks&amp;diff=42889"/>
		<updated>2014-11-18T08:29:27Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
[[Image:Fxsparks.png|thumb|200px|Sparks]]&lt;br /&gt;
Creates a number of sparks originating from a point or along a line.&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 fxAddSparks ( float posX, float posY, float posZ, float dirX, float dirY, float dirZ, [float force=1, int count=1, float acrossLineX=0, float acrossLineY=0, float acrossLineZ=0, bool blur=false, float spread=1, float life=1] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''posX, posY, posZ:''' the world coordinates where the sparks originate.&lt;br /&gt;
*'''dirX, dirY, dirZ:''' a direction vector indicating where the sparks fly to. The longer this vector is, the faster the sparks fly.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''force:''' speed factor: the higher this value, the faster and further the sparks fly.&lt;br /&gt;
*'''count:''' the number of effects to create.&lt;br /&gt;
*'''acrossLineX, acrossLineY, acrossLineZ:''' a vector starting at the '''pos''' coordinates. If specified, the sparks will be created along a line going from '''pos''' to '''pos - acrossLine'''. If not specified, all sparks originate from the point at '''pos'''.&lt;br /&gt;
*'''blur:''' if ''false'', creates standard bullet impact-like sparks. If ''true'', adds motion blur to the sparks.&lt;br /&gt;
*'''spread:''' determines how strongly the particles deviate from each other. With low values the particles will stay quite close together, high values will make them fly in all directions. Also affects their speed.&lt;br /&gt;
*'''life:''' the higher this value, the longer the sparks survive before they disappear.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will add Fire Bins to all locations added in the table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fires = {&lt;br /&gt;
    {0, 0, 3} --Middle of SA&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for i = 1, #fires do&lt;br /&gt;
    bin = createObject(1362, fires[i][1], fires[i][2], fires[i][3]-0.5)&lt;br /&gt;
    torch = createObject(3461, fires[i][1]-0.1, fires[i][2]-0.1, fires[i][3]-2)&lt;br /&gt;
    light = createMarker(fires[i][1], fires[i][2], fires[i][3]+0.2, &amp;quot;corona&amp;quot;, 1, 255, 170, 0, 80, root)&lt;br /&gt;
    fireCol = createColSphere(fires[i][1], fires[i][2], fires[i][3]+0.5, 0.8)&lt;br /&gt;
    setTimer(fxAddSparks, math.random(4000, 5000), 0, fires[i][1]+math.random(0.1, 0.3), fires[i][2]+math.random(0.1, 0.2), fires[i][3]+0.2, 1, 1, 1)         &lt;br /&gt;
            &lt;br /&gt;
    addEventHandler(&amp;quot;onClientColShapeHit&amp;quot;, fireCol, &lt;br /&gt;
    function(theElement)&lt;br /&gt;
        if (getElementType(theElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
            setPedOnFire(theElement, true)&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
            &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client Effects functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ProcessLineOfSight&amp;diff=42888</id>
		<title>ProcessLineOfSight</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ProcessLineOfSight&amp;diff=42888"/>
		<updated>2014-11-18T08:28:48Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function casts a ray between two points in the world, and tells you information about the point that was hit, if any. The two positions '''must''' be within the local player's draw distance as the collision data is not loaded outside this area, and the call will just fail as if the ray didn't hit.&lt;br /&gt;
&lt;br /&gt;
This function is relatively expensive to call, so over use of this in scripts may have a detrimental effect on performance.&lt;br /&gt;
&lt;br /&gt;
This function is useful for checking for collisions and for editor-style scripts. If you wish to find what element is positioned at a particular point on the screen, use this function combined with [[getWorldFromScreenPosition]]. If you wish to just know if something is hit, and don't care about what or where was hit, use [[isLineOfSightClear]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
Return values labelled for ease of reference.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool float float float element float float float int float int int float float float float float float int processLineOfSight ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings = true, bool checkVehicles = true, bool checkPlayers = true, bool checkObjects = true, bool checkDummies = true, bool seeThroughStuff = false, bool ignoreSomeObjectsForCamera = false, bool shootThroughStuff = false, element ignoredElement = nil, bool includeWorldModelInformation = false, bool bIncludeCarTyres ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''startX:''' The start ''x'' position&lt;br /&gt;
*'''startY:''' The start ''y'' position&lt;br /&gt;
*'''startZ:''' The start ''z'' position&lt;br /&gt;
*'''endX:''' The end ''x'' position&lt;br /&gt;
*'''endY:''' The end ''y'' position&lt;br /&gt;
*'''endZ:''' The end ''z'' position&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPlayers:''' Allow the line of sight to be blocked by [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to pass through objects that have (K) property enabled in &amp;quot;object.dat&amp;quot; data file. (i.e. Most dynamic objects like boxes or barrels)&lt;br /&gt;
*'''shootThroughStuff:''' Allow the line of sight to be blocked by things that can be shot through&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element. This is usually set to the object you are tracing from so it does not interfere with the results.&lt;br /&gt;
*'''includeWorldModelInformation :''' Include the results of hitting a world model.&lt;br /&gt;
*'''bIncludeCarTyres :''' Includes car tyre hits.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''hit:''' ''true'' if there is a collision, ''false'' otherwise&lt;br /&gt;
The other values are only filled if there is a collision, they contain ''nil'' otherwise&lt;br /&gt;
*'''hitX, hitY, hitZ:''' collision position&lt;br /&gt;
*'''hitElement:''' the MTA element hit if any, ''nil'' otherwise&lt;br /&gt;
*'''normalX, normalY, normalZ:''' the normal of the surface hit&lt;br /&gt;
*'''material:''' an integer representing the [[Material IDs|GTASA material ID]] of the surface hit when applicable (world, objects)&lt;br /&gt;
*'''lighting:''' a float between 0 (fully dark) and 1 (bright) representing the amount of light that the hit building surface will transfer to peds or vehicles that are in contact with it. The value can be affected by the game time of day, usually with a lower (darker) value being returned during the night.&lt;br /&gt;
*'''piece:''' an integer representing the part of the element hit if hitElement is a vehicle or a ped/player, ''0'' otherwise. &lt;br /&gt;
**For a ped/player, piece represents the body part hit:&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
**For vehicles, piece represents the vehicle part hit:&lt;br /&gt;
{{VehicleParts}}&lt;br /&gt;
*'''worldModelID:''' If includeWorldModelInformation was set to ''true'' and a world model was hit, this will contain the model ID.&lt;br /&gt;
*'''worldModelPositionX,Y,Z:''' If worldModelID is set, this will contain the world model position.&lt;br /&gt;
*'''worldModelRotationX,Y,Z:''' If worldModelID is set, this will contain the world model rotation.&lt;br /&gt;
*'''worldLODModelID:''' If worldModelID is set, this will contain the LOD model ID if applicable.&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
This example shows how you can tell what position and element the camera is looking at, up to 50 units away.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local w, h = guiGetScreenSize ()&lt;br /&gt;
local tx, ty, tz = getWorldFromScreenPosition ( w/2, h/2, 50 )&lt;br /&gt;
local px, py, pz = getCameraMatrix()&lt;br /&gt;
hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, tx, ty, tz )&lt;br /&gt;
if hit then&lt;br /&gt;
    outputChatBox ( &amp;quot;Looking at &amp;quot; .. x .. &amp;quot;, &amp;quot; .. y .. &amp;quot;, &amp;quot; ..  z )&lt;br /&gt;
    if elementHit then&lt;br /&gt;
        outputChatBox ( &amp;quot;Hit element &amp;quot; .. getElementType(elementHit) )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example shows how you can get the surface type a vehicle is on. This is useful if you want to do a script to dirt cars over time. Please note that this function doesn't count if the vehicle is streamed in or not, so expect this function to fail or return incorrect values on unloaded vehicles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getSurfaceVehicleIsOn(vehicle)&lt;br /&gt;
    if isElement(vehicle) and (isVehicleOnGround(vehicle) or isElementInWater(vehicle)) then -- Is an element and is touching any surface?&lt;br /&gt;
        local cx, cy, cz = getElementPosition(vehicle) -- Get the position of the vehicle&lt;br /&gt;
        local gz = getGroundPosition(cx, cy, cz) - 0.001 -- Get the Z position of the ground the vehicle is on (-0.001 because of processLineOfSight)&lt;br /&gt;
        local hit, _, _, _, _, _, _, _, surface = processLineOfSight(cx, cy, cz, cx, cy, gz) -- This will get the material of the thing the car is standing on&lt;br /&gt;
        if hit then&lt;br /&gt;
            return surface -- If everything is correct, stop executing this function and return the surface type&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false -- If something isn't correct, return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04273|''bIncludeCarTyres'' argument added}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04273|''worldModelID'' return value fixed}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04405|''lighting'' return value fixed}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsLineOfSightClear&amp;diff=42887</id>
		<title>IsLineOfSightClear</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsLineOfSightClear&amp;diff=42887"/>
		<updated>2014-11-18T08:24:00Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements. Use [[processLineOfSight]] if you want more information about what the ray hits.&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 isLineOfSightClear ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings = true, bool checkVehicles = true, bool checkPeds = true, bool checkObjects = true, bool checkDummies = true, bool seeThroughStuff = false, bool ignoreSomeObjectsForCamera = false, element ignoredElement = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''startX:''' The first point's world X coordinate.&lt;br /&gt;
*'''startY:''' The first point's world Y coordinate.&lt;br /&gt;
*'''startZ:''' The first point's world Z coordinate.&lt;br /&gt;
*'''endX:''' The second point's world X coordinate.&lt;br /&gt;
*'''endY:''' The second point's world Y coordinate.&lt;br /&gt;
*'''endZ:''' The second point's world Z coordinate.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.&lt;br /&gt;
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]].&lt;br /&gt;
*'''checkPeds:''' Allow the line of sight to be blocked by peds, i.e. [[Player|players]].&lt;br /&gt;
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]].&lt;br /&gt;
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies.  These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''seeThroughStuff:''' Allow the line of sight to be blocked by translucent game objects, e.g. glass.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects.&lt;br /&gt;
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the line between the specified points is clear, ''false'' if there's an obstacle or if invalid parameters are passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
isLineOfSightClear is the economical way to cast a ray in the world. &lt;br /&gt;
This example demonstrates how you can easily implement basic NPC behaviour such as jumping obstacles. A 3D line is drawn connecting the two points in the ray.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local t_Data = {}&lt;br /&gt;
&lt;br /&gt;
local function updateNPC ()&lt;br /&gt;
    if (not isElement(t_Data.ped) or (getElementHealth(t_Data.ped) == 0)) then&lt;br /&gt;
        return toggleNPCFollower ()&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local t_PlayerPos = {getElementPosition(localPlayer)}&lt;br /&gt;
    local t_PedPos = {getElementPosition(t_Data.ped)}&lt;br /&gt;
    &lt;br /&gt;
    local intDistance = getDistanceBetweenPoints3D (t_PedPos[1], t_PedPos[2], t_PedPos[3], unpack(t_PlayerPos))&lt;br /&gt;
    if (intDistance &amp;lt; 4) then&lt;br /&gt;
        setPedControlState (t_Data.ped, 'forwards', false)&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Calculate the rotation between ped and player position&lt;br /&gt;
    local intPedRot = -math.deg (math.atan2(t_PlayerPos[1] - t_PedPos[1], t_PlayerPos[2] - t_PedPos[2]))&lt;br /&gt;
    if intPedRot &amp;lt; 0 then intPedRot = intPedRot + 360 end;&lt;br /&gt;
    &lt;br /&gt;
    setElementRotation (t_Data.ped, 0, 0, intPedRot, 'default', true)&lt;br /&gt;
    -- At this point we know that the ped needs to move it&lt;br /&gt;
    setPedControlState (t_Data.ped, 'forwards', true)&lt;br /&gt;
    &lt;br /&gt;
    local bPathClear = true&lt;br /&gt;
    local t_Matrix = getElementMatrix (t_Data.ped)&lt;br /&gt;
    &lt;br /&gt;
    -- Calculate a position 1m ahead of ped&lt;br /&gt;
    local int_RayX = t_Matrix[2][1] + t_Matrix[4][1]&lt;br /&gt;
    local int_RayY = t_Matrix[2][2] + t_Matrix[4][2]&lt;br /&gt;
    local int_RayZ = t_Matrix[2][3] + t_Matrix[4][3]&lt;br /&gt;
    &lt;br /&gt;
    -- We cast 10 rays 1m ahead of the ped&lt;br /&gt;
    for i = 1, 10 do&lt;br /&gt;
        local intSourceX, intSourceY, intSourceZ = t_PedPos[1], t_PedPos[2], t_PedPos[3]&lt;br /&gt;
        &lt;br /&gt;
        -- The target position height is identical to the center of the ped (1m above ground) &lt;br /&gt;
        -- We lower this value by 0.5m to detect short obstacles&lt;br /&gt;
        local intTargetX, intTargetY, intTargetZ = int_RayX, int_RayY, int_RayZ - 0.5 + i*0.2&lt;br /&gt;
        &lt;br /&gt;
        bPathClear = isLineOfSightClear (intSourceX, intSourceY, intSourceZ, intTargetX, intTargetY, intTargetZ, true, true, false, true)&lt;br /&gt;
        dxDrawLine3D (intSourceX, intSourceY, intSourceZ, intTargetX, intTargetY, intTargetZ, bPathClear and tocolor(255,255,255,255) or tocolor(255,0,0,255))&lt;br /&gt;
        &lt;br /&gt;
        if (not bPathClear) then&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if (not bPathClear) then&lt;br /&gt;
        setPedControlState (t_Data.ped, 'jump', true)&lt;br /&gt;
    else&lt;br /&gt;
        setPedControlState (t_Data.ped, 'jump', false)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if (intDistance &amp;gt; 15) then&lt;br /&gt;
        setPedControlState (t_Data.ped, 'sprint', true)&lt;br /&gt;
    else&lt;br /&gt;
        setPedControlState (t_Data.ped, 'sprint', false)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function toggleNPCFollower ()&lt;br /&gt;
    if (t_Data.ped) then&lt;br /&gt;
        if (t_Data.updateNPCTimer) then&lt;br /&gt;
            if (isTimer(t_Data.updateNPCTimer)) then&lt;br /&gt;
                killTimer (t_Data.updateNPCTimer)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if (isElement(t_Data.ped)) then&lt;br /&gt;
            destroyElement (t_Data.ped)&lt;br /&gt;
        end&lt;br /&gt;
        t_Data.ped = nil&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local intX, intY, intZ = getElementPosition (localPlayer)&lt;br /&gt;
    local _, _, intRZ = getElementRotation (localPlayer)&lt;br /&gt;
    local t_Matrix = getElementMatrix (localPlayer)&lt;br /&gt;
    &lt;br /&gt;
    -- Calculate a position 4m behind local player&lt;br /&gt;
    local intPedX = -4 * t_Matrix[2][1] + t_Matrix[4][1]&lt;br /&gt;
    local intPedY = -4 * t_Matrix[2][2] + t_Matrix[4][2]&lt;br /&gt;
    local intPedZ = -4 * t_Matrix[2][3] + t_Matrix[4][3]&lt;br /&gt;
    &lt;br /&gt;
    t_Data.ped = createPed (0, intPedX, intPedY, intPedZ, intRZ)&lt;br /&gt;
    t_Data.updateNPCTimer = setTimer (updateNPC, 50, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ('npc', toggleNPCFollower)&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 world functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateBlipAttachedTo&amp;diff=42886</id>
		<title>CreateBlipAttachedTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateBlipAttachedTo&amp;diff=42886"/>
		<updated>2014-11-18T08:21:40Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function creates a [[blip]] that is attached to an [[element]]. This blip is displayed as an icon on the client's radar and will 'follow' the element that it is attached to around.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
{{OOP|This function instantiates a class|createAttachedTo}}&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;
blip createBlipAttachedTo ( element elementToAttachTo, [int icon=0, int size=2, int r=255, int g=0, int b=0, int a=255, int ordering=0, float visibleDistance=99999.0, visibleTo = getRootElement()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''elementToAttachTo:''' The [[element]] to attach the marker to.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' The icon that the radar blips should be. Valid values are:&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' The size of the radar blip. Only applicable to the ''Marker'' icon. Default value is 2.&lt;br /&gt;
*'''r:''' The amount of red in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 255. &lt;br /&gt;
*'''g:''' The amount of green in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 0.&lt;br /&gt;
*'''b:''' The amount of blue in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 0.&lt;br /&gt;
*'''a:''' The amount of alpha in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 255.&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible (0 - 65535)&lt;br /&gt;
}}&lt;br /&gt;
*'''visibleTo:''' What elements can see the blip. Defaults to visible to everyone. See [[visibility]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blip createBlipAttachedTo ( element elementToAttachTo, [int icon=0, int size=2, int r=255, int g=0, int b=0, &lt;br /&gt;
int a=255, int ordering=0, float visibleDistance=99999.0] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''elementToAttachTo:''' The [[element]] to attach the marker to.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''icon:''' The icon that the radar blips should be. Valid values are:&lt;br /&gt;
{{Blip_Icons}}&lt;br /&gt;
*'''size:''' The size of the radar blip. Only applicable to the ''Marker'' icon. Default is 2.&lt;br /&gt;
*'''r:''' The amount of red in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. 'Default is 255. &lt;br /&gt;
*'''g:''' The amount of green in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 0.&lt;br /&gt;
*'''b:''' The amount of blue in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 0.&lt;br /&gt;
*'''a:''' The amount of alpha in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 255.&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.&lt;br /&gt;
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[blip]] if the blip was created succesfully, or ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a radar blip attached to a random player, visible to everyone. The blip will follow the player around as they move. This could be used for manhunt, to emphasise a random player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Pick a random player&lt;br /&gt;
function setupRandomRobber ()&lt;br /&gt;
	local myPlayer = getRandomPlayer ()&lt;br /&gt;
	-- Create a radar blip at the player's position, with a 'cash' icon and only visible to everyone (no 'visibleTo' parameter)&lt;br /&gt;
	local myBlip = createBlipAttachedTo ( myPlayer, 52 )&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;
{{Blip_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWaterLevel&amp;diff=42885</id>
		<title>SetWaterLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWaterLevel&amp;diff=42885"/>
		<updated>2014-11-18T08:20:48Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Sets the height of some or all the water in the game world.&lt;br /&gt;
{{Note|When the water level is 0, the standard GTA rendering is performed so that water is visible when viewed through translucent surfaces, such as vehicle windows. However, some MTA custom objects placed underwater will appear in front of the water. Setting the water level to any non-zero value (i.e. setWaterLevel(0.001) ) forces alternative rendering and MTA custom objects placed underwater will be drawn correctly.}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWaterLevel ( [water theWater,] float level )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWaterLevel ( float level [, bool includeWaterFeatures = true, bool includeWaterElements = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''level:''' the new Z coordinate of the water surface. All water in the game world is set to this height.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''theWater:''' the water element to change.&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
{{New feature/item|3.0120|1.2||&lt;br /&gt;
*'''includeWaterFeatures :''' a boolean indicating whether to also set the level of water features such as ponds and pools.&lt;br /&gt;
*'''includeWaterElements :''' a boolean indicating whether to also set the level of all water elements.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' in case of failure.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWaterLevel ( [float x, float y, float z,] float level )&lt;br /&gt;
bool setWaterLevel ( [water theWater,] float level )&lt;br /&gt;
bool setWaterLevel ( float level [, bool includeWaterFeatures = true, bool includeWaterElements = true ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''level:''' the new Z coordinate of the water surface. If '''x''', '''y''' and '''z''', or '''water''', are specified, the area of water containing that point or corresponding to that water element is changed. Otherwise, all water in the game world is changed.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''x:''' the X coordinate of the point indicating the water area to change.&lt;br /&gt;
*'''y:''' the Y coordinate of the point indicating the water area to change.&lt;br /&gt;
*'''z:''' the Z coordinate of the point indicating the water area to change. This parameter is reserved and is currently ignored, set it to 0.&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
*'''theWater:''' the water element to change.&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
{{New feature/item|3.0120|1.2||&lt;br /&gt;
*'''includeWaterFeatures :''' a boolean indicating whether to also set the level of water features such as ponds and pools.&lt;br /&gt;
*'''includeWaterElements :''' a boolean indicating whether to also set the level of all water elements.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' in case of failure (there is no water at the specified coordinates).&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example code will slowly drain away all rivers and seas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local level = 0&lt;br /&gt;
&lt;br /&gt;
function drainSomeWater()&lt;br /&gt;
    level = level - 0.01&lt;br /&gt;
    setWaterLevel ( level )&lt;br /&gt;
end&lt;br /&gt;
setTimer ( drainSomeWater, 100, 15000 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example code will slowly drain away all rivers and seas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local level = 0&lt;br /&gt;
&lt;br /&gt;
function drainSomeWater()&lt;br /&gt;
    level = level - 0.01&lt;br /&gt;
    setWaterLevel ( level )&lt;br /&gt;
end&lt;br /&gt;
setTimer ( drainSomeWater, 100, 15000 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example code adds a command ''water'' which can be used to change the current water level.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;water&amp;quot;,&lt;br /&gt;
    function ( thePlayer, command, level )&lt;br /&gt;
        if level and tonumber ( level ) then -- if we have input something and if it is actually a number value&lt;br /&gt;
            setWaterLevel ( tonumber( level ) ) -- change the water level&lt;br /&gt;
            outputChatBox ( &amp;quot;Waterlevel is now: &amp;quot; .. level ) -- send a message to everyone to inform about the change&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7542|Water functions in general do not work outside the -3000 -3000 3000 3000 bounds}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTrafficLightState&amp;diff=42884</id>
		<title>SetTrafficLightState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTrafficLightState&amp;diff=42884"/>
		<updated>2014-11-18T08:20:00Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Sets the current traffic light state. This state controls the traffic light colors. For instance, state '''1''' will cause the north and south traffic lights to be amber, and the ones left and east will turn red.&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 setTrafficLightState ( int state )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setTrafficLightState ( string state )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setTrafficLightState ( string colorNS, string colorEW )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''state''': If an integer is provided, the [[Traffic_light_states|state]] you wish to use (possible values: 0-9). Else, one of the following strings:&lt;br /&gt;
**'''auto''': Sets the traffic lights default behavior (switches the colors automatically).&lt;br /&gt;
**'''disabled''': Turns traffic lights off.&lt;br /&gt;
Alternatively, you can provide two string parameters ('''colorNS''' and '''colorEW''') with the colors for north-south and east-west traffic lights respectively. Valid colors are:&lt;br /&gt;
*'''green'''&lt;br /&gt;
*'''yellow'''&lt;br /&gt;
*'''red'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the state was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example causes all traffic lights to be out of order. (flashing amber)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function handleTrafficLightsOutOfOrder()&lt;br /&gt;
    -- See if the lights are currently off&lt;br /&gt;
    local lightsOff = getTrafficLightState() == 9&lt;br /&gt;
    &lt;br /&gt;
    if lightsOff then&lt;br /&gt;
        -- If they're off, turn them on&lt;br /&gt;
        setTrafficLightState(6)&lt;br /&gt;
    else&lt;br /&gt;
        -- If they're on, turn them off&lt;br /&gt;
        setTrafficLightState(9)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- Repeat it every half a second&lt;br /&gt;
setTimer(handleTrafficLightsOutOfOrder,500,0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateRadarArea&amp;diff=42883</id>
		<title>CreateRadarArea</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateRadarArea&amp;diff=42883"/>
		<updated>2014-11-18T08:19:15Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function can be used to create custom radar areas on the radar.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
radararea createRadarArea ( float leftX, float bottomY, float sizeX, float sizeY, [ int r = 255, int g = 0, int b = 0, int a = 255, element visibleTo = getRootElement() ] )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''leftX:''' A float representing the left 'x' position of the radar area.&lt;br /&gt;
*'''bottomY:''' A float representing the bottom 'y' position of the radar area.&lt;br /&gt;
*'''sizeX:''' A float representing the width of the radar area.&lt;br /&gt;
*'''sizeY:''' A float representing the height of the radar area.&lt;br /&gt;
&lt;br /&gt;
*'''r:''' An integer representing the amount of red in the color.  Maximum value is 255&lt;br /&gt;
*'''g:''' An integer representing the amount of green in the color.  Maximum value is 255&lt;br /&gt;
*'''b:''' An integer representing the amount of blue in the color.  Maximum value is 255&lt;br /&gt;
*'''a:''' An integer representing the amount of alpha in the color.  This allows setting the transparency of the radar area.  255 is opaque and 0 is transparent.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''visibleTo:''' An [[element]] that you wish to restrict the [[visibility]] of the radar area to. (Server function only)&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a radar area for the King of the hill script, and a colsquare. When the player enters the radar area it flashes, and stops flashing when a player leaves it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our hill area for our gamemode&lt;br /&gt;
local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 )&lt;br /&gt;
local hillRadar = createRadarArea ( -2183.5678710938, 705.67950439453, 40, -40, 0, 255, 0, 175 )&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player enters the hill area&lt;br /&gt;
function hill_Enter ( thePlayer, matchingDimension )&lt;br /&gt;
        -- announce to everyone that the player entered the hill&lt;br /&gt;
        if (getElementType(thePlayer) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
                outputChatBox( getPlayerName(thePlayer) .. &amp;quot; entered the zone!&amp;quot;, getRootElement(), 255, 255, 109 )&lt;br /&gt;
                setRadarAreaFlashing ( hillRadar, true )&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, hillArea, hill_Enter )&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player leaves the hill area&lt;br /&gt;
function hill_Exit ( thePlayer, matchingDimension )&lt;br /&gt;
        -- check if the player is not dead&lt;br /&gt;
        if (getElementType(thePlayer) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
                if isPedDead ( thePlayer ) ~= true then&lt;br /&gt;
                        -- if he was alive, announce to everyone that the player has left the hill&lt;br /&gt;
                        outputChatBox ( getPlayerName(thePlayer) .. &amp;quot; left the zone!&amp;quot;, getRootElement(), 255, 255, 109 )&lt;br /&gt;
                        setRadarAreaFlashing ( hillRadar, false )&lt;br /&gt;
                end&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeLeave&amp;quot;, hillArea, hill_Exit )&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;
{{Radar area_functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=InterpolateBetween&amp;diff=42882</id>
		<title>InterpolateBetween</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=InterpolateBetween&amp;diff=42882"/>
		<updated>2014-11-18T08:18:33Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Interpolates a 3D Vector between a source value and a target value using either linear interpolation or any other [[Easing|easing function]].&lt;br /&gt;
It can also be used to interpolate 2D vectors or scalars by only setting some of the x, y, z values and putting 0 to the others.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float float interpolateBetween ( float x1, float y1, float z1, float x2, float y2, float z2, float fProgress, 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;
*'''x1, y1, z1:''' 3D coordinates of source vector/value&lt;br /&gt;
*'''x2, y2, z2:''' 3D coordinates of target vector/value&lt;br /&gt;
*'''fProgress:''' float between 0 and 1 indicating the interpolation progress (0 at the beginning of the interpolation, 1 at the end).&lt;br /&gt;
*'''strEasingType:''' the [[Easing|easing function]] to use for the interpolation&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&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 ''x, y, z'' the interpolated 3D vector/value if successful, ''false'' otherwise (error in parameters).&lt;br /&gt;
As mentioned before, interpolateBetween can be used on 2D vectors or scalars in which case only some (x, y or just x) of the returned values are to be used (cf. alpha interpolation in marker example or size interpolation in window example).&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
The examples below are only clientside examples even though the function can be used on both sides. Indeed it makes more sense to use it with onClientRender/onClientPreRender but the freedom is given to use it in any other context.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This clientside example uses interpolateBetween to create position and color interpolation(with effect) on a marker.&lt;br /&gt;
The command to test it is &amp;quot;/marker&amp;quot;.&lt;br /&gt;
The position is interpolated with &amp;quot;OutBounce&amp;quot; as strEasingType to make the marker bounce off the ground and &amp;quot;Linear&amp;quot; interpolation for the color.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local g_Marker = nil&lt;br /&gt;
addCommandHandler(&amp;quot;marker&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
	if g_Marker then return end&lt;br /&gt;
	&lt;br /&gt;
	local x, y, z = getElementPosition(getLocalPlayer())&lt;br /&gt;
	z = z - 1&lt;br /&gt;
	&lt;br /&gt;
	g_Marker = {}&lt;br /&gt;
	g_Marker.startPos = {x, y, z + 5}&lt;br /&gt;
	g_Marker.startTime = getTickCount()&lt;br /&gt;
	g_Marker.startColor = {255, 0, 0, 0}&lt;br /&gt;
	g_Marker.endPos = {x, y, z}&lt;br /&gt;
	g_Marker.endTime = g_Marker.startTime + 2000&lt;br /&gt;
	g_Marker.endColor = {0, 0, 255, 255}	&lt;br /&gt;
	&lt;br /&gt;
	local x, y, z = unpack(g_Marker.startPos)&lt;br /&gt;
	local r, g, b, a = unpack(g_Marker.startColor)&lt;br /&gt;
	g_Marker.marker = createMarker(x, y, z, &amp;quot;cylinder&amp;quot;, 1, 255, r, g, b, a)&lt;br /&gt;
		&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), popMarkerUp)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
function popMarkerUp()&lt;br /&gt;
	local now = getTickCount()&lt;br /&gt;
	local elapsedTime = now - g_Marker.startTime&lt;br /&gt;
	local duration = g_Marker.endTime - g_Marker.startTime&lt;br /&gt;
	local progress = elapsedTime / duration&lt;br /&gt;
&lt;br /&gt;
	local x1, y1, z1 = unpack(g_Marker.startPos)&lt;br /&gt;
	local x2, y2, z2 = unpack(g_Marker.endPos)&lt;br /&gt;
	local x, y, z = interpolateBetween ( &lt;br /&gt;
		x1, y1, z1,&lt;br /&gt;
		x2, y2, z2, &lt;br /&gt;
		progress, &amp;quot;OutBounce&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
	setElementPosition(g_Marker.marker, x, y, z)&lt;br /&gt;
			&lt;br /&gt;
	local r1, g1, b1, a1 = unpack(g_Marker.startColor)&lt;br /&gt;
	local r2, g2, b2, a2 = unpack(g_Marker.endColor)&lt;br /&gt;
	local r, g, b = interpolateBetween ( &lt;br /&gt;
		r1, g1, b1,&lt;br /&gt;
		r2, g2, b2, &lt;br /&gt;
		progress, &amp;quot;Linear&amp;quot;)&lt;br /&gt;
	local a = interpolateBetween ( &lt;br /&gt;
		a1, 0, 0,&lt;br /&gt;
		a2, 0, 0,&lt;br /&gt;
		progress, &amp;quot;Linear&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
	setMarkerColor(g_Marker.marker , r, g, b, a)&lt;br /&gt;
	&lt;br /&gt;
	if now &amp;gt;= g_Marker.endTime then&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), popMarkerUp)&lt;br /&gt;
		setTimer(&lt;br /&gt;
			function ()&lt;br /&gt;
				destroyElement(g_Marker.marker)&lt;br /&gt;
				g_Marker = nil&lt;br /&gt;
			end, 3000, 1)&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;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This clientside example uses interpolateBetween to create size and position interpolation (with effect) on a gui-window.&lt;br /&gt;
The command to test it is &amp;quot;/window&amp;quot;.&lt;br /&gt;
When the window pops up it uses &amp;quot;OutElastic&amp;quot; as the strEasingType to create the bouncing/elastic effect.&lt;br /&gt;
When it fades away, it uses &amp;quot;InQuad&amp;quot; to have an accelerating fading.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local g_Window = nil&lt;br /&gt;
addCommandHandler(&amp;quot;window&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
	if g_Window then return end&lt;br /&gt;
	&lt;br /&gt;
	g_Window = {}&lt;br /&gt;
	&lt;br /&gt;
	local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
	g_Window.windowWidth, g_Window.windowHeight = 400, 315&lt;br /&gt;
	local left = screenWidth/2 - g_Window.windowWidth/2&lt;br /&gt;
	local top = screenHeight/2 - g_Window.windowHeight/2&lt;br /&gt;
	&lt;br /&gt;
	g_Window.window = guiCreateWindow(left, top, g_Window.windowWidth, g_Window.windowHeight, &amp;quot;Interpolation on GUI&amp;quot;, false)&lt;br /&gt;
	&lt;br /&gt;
	g_Window.closeBtn = guiCreateButton(320, 285, 75, 23, &amp;quot;Close&amp;quot;, false, g_Window.window)&lt;br /&gt;
		&lt;br /&gt;
	guiWindowSetSizable(g_Window.window, false)&lt;br /&gt;
	guiWindowSetMovable(g_Window.window, false)&lt;br /&gt;
	guiSetEnabled(g_Window.window, false)&lt;br /&gt;
	guiSetVisible(g_Window.window, false)&lt;br /&gt;
	&lt;br /&gt;
	g_Window.startTime = getTickCount()&lt;br /&gt;
	g_Window.startSize = {0, 0}&lt;br /&gt;
	g_Window.endSize = {g_Window.windowWidth, g_Window.windowHeight}&lt;br /&gt;
	g_Window.endTime = g_Window.startTime + 1000&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), popWindowUp)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
function on_closeBtn_clicked(button, state, absoluteX, absoluteY)&lt;br /&gt;
	if (button ~= &amp;quot;left&amp;quot;) or (state ~= &amp;quot;up&amp;quot;) then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not g_Window then return end&lt;br /&gt;
	&lt;br /&gt;
	showCursor(false)&lt;br /&gt;
	guiSetEnabled(g_Window.window, false)&lt;br /&gt;
	guiWindowSetMovable(g_Window.window, false)&lt;br /&gt;
	&lt;br /&gt;
	local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
	local posX, posY = guiGetPosition(g_Window.window, false)&lt;br /&gt;
	&lt;br /&gt;
	g_Window.startTime = getTickCount()&lt;br /&gt;
	g_Window.startSize = {g_Window.windowWidth, g_Window.windowHeight}&lt;br /&gt;
	g_Window.startCenter = &lt;br /&gt;
	{&lt;br /&gt;
		posX + g_Window.windowWidth/2,&lt;br /&gt;
		posY + g_Window.windowHeight/2,&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	g_Window.endSize = {0, 0}&lt;br /&gt;
	g_Window.endTime = g_Window.startTime + 1000&lt;br /&gt;
	g_Window.endCenter = &lt;br /&gt;
	{&lt;br /&gt;
		screenWidth, &lt;br /&gt;
		screenHeight&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), popWindowDown)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function popWindowUp()&lt;br /&gt;
	local now = getTickCount()&lt;br /&gt;
	local elapsedTime = now - g_Window.startTime&lt;br /&gt;
	local duration = g_Window.endTime - g_Window.startTime&lt;br /&gt;
	local progress = elapsedTime / duration&lt;br /&gt;
		&lt;br /&gt;
	local width, height, _ = interpolateBetween ( &lt;br /&gt;
		g_Window.startSize[1], g_Window.startSize[2], 0, &lt;br /&gt;
		g_Window.endSize[1], g_Window.endSize[2], 0, &lt;br /&gt;
		progress, &amp;quot;OutElastic&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
	guiSetSize(g_Window.window, width, height, false)&lt;br /&gt;
	&lt;br /&gt;
	local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
	guiSetPosition(g_Window.window, screenWidth/2 - width/2, screenHeight/2 - height/2, false)&lt;br /&gt;
	&lt;br /&gt;
	if not guiGetVisible(g_Window.window) then&lt;br /&gt;
		guiSetVisible(g_Window.window, true)&lt;br /&gt;
		guiBringToFront(g_Window.window)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if now &amp;gt;= g_Window.endTime then&lt;br /&gt;
		guiSetEnabled(g_Window.window, true)&lt;br /&gt;
		&lt;br /&gt;
		guiBringToFront(g_Window.window)&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), popWindowUp)&lt;br /&gt;
		addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, g_Window.closeBtn, on_closeBtn_clicked, false)&lt;br /&gt;
		showCursor(true)&lt;br /&gt;
		guiWindowSetMovable(g_Window.window, true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function popWindowDown()&lt;br /&gt;
	local now = getTickCount()&lt;br /&gt;
	local elapsedTime = now - g_Window.startTime&lt;br /&gt;
	local duration = g_Window.endTime - g_Window.startTime&lt;br /&gt;
	local progress = elapsedTime / duration&lt;br /&gt;
	&lt;br /&gt;
	local width, height, _ = interpolateBetween ( &lt;br /&gt;
		g_Window.startSize[1], g_Window.startSize[2], 0, &lt;br /&gt;
		g_Window.endSize[1], g_Window.endSize[2], 0, &lt;br /&gt;
		progress, &amp;quot;InQuad&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
	guiSetSize(g_Window.window, width, height, false)&lt;br /&gt;
	&lt;br /&gt;
	local centerX, centerY, _ = interpolateBetween ( &lt;br /&gt;
		g_Window.startCenter[1], g_Window.startCenter[2], 0, &lt;br /&gt;
		g_Window.endCenter[1], g_Window.endCenter[2], 0, &lt;br /&gt;
		progress, &amp;quot;InQuad&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	guiSetPosition(g_Window.window, centerX - width/2, centerY - height/2, false)&lt;br /&gt;
	&lt;br /&gt;
	if now &amp;gt;= g_Window.endTime then&lt;br /&gt;
		removeEventHandler(&amp;quot;onClientRender&amp;quot;, getRootElement(), popWindowDown)&lt;br /&gt;
		destroyElement(g_Window.window)&lt;br /&gt;
		g_Window = nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This clientside example uses interpolateBetween to create and position interpolation (with effect) on a camera.&lt;br /&gt;
The command to test it is &amp;quot;/ccam&amp;quot;.&lt;br /&gt;
When the camera pops up it uses &amp;quot;OutQuad&amp;quot; as the strEasingType to create the slow down effect.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabled = false&lt;br /&gt;
 &lt;br /&gt;
addCommandHandler(&amp;quot;ccam&amp;quot;, function()&lt;br /&gt;
    enabled = not enabled&lt;br /&gt;
    if enabled then&lt;br /&gt;
        start = getTickCount()&lt;br /&gt;
        dx, dy, dz, lx, ly, lz = getCameraMatrix()&lt;br /&gt;
        addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, interpolateCam)&lt;br /&gt;
        else&lt;br /&gt;
        start = nil&lt;br /&gt;
        setCameraTarget(localPlayer)&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, interpolateCam)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
 &lt;br /&gt;
function interpolateCam()&lt;br /&gt;
    local now = getTickCount()&lt;br /&gt;
    local endTime = start + 2000&lt;br /&gt;
    local elapsedTime = now - start&lt;br /&gt;
    local duration = endTime - start&lt;br /&gt;
    local progress = elapsedTime / duration&lt;br /&gt;
    local px, py, pz = getElementPosition(localPlayer)&lt;br /&gt;
    local x, y, z = interpolateBetween ( dx, dy, dz, dx+4, dy+4, dz, progress, &amp;quot;OutQuad&amp;quot;)&lt;br /&gt;
    setCameraMatrix(x, y, z, px, py, pz+0.6, 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;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AttachElements&amp;diff=42880</id>
		<title>AttachElements</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AttachElements&amp;diff=42880"/>
		<updated>2014-11-18T08:16:22Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function attaches one element to another, so that the first one follows the second whenever it moves. &lt;br /&gt;
&lt;br /&gt;
If an attempt is made to attach two elements that are already attached the opposite way (eg theElement becomes theAttachToElement and vice versa), the 1st attachment order is automatically detached in favor of the 2nd attachment order. For example, if carA was attached to carB, now carB is attached to carA. Also, an element cannot be attached to two separate elements at one time. For example, two cars can be attached to one single car, but one single car cannot be attached to two separate cars. If you attempt to do this, the existing attachment will automatically be dropped in favor of the new attachment. For example, if carA is asked to attached to carB then carC, it is only attached to carC.&lt;br /&gt;
&lt;br /&gt;
This is not compatible with all elements.  The following elements are compatible:&lt;br /&gt;
* [[Marker]]s&lt;br /&gt;
* [[Blip]]s&lt;br /&gt;
* [[Object]]s&lt;br /&gt;
* [[Player]]s&lt;br /&gt;
* [[Vehicle]]s&lt;br /&gt;
* [[Sound]]s&lt;br /&gt;
* [[Colshape]]s&lt;br /&gt;
* [[Camera]]s&lt;br /&gt;
* [[createWeapon|Weapons]]&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The offset coodinates reflect the object space, not the world space. This means that you cannot calculate the exact offsets between two objects by pre-positioning them in the map editor as a reference. Please see [[attachElementsOffsets]] for more details.&lt;br /&gt;
&lt;br /&gt;
'''Note #2:''' Due to a limitation in GTA, unexpected attach rotations may occur if all rotation offsets are non-zero. (i.e. Try to ensure at least one of 'xRotOffset', 'yRotOffset' or 'zRotOffset' is zero)&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 attachElements ( element theElement, element theAttachToElement, [ float xPosOffset, float yPosOffset, float zPosOffset, float xRotOffset, float yRotOffset, float zRotOffset ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP|This function is also a static function underneath the Element class.|[[element]]:attach||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element to be attached.&lt;br /&gt;
*'''theAttachToElement:''' The element to attach the first to.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''xPosOffset:''' The x offset, if you want the elements to be a certain distance from one another (default 0).&lt;br /&gt;
*'''yPosOffset:''' The y offset (default 0).&lt;br /&gt;
*'''zPosOffset:''' The z offset (default 0).&lt;br /&gt;
*'''xRotOffset:''' The x rotation offset (default 0).&lt;br /&gt;
*'''yRotOffset:''' The y rotation offset (default 0).&lt;br /&gt;
*'''zRotOffset:''' The z rotation offset (default 0).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the attaching process was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example attaches a marker to the player who steals the Mr. Whoopee:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the vehicle&lt;br /&gt;
local vehicleMrWhoopee = createVehicle ( 423, 237.472, -54.225, 1.518, 0, 354.488, 0 )&lt;br /&gt;
&lt;br /&gt;
function onMrWhoopeeEnter ( thePlayer, seat, jackedPlayer )&lt;br /&gt;
    outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; stole the Whoopee!&amp;quot;, getRootElement(), 255, 0, 0 )&lt;br /&gt;
    -- create the marker to attach&lt;br /&gt;
    local arrowMarker = createMarker ( 0, 0, 0, &amp;quot;arrow&amp;quot;, .75, 255, 0, 0, 170 )&lt;br /&gt;
    -- attach the marker to the player with a vertical offset of 2 units&lt;br /&gt;
    attachElements ( arrowMarker, thePlayer, 0, 0, 2 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- attach it to an event&lt;br /&gt;
addEventHandler ( &amp;quot;onVehicleEnter&amp;quot;, vehicleMrWhoopee, onMrWhoopeeEnter )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Example 2:''' This function adds a tank on top of a player (for extra defense):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function tankHat ( source, commandName )&lt;br /&gt;
      local x, y, z = getElementPosition ( source ) --Get the players position&lt;br /&gt;
      local tank = createVehicle ( 432, x, y, z + 5 ) --Create a tank&lt;br /&gt;
      attachElements ( tank, source, 0, 0, 5 ) --Attach the tank to the player.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;hat&amp;quot;, tankHat )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 3:''' This function adds a tank on top of a player (for extra defense), clientside.  This means it will be invisible to other players.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function tankHat ( commandName )&lt;br /&gt;
      local x, y, z = getElementPosition ( source ) --Get the players position&lt;br /&gt;
      local tank = createVehicle ( 432, x, y, z + 5 ) --Create a tank&lt;br /&gt;
      attachElements ( tank, source, 0, 0, 5 ) --Attach the tank to the player.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;hat&amp;quot;, tankHat )&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;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=42879</id>
		<title>MoveObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MoveObject&amp;diff=42879"/>
		<updated>2014-11-18T08:14:28Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: Fixxed Bot Section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&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, float targetx, float targety, float targetz, [ float moverx, float movery, float moverz, string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[object]]:move||}}&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;
* ''true'' if the function moved the object succesfully.&lt;br /&gt;
* ''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>LuXorioN</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=42878</id>
		<title>BanPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=42878"/>
		<updated>2014-11-18T08:11:41Z</updated>

		<summary type="html">&lt;p&gt;LuXorioN: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
This function will ban the specified player by either IP, [[serial]] or username&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
This function will ban the specified player from the server by IP.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{OOP||[[player]]:ban||}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bannedPlayer:''' The player that will be banned from the server.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''IP:''' Will player be banned by IP?&lt;br /&gt;
*'''Username:''' Will player be banned by username?&lt;br /&gt;
*'''Serial:''' Will player be banned by serial?&lt;br /&gt;
&lt;br /&gt;
:'''Note:''' to ban by username or serial, ''verifyserials'' must be enabled in the server configuration file.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the player. This can be a player or the root ([[getRootElement]]()) (Maximum 30 characters if using a string).&lt;br /&gt;
*'''reason:''' The reason the player will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
Returns ''true'' if the player was banned succesfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
Returns a [[ban]] object if banned successfully, or ''false'' if unsuccessful.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets a player ban anyone if he has ACL rights.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add the &amp;quot;ban&amp;quot; command handler&lt;br /&gt;
-- Example with the player&lt;br /&gt;
function banPlayerCommand ( theClient, commandName, bannedName, reason )&lt;br /&gt;
&lt;br /&gt;
	-- Give the player a nice error if he doesn't have rights&lt;br /&gt;
	if ( hasObjectPermissionTo ( theClient, &amp;quot;function.banPlayer&amp;quot; ) ) then&lt;br /&gt;
		--Get player element from the name&lt;br /&gt;
		local bannedPlayer = getPlayerFromName ( bannedName )&lt;br /&gt;
&lt;br /&gt;
		--Ban the player&lt;br /&gt;
		banPlayer ( bannedPlayer, theClient, reason )&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: &amp;quot; .. bannedName .. &amp;quot; successfully banned&amp;quot;, theClient )&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: You don't have enough permissions&amp;quot;, theClient )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban&amp;quot;, banPlayerCommand )&lt;br /&gt;
&lt;br /&gt;
-- Example function with the root element. Here you would pass a player element to the function.&lt;br /&gt;
function banCheater(theCheater)&lt;br /&gt;
	banPlayer(theCheater, getRootElement(), &amp;quot;You are banned because of cheating.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin_functions}}&lt;br /&gt;
[[es:banPlayer]]&lt;br /&gt;
[[ru:BanPlayer]]&lt;/div&gt;</summary>
		<author><name>LuXorioN</name></author>
	</entry>
</feed>