<?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=HorrorClown</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=HorrorClown"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/HorrorClown"/>
	<updated>2026-05-02T15:21:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39653</id>
		<title>CreateMarkerAttachedTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39653"/>
		<updated>2014-05-29T23:08:06Z</updated>

		<summary type="html">&lt;p&gt;HorrorClown: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function creates a [[marker]] that is attached to an [[element]]. This marker is a 3D model and will 'follow' the element that it is attached to around.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;marker createMarkerAttachedTo ( element elementToAttachTo, [, string type = &amp;quot;checkpint&amp;quot;, float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement ( ), float xPosOffset, float yPosOffset, float zPosOffset ] )&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;
* '''theType''': The visual type of the marker to be created. Possible values:&lt;br /&gt;
{{Marker_types}}&lt;br /&gt;
* '''size''': The diameter of the marker to be created, in meters.&lt;br /&gt;
* '''r''': An integer number representing the amount of red to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''g''': An integer number representing the amount of green to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''b''': An integer number representing the amount of blue to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''a''': An integer number representing the amount of alpha to use in the colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque).&lt;br /&gt;
* '''visibleTo''': This defines which elements can see the marker. Defaults to visible to everyone. See [[visibility]].&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;
&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside/Clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset)&lt;br /&gt;
	mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or &amp;quot;checkpoint&amp;quot;, size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0&lt;br /&gt;
	assert(isElement(element), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got &amp;quot; .. type(element) .. &amp;quot;]&amp;quot;) assert(type(mType) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got &amp;quot; .. type(mType) .. &amp;quot;]&amp;quot;) assert(type(size) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got &amp;quot; .. type(size) .. &amp;quot;]&amp;quot;) assert(type(r) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got &amp;quot; .. type(r) .. &amp;quot;]&amp;quot;)	assert(type(g) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got &amp;quot; .. type(g) .. &amp;quot;]&amp;quot;) assert(type(b) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got &amp;quot; .. type(b) .. &amp;quot;]&amp;quot;) assert(type(a) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got &amp;quot; .. type(a) .. &amp;quot;]&amp;quot;) assert(isElement(visibleTo), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got &amp;quot; .. type(visibleTo) .. &amp;quot;]&amp;quot;) assert(type(xOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got &amp;quot; .. type(xOffset) .. &amp;quot;]&amp;quot;) assert(type(yOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got &amp;quot; .. type(yOffset) .. &amp;quot;]&amp;quot;) assert(type(zOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got &amp;quot; .. type(zOffset) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
	local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo)&lt;br /&gt;
	if m then if attachElements(m, element) then return m end end return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
Author: HorrorClown (PewX)&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>HorrorClown</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39652</id>
		<title>CreateMarkerAttachedTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39652"/>
		<updated>2014-05-29T23:00:39Z</updated>

		<summary type="html">&lt;p&gt;HorrorClown: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function creates a [[marker]] that is attached to an [[element]]. This marker is a 3D model and will 'follow' the element that it is attached to around.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;marker createMarkerAttachedTo ( element elementToAttachTo, [, string type = &amp;quot;checkpint&amp;quot;, float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement ( ), float xPosOffset, float yPosOffset, float zPosOffset ] )&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;
* '''theType''': The visual type of the marker to be created. Possible values:&lt;br /&gt;
{{Marker_types}}&lt;br /&gt;
* '''size''': The diameter of the marker to be created, in meters.&lt;br /&gt;
* '''r''': An integer number representing the amount of red to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''g''': An integer number representing the amount of green to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''b''': An integer number representing the amount of blue to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''a''': An integer number representing the amount of alpha to use in the colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque).&lt;br /&gt;
* '''visibleTo''': This defines which elements can see the marker. Defaults to visible to everyone. See [[visibility]].&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;
&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside/Clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset)&lt;br /&gt;
	mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or &amp;quot;checkpoint&amp;quot;, size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0&lt;br /&gt;
	assert(isElement(element), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got &amp;quot; .. type(element) .. &amp;quot;]&amp;quot;) assert(type(mType) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got &amp;quot; .. type(mType) .. &amp;quot;]&amp;quot;) assert(type(size) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got &amp;quot; .. type(size) .. &amp;quot;]&amp;quot;) assert(type(r) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got &amp;quot; .. type(r) .. &amp;quot;]&amp;quot;)	assert(type(g) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got &amp;quot; .. type(g) .. &amp;quot;]&amp;quot;) assert(type(b) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got &amp;quot; .. type(b) .. &amp;quot;]&amp;quot;) assert(type(a) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got &amp;quot; .. type(a) .. &amp;quot;]&amp;quot;) assert(isElement(visibleTo), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got &amp;quot; .. type(visibleTo) .. &amp;quot;]&amp;quot;) assert(type(xOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got &amp;quot; .. type(xOffset) .. &amp;quot;]&amp;quot;) assert(type(yOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got &amp;quot; .. type(yOffset) .. &amp;quot;]&amp;quot;) assert(type(zOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got &amp;quot; .. type(zOffset) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
	local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo)&lt;br /&gt;
	if m then if attachElements(m, element) then return m end end return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>HorrorClown</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39651</id>
		<title>CreateMarkerAttachedTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39651"/>
		<updated>2014-05-29T22:59:10Z</updated>

		<summary type="html">&lt;p&gt;HorrorClown: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Useful_Functions]]&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function creates a [[marker]] that is attached to an [[element]]. This marker is a 3D model and will 'follow' the element that it is attached to around.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;marker createMarkerAttachedTo ( element elementToAttachTo, [, string type = &amp;quot;checkpint&amp;quot;, float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement ( ), float xPosOffset, float yPosOffset, float zPosOffset ] )&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;
* '''theType''': The visual type of the marker to be created. Possible values:&lt;br /&gt;
{{Marker_types}}&lt;br /&gt;
* '''size''': The diameter of the marker to be created, in meters.&lt;br /&gt;
* '''r''': An integer number representing the amount of red to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''g''': An integer number representing the amount of green to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''b''': An integer number representing the amount of blue to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''a''': An integer number representing the amount of alpha to use in the colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque).&lt;br /&gt;
* '''visibleTo''': This defines which elements can see the marker. Defaults to visible to everyone. See [[visibility]].&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;
&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside/Clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset)&lt;br /&gt;
	mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or &amp;quot;checkpoint&amp;quot;, size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0&lt;br /&gt;
	assert(isElement(element), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got &amp;quot; .. type(element) .. &amp;quot;]&amp;quot;) assert(type(mType) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got &amp;quot; .. type(mType) .. &amp;quot;]&amp;quot;) assert(type(size) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got &amp;quot; .. type(size) .. &amp;quot;]&amp;quot;) assert(type(r) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got &amp;quot; .. type(r) .. &amp;quot;]&amp;quot;)	assert(type(g) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got &amp;quot; .. type(g) .. &amp;quot;]&amp;quot;) assert(type(b) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got &amp;quot; .. type(b) .. &amp;quot;]&amp;quot;) assert(type(a) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got &amp;quot; .. type(a) .. &amp;quot;]&amp;quot;) assert(isElement(visibleTo), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got &amp;quot; .. type(visibleTo) .. &amp;quot;]&amp;quot;) assert(type(xOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got &amp;quot; .. type(xOffset) .. &amp;quot;]&amp;quot;) assert(type(yOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got &amp;quot; .. type(yOffset) .. &amp;quot;]&amp;quot;) assert(type(zOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got &amp;quot; .. type(zOffset) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
	local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo)&lt;br /&gt;
	if m then if attachElements(m, element) then return m end end return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>HorrorClown</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39650</id>
		<title>CreateMarkerAttachedTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=39650"/>
		<updated>2014-05-29T22:32:42Z</updated>

		<summary type="html">&lt;p&gt;HorrorClown: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle/&amp;gt; __NOTOC__  This function creates a marker that is attached to an element. This marker is a 3D model and will 'follow' the element...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This function creates a [[marker]] that is attached to an [[element]]. This marker is a 3D model and will 'follow' the element that it is attached to around.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;marker createMarkerAttachedTo ( element elementToAttachTo, [, string type = &amp;quot;checkpint&amp;quot;, float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement ( ), float xPosOffset, float yPosOffset, float zPosOffset ] )&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;
* '''theType''': The visual type of the marker to be created. Possible values:&lt;br /&gt;
{{Marker_types}}&lt;br /&gt;
* '''size''': The diameter of the marker to be created, in meters.&lt;br /&gt;
* '''r''': An integer number representing the amount of red to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''g''': An integer number representing the amount of green to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''b''': An integer number representing the amount of blue to use in the colouring of the marker (0 - 255).&lt;br /&gt;
* '''a''': An integer number representing the amount of alpha to use in the colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque).&lt;br /&gt;
* '''visibleTo''': This defines which elements can see the marker. Defaults to visible to everyone. See [[visibility]].&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;
&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside/Clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset)&lt;br /&gt;
	mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or &amp;quot;checkpoint&amp;quot;, size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0&lt;br /&gt;
	assert(isElement(element), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got &amp;quot; .. type(element) .. &amp;quot;]&amp;quot;) assert(type(mType) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got &amp;quot; .. type(mType) .. &amp;quot;]&amp;quot;) assert(type(size) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got &amp;quot; .. type(size) .. &amp;quot;]&amp;quot;) assert(type(r) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got &amp;quot; .. type(r) .. &amp;quot;]&amp;quot;)	assert(type(g) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got &amp;quot; .. type(g) .. &amp;quot;]&amp;quot;) assert(type(b) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got &amp;quot; .. type(b) .. &amp;quot;]&amp;quot;) assert(type(a) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got &amp;quot; .. type(a) .. &amp;quot;]&amp;quot;) assert(isElement(visibleTo), &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got &amp;quot; .. type(visibleTo) .. &amp;quot;]&amp;quot;) assert(type(xOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got &amp;quot; .. type(xOffset) .. &amp;quot;]&amp;quot;) assert(type(yOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got &amp;quot; .. type(yOffset) .. &amp;quot;]&amp;quot;) assert(type(zOffset) == &amp;quot;number&amp;quot;, &amp;quot;Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got &amp;quot; .. type(zOffset) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
	local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo)&lt;br /&gt;
	if m then if attachElements(m, element) then return m end end return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>HorrorClown</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementSpeed&amp;diff=36719</id>
		<title>GetElementSpeed</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementSpeed&amp;diff=36719"/>
		<updated>2013-07-20T01:32:07Z</updated>

		<summary type="html">&lt;p&gt;HorrorClown: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function allows you to get element speed in kph or mph units.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int/bool getElementSpeed (element theElement, [ int/string unit=&amp;quot;kph&amp;quot; ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': Element you want to get speed of&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''unit''': Units in which speed should be returned. This can be 1 or &amp;quot;mph&amp;quot; for mph, any other value for kph.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getElementSpeed(element,unit)&lt;br /&gt;
	if (unit == nil) then unit = 0 end&lt;br /&gt;
	if (isElement(element)) then&lt;br /&gt;
		local x,y,z = getElementVelocity(element)&lt;br /&gt;
		if (unit==&amp;quot;mph&amp;quot; or unit==1 or unit =='1') then&lt;br /&gt;
			return (x^2 + y^2 + z^2) ^ 0.5 * 100&lt;br /&gt;
		else&lt;br /&gt;
			return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputDebugString(&amp;quot;Not an element. Can't get speed&amp;quot;)&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server-side example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds command that outputs to chat current player speed in both mph and kph. Notice: When player is in car his ped is having same velocity as car, so it isn't needed to get his car element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;getmyspeed&amp;quot;,&lt;br /&gt;
function (player, cmd)&lt;br /&gt;
  outputChatBox (&amp;quot;Your speed in mph: &amp;quot;..getElementSpeed(player, &amp;quot;mph&amp;quot;),player)&lt;br /&gt;
  outputChatBox (&amp;quot;Your speed in kph: &amp;quot;..getElementSpeed(player, &amp;quot;kph&amp;quot;),player)&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;
Original function by author of '''speedx''' resource. Modified, wiki-fied etc by '''varez'''.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>HorrorClown</name></author>
	</entry>
</feed>