<?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=Sergeanur</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=Sergeanur"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Sergeanur"/>
	<updated>2026-04-04T07:11:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=52531</id>
		<title>CreateMarkerAttachedTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateMarkerAttachedTo&amp;diff=52531"/>
		<updated>2017-10-05T09:15:18Z</updated>

		<summary type="html">&lt;p&gt;Sergeanur: &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, xOffset, yOffset, zOffset) 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>Sergeanur</name></author>
	</entry>
</feed>