<?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=Norby89</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=Norby89"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Norby89"/>
	<updated>2026-04-11T18:14:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySoundFrontEnd&amp;diff=22896</id>
		<title>PlaySoundFrontEnd</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySoundFrontEnd&amp;diff=22896"/>
		<updated>2010-04-17T23:58:06Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function plays a frontend sound for the specified player.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool playSoundFrontEnd ( player thePlayer, int sound )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The [[player]] you want the sound to play for.&lt;br /&gt;
*'''sound:''' A whole [[int]] specifying the sound id to play. Valid values are:&lt;br /&gt;
{{Sounds}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool playSoundFrontEnd ( int sound )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A whole [[int]] specifying the sound id to play. Valid values are:&lt;br /&gt;
{{Sounds}}&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully played, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example plays a sound when a player spawns.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerSpawn ( theSpawnpoint, theTeam )&lt;br /&gt;
    playSoundFrontEnd ( source, 16 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, getRootElement(), onPlayerSpawn )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example plays a sound when the player types the command '/sound'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onSoundEvent ( )&lt;br /&gt;
    playSoundFrontEnd ( 16 )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sound&amp;quot;, onSoundEvent)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Var_dump&amp;diff=22078</id>
		<title>Var dump</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Var_dump&amp;diff=22078"/>
		<updated>2009-12-23T10:02:39Z</updated>

		<summary type="html">&lt;p&gt;Norby89: minor typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;var_dump&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function outputs information about one or more variables using outputConsole().&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string/table var_dump( ... )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
The function can have a variable number of arguments. Those arguments can be of three types:&lt;br /&gt;
* '''Modifiers:''' A ''string'' that begins with a &amp;quot;-&amp;quot; (minus) and that is followed by at least another parameter is a modifier. A modifier can change the behaviour of the function. Modifiers don't have to be the first argument, they always work on all arguments after it (see examples).&lt;br /&gt;
* '''Names:''' A ''string'' that is followed by at least another parameter and isn't preceeded by another ''string'' (that is not a modifier), is a name. A name is output before the variable output, to make it recognizable (basicially a description of the variable that is being output, e.g. the name).&lt;br /&gt;
* '''Values:''' Any value that is not one of the two above will generate an output with information about the variable:&lt;br /&gt;
** For ''strings'': string(''lengthOfString'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
** For ''userdata'': userdata(''MTA element type'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
** For ''tables'': table(''numerOfElements'') &amp;quot;''value''&amp;quot;&lt;br /&gt;
*** If the table contains any elements, they will also be output if the appropriate modifiers are set. This will always be in the form [''key''] =&amp;gt; ''value'', while ''key'' and ''value'' are formatted by var_dump.&lt;br /&gt;
&lt;br /&gt;
===Modifiers===&lt;br /&gt;
* '''v''' (verbose): Dumps more data than usual (for now it outputs whole tables including subtables)&lt;br /&gt;
* '''n''' (normal): Switches back into 'normal' non-verbose mode.&lt;br /&gt;
* '''s''' (silent): With this activated, it outputs nothing at all, however it still returns the output, so you can use it yourself (also used internally for recursion).&lt;br /&gt;
* '''u''' (unnamed): Don't use names. Every ''string'' that is not a modifier will be output as a value, not a decription.&lt;br /&gt;
* '''d[number]''' (depth): Output nested tables up to this depth (e.g. &amp;quot;d1&amp;quot; means output all values of the initial table, but not the values of the values, if they are also tables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string with all the output in one line and a table with several lines of output.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- modifiers: v - verbose (all subtables), n - normal, s - silent (no output), dx - up to depth x, u - unnamed&lt;br /&gt;
function var_dump(...)&lt;br /&gt;
	-- default options&lt;br /&gt;
	local verbose = false&lt;br /&gt;
	local firstLevel = true&lt;br /&gt;
	local outputDirectly = true&lt;br /&gt;
	local noNames = false&lt;br /&gt;
	local indentation = &amp;quot;\t\t\t\t\t\t&amp;quot;&lt;br /&gt;
	local depth = nil&lt;br /&gt;
&lt;br /&gt;
	local name = nil&lt;br /&gt;
	local output = {}&lt;br /&gt;
	for k,v in ipairs(arg) do&lt;br /&gt;
		-- check for modifiers&lt;br /&gt;
		if type(v) == &amp;quot;string&amp;quot; and k &amp;lt; #arg and v:sub(1,1) == &amp;quot;-&amp;quot; then&lt;br /&gt;
			local modifiers = v:sub(2)&lt;br /&gt;
			if modifiers:find(&amp;quot;v&amp;quot;) ~= nil then&lt;br /&gt;
				verbose = true&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;s&amp;quot;) ~= nil then&lt;br /&gt;
				outputDirectly = false&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;n&amp;quot;) ~= nil then&lt;br /&gt;
				verbose = false&lt;br /&gt;
			end&lt;br /&gt;
			if modifiers:find(&amp;quot;u&amp;quot;) ~= nil then&lt;br /&gt;
				noNames = true&lt;br /&gt;
			end&lt;br /&gt;
			local s,e = modifiers:find(&amp;quot;d%d+&amp;quot;)&lt;br /&gt;
			if s ~= nil then&lt;br /&gt;
				depth = tonumber(string.sub(modifiers,s+1,e))&lt;br /&gt;
			end&lt;br /&gt;
		-- set name if appropriate&lt;br /&gt;
		elseif type(v) == &amp;quot;string&amp;quot; and k &amp;lt; #arg and name == nil and not noNames then&lt;br /&gt;
			name = v&lt;br /&gt;
		else&lt;br /&gt;
			if name ~= nil then&lt;br /&gt;
				name = &amp;quot;&amp;quot;..name..&amp;quot;: &amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				name = &amp;quot;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			local o = &amp;quot;&amp;quot;&lt;br /&gt;
			if type(v) == &amp;quot;string&amp;quot; then&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..v:len()..&amp;quot;) \&amp;quot;&amp;quot;..v..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			elseif type(v) == &amp;quot;userdata&amp;quot; then&lt;br /&gt;
				local elementType = &amp;quot;no valid MTA element&amp;quot;&lt;br /&gt;
				if isElement(v) then&lt;br /&gt;
					elementType = getElementType(v)&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..elementType..&amp;quot;) \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			elseif type(v) == &amp;quot;table&amp;quot; then&lt;br /&gt;
				local count = 0&lt;br /&gt;
				for key,value in pairs(v) do&lt;br /&gt;
					count = count + 1&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot;(&amp;quot;..count..&amp;quot;) \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
				if verbose and count &amp;gt; 0 and (depth == nil or depth &amp;gt; 0) then&lt;br /&gt;
					table.insert(output,&amp;quot;\t{&amp;quot;)&lt;br /&gt;
					for key,value in pairs(v) do&lt;br /&gt;
						-- calls itself, so be careful when you change anything&lt;br /&gt;
						local newModifiers = &amp;quot;-s&amp;quot;&lt;br /&gt;
						if depth == nil then&lt;br /&gt;
							newModifiers = &amp;quot;-sv&amp;quot;&lt;br /&gt;
						elseif  depth &amp;gt; 1 then&lt;br /&gt;
							local newDepth = depth - 1&lt;br /&gt;
							newModifiers = &amp;quot;-svd&amp;quot;..newDepth&lt;br /&gt;
						end&lt;br /&gt;
						local keyString, keyTable = var_dump(newModifiers,key)&lt;br /&gt;
						local valueString, valueTable = var_dump(newModifiers,value)&lt;br /&gt;
						&lt;br /&gt;
						if #keyTable == 1 and #valueTable == 1 then&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;[&amp;quot;..keyString..&amp;quot;]\t=&amp;gt;\t&amp;quot;..valueString)&lt;br /&gt;
						elseif #keyTable == 1 then&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;[&amp;quot;..keyString..&amp;quot;]\t=&amp;gt;&amp;quot;)&lt;br /&gt;
							for k,v in ipairs(valueTable) do&lt;br /&gt;
								table.insert(output,indentation..v)&lt;br /&gt;
							end&lt;br /&gt;
						elseif #valueTable == 1 then&lt;br /&gt;
							for k,v in ipairs(keyTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot;[&amp;quot;..v)&lt;br /&gt;
								elseif k == #keyTable then&lt;br /&gt;
									table.insert(output,indentation..v..&amp;quot;]&amp;quot;)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
							table.insert(output,indentation..&amp;quot;\t=&amp;gt;\t&amp;quot;..valueString)&lt;br /&gt;
						else&lt;br /&gt;
							for k,v in ipairs(keyTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot;[&amp;quot;..v)&lt;br /&gt;
								elseif k == #keyTable then&lt;br /&gt;
									table.insert(output,indentation..v..&amp;quot;]&amp;quot;)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
							for k,v in ipairs(valueTable) do&lt;br /&gt;
								if k == 1 then&lt;br /&gt;
									table.insert(output,indentation..&amp;quot; =&amp;gt; &amp;quot;..v)&lt;br /&gt;
								else&lt;br /&gt;
									table.insert(output,indentation..v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					table.insert(output,&amp;quot;\t}&amp;quot;)&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(output,name..type(v)..&amp;quot; \&amp;quot;&amp;quot;..tostring(v)..&amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			name = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local string = &amp;quot;&amp;quot;&lt;br /&gt;
	for k,v in ipairs(output) do&lt;br /&gt;
		if outputDirectly then&lt;br /&gt;
			outputConsole(v)&lt;br /&gt;
		end&lt;br /&gt;
		string = string..v&lt;br /&gt;
	end&lt;br /&gt;
	return string, output&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside Example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Get a table of all players on the server (if there are 4 players).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(getElementsByType(&amp;quot;player&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Output:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(4) &amp;quot;table: 02998058&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
With 'verbose' modifier.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&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;
table(1) &amp;quot;table: 043C6900&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now another table we created before (please note that the table 'test2' is both key and value in this example):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 020B7838&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 021770A0&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 02313070&amp;quot;&lt;br /&gt;
       {&lt;br /&gt;
            [number &amp;quot;1&amp;quot;] =&amp;gt; string(4) &amp;quot;haha&amp;quot;&lt;br /&gt;
            [number &amp;quot;2&amp;quot;] =&amp;gt; string(4) &amp;quot;naja&amp;quot;&lt;br /&gt;
       }]&lt;br /&gt;
       =&amp;gt; table(2) &amp;quot;table: 02313070&amp;quot;&lt;br /&gt;
       {&lt;br /&gt;
            [number &amp;quot;1&amp;quot;] =&amp;gt; string(4) &amp;quot;haha&amp;quot;&lt;br /&gt;
            [number &amp;quot;2&amp;quot;] =&amp;gt; string(4) &amp;quot;naja&amp;quot;&lt;br /&gt;
       }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with a modifier to output the second table 'normal':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-n&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 01BB9030&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 0223B2D8&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with a modifier to output the second table only to depth 1 (the verbose is still active from the first argument):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table(1) &amp;quot;table: 029BE6E8&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
table(2) &amp;quot;table: 01E2CDF8&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 021C6378&amp;quot;] =&amp;gt; table(2) &amp;quot;table: 021C6378&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now with names to make clear which output belongs to which variable (of course in this small example, it's not really needed):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
test = {hello=&amp;quot;test&amp;quot;}&lt;br /&gt;
test2 = {&amp;quot;haha&amp;quot;,&amp;quot;naja&amp;quot;}&lt;br /&gt;
test[test2] = test2&lt;br /&gt;
var_dump(&amp;quot;-v&amp;quot;,&amp;quot;players&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;,&amp;quot;test tables&amp;quot;,test)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
players: table(1) &amp;quot;table: 0219F4D0&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [number &amp;quot;1&amp;quot;] =&amp;gt; userdata(player) &amp;quot;userdata: 00000134&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
test tables: table(2) &amp;quot;table: 0219DB20&amp;quot;&lt;br /&gt;
 {&lt;br /&gt;
      [string(5) &amp;quot;hello&amp;quot;] =&amp;gt; string(4) &amp;quot;test&amp;quot;&lt;br /&gt;
      [table(2) &amp;quot;table: 01B68048&amp;quot;] =&amp;gt; table(2) &amp;quot;table: 01B68048&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same as before, but now 'unnamed', meaning all values that are not modifiers will be output as values. However, the last two arguments were also removed, which leaves the last modifier as last argument, which will output the modifier as a normal value:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var_dump(&amp;quot;-u&amp;quot;,&amp;quot;players&amp;quot;,getElementsByType(&amp;quot;player&amp;quot;),&amp;quot;-d1&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string(7) &amp;quot;players&amp;quot;&lt;br /&gt;
table(1) &amp;quot;table: 028B8A10&amp;quot;&lt;br /&gt;
string(3) &amp;quot;-d1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&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>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=21637</id>
		<title>Access Control List</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=21637"/>
		<updated>2009-10-02T19:47:30Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA includes a complete Access Control List (ACL) that allows you to secure and limit access to the server, its functions and resources in any number of ways.&lt;br /&gt;
&lt;br /&gt;
The key concept of MTA's ACL (and ACLs in general) is that you're giving a specific object a set of rights. In MTA's case objects are one of two things - resources or users. There are numerous ''rights'' available in MTA - these mainly focus on server-side scripting functions. &lt;br /&gt;
&lt;br /&gt;
What this essentially means is that the ACL allows you to choose exactly what functions a resource or user can perform. This can obviously be invaluable - for example preventing all your server's players from being able to ban each other, or preventing your new untested resources from doing the same. &lt;br /&gt;
&lt;br /&gt;
Of course, ''with great power comes great responsibility'' and it is very easily possible to completely break resources - for example, disabling [[spawnPlayer]] for all resources would be a Bad Thing. Of course, there are situations when you might want to do this - if you want to force all your resources to use a spawn manager resource for example, but even this is somewhat draconian.&lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
There are three ways you can modify the ACL - how you do it depends who you are.&lt;br /&gt;
&lt;br /&gt;
===HTTP Interface===&lt;br /&gt;
You can use the [[Resource/webadmin|webadmin]] http interface to modify the ACL in your web browser. This is by far the easiest way to do so. Just make sure the ''webadmin'' resource is started on your server and visit ''&amp;lt;nowiki&amp;gt;http://ServerIP:HttpPort/&amp;lt;/nowiki&amp;gt;''. You can then use the two sections - ACLs and Groups. ACLs allows you to create your Access Control Lists - lists of rights. Groups allow you to group together collections of users and assign ACLs to them. For example, the ACLs section allows you to specify that the Admin ACL has access to the ''start'' console command. You can the go to the Groups section and create an Admin ''group'' that has access to your Admin ''acl''. You can then add users to your Admin ''group''.&lt;br /&gt;
&lt;br /&gt;
===XML file===&lt;br /&gt;
You can modify the ACL.xml file manually. This has a fairly straightforward syntax, but it can get a bit confusing at times. If you do it while the server is running, don't forget to call the scripting function [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;) so the new ACL is loaded, or otherwise stop your server before modifying. This also prevents your changes from being accidentally overwritten by the server.&lt;br /&gt;
&lt;br /&gt;
===Scripting functions===&lt;br /&gt;
You can use a large number of ACL scripting functions to modify the ACL on the fly. Of course, you can (and really should!) limit access to the ACL functions with the ACL.&lt;br /&gt;
&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWaterColor&amp;diff=20938</id>
		<title>SetWaterColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWaterColor&amp;diff=20938"/>
		<updated>2009-07-30T17:17:54Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function changes the water color of the GTA world.&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 setWaterColor ( int red, int green, int blue, [ int alpha = 200 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''red:''' The ''red'' value of the water, from 0 to 255.&lt;br /&gt;
*'''green:''' The ''green'' value of the water, from 0 to 255.&lt;br /&gt;
*'''blue:''' The ''blue'' value of the water, from 0 to 255.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''alpha:''' The ''alpha'' (visibility) value of the water, from 0 to 255. Defaults to 200 if not declared.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if water color was set correctly, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example adds a command ''watercolor'' with which a player can change the water colour.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeWaterColor ( commandName, red, green, blue, alpha )&lt;br /&gt;
    -- if alpha is input, then include it too&lt;br /&gt;
    alpha = tonumber ( alpha ) or 200&lt;br /&gt;
    red = tonumber ( red )&lt;br /&gt;
    green = tonumber ( green )&lt;br /&gt;
    blue = tonumber ( blue )&lt;br /&gt;
    -- check if the colour values for red, green and blue are valid&lt;br /&gt;
    if red and green and blue then&lt;br /&gt;
        setWaterColor ( red, green, blue, alpha )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( &amp;quot;Failed to change the water colour!&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;watercolor&amp;quot;, changeWaterColor )&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>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=20578</id>
		<title>Resource:Race</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=20578"/>
		<updated>2009-07-12T14:11:53Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The &amp;quot;race&amp;quot; gamemode organizes sprint or freeroam races for one or more players. It supports both maps from MTA:Race and maps in the MTA:SA DM map syntax that were created in the map editor.&lt;br /&gt;
&lt;br /&gt;
==Ingame==&lt;br /&gt;
Playing race is quite straightforward. If there are checkpoints, drive from checkpoint to checkpoint and be the first to reach the finish line within the time. If there are no checkpoints, just drive around and have fun.&lt;br /&gt;
&lt;br /&gt;
In races you may encounter three types of pickups which will have an effect on your vehicle:&lt;br /&gt;
*'''Repair pickups:''' this pickup looks like a wrench. If you drive over it, your vehicle will be restored to full health.&lt;br /&gt;
*'''Nitrous oxide pickups:''' a red NOS bottle. After you drive over one you can press the fire button (by default the left mouse button) to get a temporary speed boost.&lt;br /&gt;
*'''Vehicle change pickups:''' these display the name of a vehicle above them. As soon as you drive over a pickup your vehicle will be changed.&lt;br /&gt;
&lt;br /&gt;
Lastly, if you get stuck during a race, you can enter the /kill command in the chatbox to kill yourself and respawn at the previous checkpoint.&lt;br /&gt;
&lt;br /&gt;
==Installing maps==&lt;br /&gt;
===Installing maps in MTA:Race syntax===&lt;br /&gt;
Adding MTA:Race maps to your DM server is easy. All you have to do is place the file in a folder and add a meta.xml. No conversion is necessary.&lt;br /&gt;
*Go to the &amp;quot;resources&amp;quot; folder of your server installation (&amp;lt;SERVER&amp;gt;\mods\deathmatch\resources) and create a new folder. In order to keep with conventions, the folder name should be in the format &amp;quot;race-&amp;lt;mapname&amp;gt;&amp;quot;, so if the map file is called &amp;quot;Dirtring.map&amp;quot; you might call the folder &amp;quot;race-dirtring&amp;quot;.&lt;br /&gt;
*Copy the .map file into the new folder&lt;br /&gt;
*Create a meta.xml file in the new folder and paste the following text into it:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 20px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;race src=&amp;quot;.map&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*Enter the name of the map, for example &amp;quot;Dirtring&amp;quot;, in the &amp;quot;name&amp;quot; attribute of the &amp;lt;info&amp;gt; node.&lt;br /&gt;
*Enter the name of the .map file in the &amp;quot;src&amp;quot; attribute of the &amp;lt;race&amp;gt; node, for example &amp;quot;Dirtring.map&amp;quot;.&lt;br /&gt;
*Save the meta.xml.&lt;br /&gt;
*Add more maps if you wish. When you're done, /refresh your server resources.&lt;br /&gt;
&lt;br /&gt;
===Installing maps in DM syntax===&lt;br /&gt;
If you created the map yourself in the MTA:SA DM map editor (not released at this point), everything will be in place and you only need to /refresh. If you downloaded the map, place it in your server &amp;quot;resources&amp;quot; folder and /refresh.&lt;br /&gt;
&lt;br /&gt;
===Converting maps from Race syntax to DM syntax===&lt;br /&gt;
The MTA:SA DM map editor can only edit maps in the DM syntax. If you want to edit maps that are in MTA:Race syntax, you need to convert them.&lt;br /&gt;
*Make sure the map you want to convert is not in a zip file. If it is, create a folder with the same name as the zip file and extract the zip contents into it.&lt;br /&gt;
*Make sure race is started. Either have a race map running, or do /start race.&lt;br /&gt;
*Enter the command /convrace &amp;lt;map resource name&amp;gt;.&lt;br /&gt;
*The conversion process should be very quick. Once conversion is complete a message will appear.&lt;br /&gt;
The map file is overwritten with the converted version. If you want to keep the original file, make sure you have a backup.&lt;br /&gt;
&lt;br /&gt;
==Map syntax==&lt;br /&gt;
===MTA:Race style syntax===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;race&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;meta&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Author name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Map description&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;Map version number&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;/meta&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;weather&amp;gt;Weather ID&amp;lt;/weather&amp;gt;&lt;br /&gt;
        &amp;lt;respawn&amp;gt;timelimit|none&amp;lt;/respawn&amp;gt;    &amp;lt;!-- Default = timelimit --&amp;gt;&lt;br /&gt;
        &amp;lt;duration&amp;gt;Maximum race time in seconds. Default is 10 minutes&amp;lt;/duration&amp;gt;&lt;br /&gt;
        &amp;lt;time&amp;gt;hour:minute&amp;lt;/time&amp;gt;        &amp;lt;!-- Time of day at which the race starts --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicleweapons&amp;gt;true|false&amp;lt;/vehicleweapons&amp;gt;    &amp;lt;!-- Vehicle weapon firing allowed or not. Default is false --&amp;gt;&lt;br /&gt;
        &amp;lt;ghostmode&amp;gt;true|false&amp;lt;/ghostmode&amp;gt;    &amp;lt;!-- Disables vehicle collision. Default is false. --&amp;gt;&lt;br /&gt;
        &amp;lt;skins&amp;gt;cj|random|rangelist&amp;gt;&amp;lt;/skins&amp;gt;    &amp;lt;!-- Skins for the players. See explanation below for rangelist --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- if respawn == timelimit --&amp;gt;&lt;br /&gt;
        &amp;lt;respawntime&amp;gt;Time from death to respawn in seconds. Default is 10.&amp;lt;/respawntime&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;rotation&amp;gt;Angle in degrees. 0 = north, higher values go counter clockwise.&amp;lt;/rotation&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle number&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;Paintjob ID, ranges from 0 to 3&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated list of vehicle upgrade numbers&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/spawnpoint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;size&amp;gt;Float. Higher values make the checkpoint marker bigger. Default is 1&amp;lt;/size&amp;gt;&lt;br /&gt;
        &amp;lt;color&amp;gt;R G B&amp;lt;/color&amp;gt;   &amp;lt;!-- R, G and B range from 0 to 255. Default color is 0 0 255 (blue) --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle ID to change into when passing through this checkpoint&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;Paintjob ID, ranges from 0 to 3&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated list of vehicle upgrade numbers&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/checkpoint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;rotation&amp;gt;rotX rotY rotZ&amp;lt;/rotation&amp;gt;  &amp;lt;!-- Each rotation is in radians. Rotations for X and Z are switched. --&amp;gt;&lt;br /&gt;
        &amp;lt;model&amp;gt;Model ID&amp;lt;/model&amp;gt;&lt;br /&gt;
    &amp;lt;/object&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;repair|nitro|vehiclechange&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;!-- if type == vehiclechange --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle ID to change into&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;paintjob ID&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated upgrade list&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/pickup&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;skins&amp;gt; option can be &amp;quot;cj&amp;quot; (players are CJ in random clothes), &amp;quot;random&amp;quot; (players have random ped skins), or a range list. A range list is a space separated list of single numbers and ranges of numbers expressed as &amp;quot;start-end&amp;quot;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;18 40-50 65-68 72 200&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The skin of each player will be chosen at random from this list.&lt;br /&gt;
&lt;br /&gt;
===MTA:SA DM style syntax===&lt;br /&gt;
====.map file====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;deathmatch&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotation=&amp;quot;Rotation in degrees&amp;quot; vehicle=&amp;quot;Vehicle ID&amp;quot; id=&amp;quot;spawnpointID&amp;quot; [ paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;*comma*-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; color=&amp;quot;#FF0000&amp;quot; id=&amp;quot;textual or numeric checkpoint ID&amp;quot; nextid=&amp;quot;ID of checkpoint after this one&amp;quot; [ size=&amp;quot;checkpoint size&amp;quot; vehicle=&amp;quot;vehicle ID to change into&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotX=&amp;quot;in degrees&amp;quot; rotY=&amp;quot;in degrees&amp;quot; rotZ=&amp;quot;in degrees&amp;quot; model=&amp;quot;model ID&amp;quot; id=&amp;quot;objectID&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; type=&amp;quot;repair|nitro|vehiclechange&amp;quot; id=&amp;quot;pickupID&amp;quot; [ vehicle=&amp;quot;vehicle ID&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;Map name&amp;quot; author=&amp;quot;Author name&amp;quot; description=&amp;quot;Map description&amp;quot; version=&amp;quot;Map version number&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;race src=&amp;quot;Map file.map&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;settings&amp;gt;&lt;br /&gt;
      &amp;lt;setting name=&amp;quot;#optionName&amp;quot; value=&amp;quot;optionValue&amp;quot;/&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
   &amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;setting&amp;gt;s correspond to options in MTA:Race syntax. For example, &amp;lt;time&amp;gt;4:0&amp;lt;/time&amp;gt; in MTA:Race syntax would correspond to &amp;lt;setting name=&amp;quot;#time&amp;quot; value=&amp;quot;4:0&amp;quot;/&amp;gt; in DM syntax.&lt;br /&gt;
&lt;br /&gt;
==Adding your scripts to Race==&lt;br /&gt;
If you want to add new features to Race, you can either modify the original Race resource files, or more preferably, add the features as a separate resource and communicate with Race via events.&lt;br /&gt;
Not hacking the Race core and is probably a good idea if you want to apply official updates and fixes for Race in the future. Choosing to use separate resources for your customization also means you can continue use customizations from other people, and if you so wish, share your customization with others.&lt;br /&gt;
&lt;br /&gt;
==Addons==&lt;br /&gt;
A Race 'addon' is no different from any other script resource, except that is has addon=&amp;quot;race&amp;quot; in the &amp;lt;info&amp;gt; section of it's meta.xml file. This is simply to allow Race to identify it and put it in the /config menu for you. Addons communicate with Race via events. The current list of Race events and what they do are here:&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3==&lt;br /&gt;
&lt;br /&gt;
===Server===&lt;br /&gt;
&lt;br /&gt;
'''onPlayerReachCheckpoint'''&lt;br /&gt;
&lt;br /&gt;
'''onPlayerPickUpRacePickup'''&lt;br /&gt;
&lt;br /&gt;
'''onMapStarting'''&lt;br /&gt;
&lt;br /&gt;
'''onPlayerFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onPostFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onPollStarting'''&lt;br /&gt;
&lt;br /&gt;
===Client===&lt;br /&gt;
'''onClientMapStarting'''&lt;br /&gt;
&lt;br /&gt;
'''onClientPlayerFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onClientPlayerOutOfTime'''&lt;br /&gt;
&lt;br /&gt;
'''onClientMapStopping'''&lt;br /&gt;
&lt;br /&gt;
'''onClientScreenFadedOut'''&lt;br /&gt;
&lt;br /&gt;
'''onClientScreenFadedIn'''&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3 in detail==&lt;br /&gt;
===onPlayerReachCheckpoint===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''checkpoint:''' the number of the checkpoint the player went through. The first checkpoint has number 1.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that reached the checkpoint.&lt;br /&gt;
&lt;br /&gt;
===onPlayerPickUpRacePickup===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''pickupID:''' the number of the pickup in case of MTA:Race syntax (starting at 1), or the &amp;quot;id&amp;quot; attribute of the pickup in case of DM syntax.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that picked up the pickup.&lt;br /&gt;
&lt;br /&gt;
==Element data==&lt;br /&gt;
These element data are set on each player:&lt;br /&gt;
*'''Race rank:''' the current position of the player in the race. 1 = first, 2 = second etc. Updated on a 1 second interval.&lt;br /&gt;
*'''race.checkpoint:''' the number of the checkpoint the player is ''heading for''. When the player spawns this number is 1, after he passed the first checkpoint it's 2, etc.&lt;br /&gt;
*'''race.finished:''' ''true'' if the player has finished, ''false'' if he's still racing.&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=20533</id>
		<title>Resource:Race</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=20533"/>
		<updated>2009-07-10T15:38:18Z</updated>

		<summary type="html">&lt;p&gt;Norby89: wrong default checkpoint size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The &amp;quot;race&amp;quot; gamemode organizes sprint or freeroam races for one or more players. It supports both maps from MTA:Race and maps in the MTA:SA DM map syntax that were created in the map editor.&lt;br /&gt;
&lt;br /&gt;
==Ingame==&lt;br /&gt;
Playing race is quite straightforward. If there are checkpoints, drive from checkpoint to checkpoint and be the first to reach the finish line within the time. If there are no checkpoints, just drive around and have fun.&lt;br /&gt;
&lt;br /&gt;
In races you may encounter three types of pickups which will have an effect on your vehicle:&lt;br /&gt;
*'''Repair pickups:''' this pickup looks like a wrench. If you drive over it, your vehicle will be restored to full health.&lt;br /&gt;
*'''Nitrous oxide pickups:''' a red NOS bottle. After you drive over one you can press the fire button (by default the left mouse button) to get a temporary speed boost.&lt;br /&gt;
*'''Vehicle change pickups:''' these display the name of a vehicle above them. As soon as you drive over a pickup your vehicle will be changed.&lt;br /&gt;
&lt;br /&gt;
Lastly, if you get stuck during a race, you can enter the /kill command in the chatbox to kill yourself and respawn at the previous checkpoint.&lt;br /&gt;
&lt;br /&gt;
==Installing maps==&lt;br /&gt;
===Installing maps in MTA:Race syntax===&lt;br /&gt;
Adding MTA:Race maps to your DM server is easy. All you have to do is place the file in a folder and add a meta.xml. No conversion is necessary.&lt;br /&gt;
*Go to the &amp;quot;resources&amp;quot; folder of your server installation (&amp;lt;SERVER&amp;gt;\mods\deathmatch\resources) and create a new folder. In order to keep with conventions, the folder name should be in the format &amp;quot;race-&amp;lt;mapname&amp;gt;&amp;quot;, so if the map file is called &amp;quot;Dirtring.map&amp;quot; you might call the folder &amp;quot;race-dirtring&amp;quot;.&lt;br /&gt;
*Copy the .map file into the new folder&lt;br /&gt;
*Create a meta.xml file in the new folder and paste the following text into it:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 20px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;race src=&amp;quot;.map&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*Enter the name of the map, for example &amp;quot;Dirtring&amp;quot;, in the &amp;quot;name&amp;quot; attribute of the &amp;lt;info&amp;gt; node.&lt;br /&gt;
*Enter the name of the .map file in the &amp;quot;src&amp;quot; attribute of the &amp;lt;race&amp;gt; node, for example &amp;quot;Dirtring.map&amp;quot;.&lt;br /&gt;
*Save the meta.xml.&lt;br /&gt;
*Add more maps if you wish. When you're done, /refresh your server resources.&lt;br /&gt;
&lt;br /&gt;
===Installing maps in DM syntax===&lt;br /&gt;
If you created the map yourself in the MTA:SA DM map editor (not released at this point), everything will be in place and you only need to /refresh. If you downloaded the map, place it in your server &amp;quot;resources&amp;quot; folder and /refresh.&lt;br /&gt;
&lt;br /&gt;
===Converting maps from Race syntax to DM syntax===&lt;br /&gt;
The MTA:SA DM map editor can only edit maps in the DM syntax. If you want to edit maps that are in MTA:Race syntax, you need to convert them.&lt;br /&gt;
*Make sure the map you want to convert is not in a zip file. If it is, create a folder with the same name as the zip file and extract the zip contents into it.&lt;br /&gt;
*Make sure race is started. Either have a race map running, or do /start race.&lt;br /&gt;
*Enter the command /convrace &amp;lt;map resource name&amp;gt;.&lt;br /&gt;
*The conversion process should be very quick. Once conversion is complete a message will appear.&lt;br /&gt;
The map file is overwritten with the converted version. If you want to keep the original file, make sure you have a backup.&lt;br /&gt;
&lt;br /&gt;
==Map syntax==&lt;br /&gt;
===MTA:Race style syntax===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;race&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;meta&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Author name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Map description&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;Map version number&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;/meta&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;weather&amp;gt;Weather ID&amp;lt;/weather&amp;gt;&lt;br /&gt;
        &amp;lt;respawn&amp;gt;timelimit|none&amp;lt;/respawn&amp;gt;    &amp;lt;!-- Default = timelimit --&amp;gt;&lt;br /&gt;
        &amp;lt;duration&amp;gt;Maximum race time in seconds. Default is 10 minutes&amp;lt;/duration&amp;gt;&lt;br /&gt;
        &amp;lt;time&amp;gt;hour:minute&amp;lt;/time&amp;gt;        &amp;lt;!-- Time of day at which the race starts --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicleweapons&amp;gt;true|false&amp;lt;/vehicleweapons&amp;gt;    &amp;lt;!-- Vehicle weapon firing allowed or not. Default is false --&amp;gt;&lt;br /&gt;
        &amp;lt;ghostmode&amp;gt;true|false&amp;lt;/ghostmode&amp;gt;    &amp;lt;!-- Disables vehicle collision. Default is false. --&amp;gt;&lt;br /&gt;
        &amp;lt;skins&amp;gt;cj|random|rangelist&amp;gt;&amp;lt;/skins&amp;gt;    &amp;lt;!-- Skins for the players. See explanation below for rangelist --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- if respawn == timelimit --&amp;gt;&lt;br /&gt;
        &amp;lt;respawntime&amp;gt;Time from death to respawn in seconds. Default is 5.&amp;lt;/respawntime&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;rotation&amp;gt;Angle in degrees. 0 = north, higher values go counter clockwise.&amp;lt;/rotation&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle number&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;Paintjob ID, ranges from 0 to 3&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated list of vehicle upgrade numbers&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/spawnpoint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;size&amp;gt;Float. Higher values make the checkpoint marker bigger. Default is 1&amp;lt;/size&amp;gt;&lt;br /&gt;
        &amp;lt;color&amp;gt;R G B&amp;lt;/color&amp;gt;   &amp;lt;!-- R, G and B range from 0 to 255. Default color is 0 0 255 (blue) --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle ID to change into when passing through this checkpoint&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;Paintjob ID, ranges from 0 to 3&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated list of vehicle upgrade numbers&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/checkpoint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;rotation&amp;gt;rotX rotY rotZ&amp;lt;/rotation&amp;gt;  &amp;lt;!-- Each rotation is in radians. Rotations for X and Z are switched. --&amp;gt;&lt;br /&gt;
        &amp;lt;model&amp;gt;Model ID&amp;lt;/model&amp;gt;&lt;br /&gt;
    &amp;lt;/object&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;repair|nitro|vehiclechange&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;!-- if type == vehiclechange --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle ID to change into&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;paintjob ID&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated upgrade list&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/pickup&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;skins&amp;gt; option can be &amp;quot;cj&amp;quot; (players are CJ in random clothes), &amp;quot;random&amp;quot; (players have random ped skins), or a range list. A range list is a space separated list of single numbers and ranges of numbers expressed as &amp;quot;start-end&amp;quot;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;18 40-50 65-68 72 200&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The skin of each player will be chosen at random from this list.&lt;br /&gt;
&lt;br /&gt;
===MTA:SA DM style syntax===&lt;br /&gt;
====.map file====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;deathmatch&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotation=&amp;quot;Rotation in degrees&amp;quot; vehicle=&amp;quot;Vehicle ID&amp;quot; id=&amp;quot;spawnpointID&amp;quot; [ paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;*comma*-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; color=&amp;quot;#FF0000&amp;quot; id=&amp;quot;textual or numeric checkpoint ID&amp;quot; nextid=&amp;quot;ID of checkpoint after this one&amp;quot; [ size=&amp;quot;checkpoint size&amp;quot; vehicle=&amp;quot;vehicle ID to change into&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotX=&amp;quot;in degrees&amp;quot; rotY=&amp;quot;in degrees&amp;quot; rotZ=&amp;quot;in degrees&amp;quot; model=&amp;quot;model ID&amp;quot; id=&amp;quot;objectID&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; type=&amp;quot;repair|nitro|vehiclechange&amp;quot; id=&amp;quot;pickupID&amp;quot; [ vehicle=&amp;quot;vehicle ID&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;Map name&amp;quot; author=&amp;quot;Author name&amp;quot; description=&amp;quot;Map description&amp;quot; version=&amp;quot;Map version number&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;race src=&amp;quot;Map file.map&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;settings&amp;gt;&lt;br /&gt;
      &amp;lt;setting name=&amp;quot;#optionName&amp;quot; value=&amp;quot;optionValue&amp;quot;/&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
   &amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;setting&amp;gt;s correspond to options in MTA:Race syntax. For example, &amp;lt;time&amp;gt;4:0&amp;lt;/time&amp;gt; in MTA:Race syntax would correspond to &amp;lt;setting name=&amp;quot;#time&amp;quot; value=&amp;quot;4:0&amp;quot;/&amp;gt; in DM syntax.&lt;br /&gt;
&lt;br /&gt;
==Adding your scripts to Race==&lt;br /&gt;
If you want to add new features to Race, you can either modify the original Race resource files, or more preferably, add the features as a separate resource and communicate with Race via events.&lt;br /&gt;
Not hacking the Race core and is probably a good idea if you want to apply official updates and fixes for Race in the future. Choosing to use separate resources for your customization also means you can continue use customizations from other people, and if you so wish, share your customization with others.&lt;br /&gt;
&lt;br /&gt;
==Addons==&lt;br /&gt;
A Race 'addon' is no different from any other script resource, except that is has addon=&amp;quot;race&amp;quot; in the &amp;lt;info&amp;gt; section of it's meta.xml file. This is simply to allow Race to identify it and put it in the /config menu for you. Addons communicate with Race via events. The current list of Race events and what they do are here:&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3==&lt;br /&gt;
&lt;br /&gt;
==Server==&lt;br /&gt;
&lt;br /&gt;
'''onPlayerReachCheckpoint'''&lt;br /&gt;
&lt;br /&gt;
'''onPlayerPickUpRacePickup'''&lt;br /&gt;
&lt;br /&gt;
'''onMapStarting'''&lt;br /&gt;
&lt;br /&gt;
'''onPlayerFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onPostFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onPollStarting'''&lt;br /&gt;
&lt;br /&gt;
==Client==&lt;br /&gt;
'''onClientMapStarting'''&lt;br /&gt;
&lt;br /&gt;
'''onClientPlayerFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onClientPlayerOutOfTime'''&lt;br /&gt;
&lt;br /&gt;
'''onClientMapStopping'''&lt;br /&gt;
&lt;br /&gt;
'''onClientScreenFadedOut'''&lt;br /&gt;
&lt;br /&gt;
'''onClientScreenFadedIn'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3 in detail==&lt;br /&gt;
===onPlayerReachCheckpoint===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''checkpoint:''' the number of the checkpoint the player went through. The first checkpoint has number 1.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that reached the checkpoint.&lt;br /&gt;
&lt;br /&gt;
===onPlayerPickUpRacePickup===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''pickupID:''' the number of the pickup in case of MTA:Race syntax (starting at 1), or the &amp;quot;id&amp;quot; attribute of the pickup in case of DM syntax.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that picked up the pickup.&lt;br /&gt;
&lt;br /&gt;
==Element data==&lt;br /&gt;
These element data are set on each player:&lt;br /&gt;
*'''Race rank:''' the current position of the player in the race. 1 = first, 2 = second etc. Updated on a 1 second interval.&lt;br /&gt;
*'''race.checkpoint:''' the number of the checkpoint the player is ''heading for''. When the player spawns this number is 1, after he passed the first checkpoint it's 2, etc.&lt;br /&gt;
*'''race.finished:''' ''true'' if the player has finished, ''false'' if he's still racing.&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=20532</id>
		<title>Resource:Race</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Race&amp;diff=20532"/>
		<updated>2009-07-10T15:28:30Z</updated>

		<summary type="html">&lt;p&gt;Norby89: wrong default values&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The &amp;quot;race&amp;quot; gamemode organizes sprint or freeroam races for one or more players. It supports both maps from MTA:Race and maps in the MTA:SA DM map syntax that were created in the map editor.&lt;br /&gt;
&lt;br /&gt;
==Ingame==&lt;br /&gt;
Playing race is quite straightforward. If there are checkpoints, drive from checkpoint to checkpoint and be the first to reach the finish line within the time. If there are no checkpoints, just drive around and have fun.&lt;br /&gt;
&lt;br /&gt;
In races you may encounter three types of pickups which will have an effect on your vehicle:&lt;br /&gt;
*'''Repair pickups:''' this pickup looks like a wrench. If you drive over it, your vehicle will be restored to full health.&lt;br /&gt;
*'''Nitrous oxide pickups:''' a red NOS bottle. After you drive over one you can press the fire button (by default the left mouse button) to get a temporary speed boost.&lt;br /&gt;
*'''Vehicle change pickups:''' these display the name of a vehicle above them. As soon as you drive over a pickup your vehicle will be changed.&lt;br /&gt;
&lt;br /&gt;
Lastly, if you get stuck during a race, you can enter the /kill command in the chatbox to kill yourself and respawn at the previous checkpoint.&lt;br /&gt;
&lt;br /&gt;
==Installing maps==&lt;br /&gt;
===Installing maps in MTA:Race syntax===&lt;br /&gt;
Adding MTA:Race maps to your DM server is easy. All you have to do is place the file in a folder and add a meta.xml. No conversion is necessary.&lt;br /&gt;
*Go to the &amp;quot;resources&amp;quot; folder of your server installation (&amp;lt;SERVER&amp;gt;\mods\deathmatch\resources) and create a new folder. In order to keep with conventions, the folder name should be in the format &amp;quot;race-&amp;lt;mapname&amp;gt;&amp;quot;, so if the map file is called &amp;quot;Dirtring.map&amp;quot; you might call the folder &amp;quot;race-dirtring&amp;quot;.&lt;br /&gt;
*Copy the .map file into the new folder&lt;br /&gt;
*Create a meta.xml file in the new folder and paste the following text into it:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 20px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;race src=&amp;quot;.map&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*Enter the name of the map, for example &amp;quot;Dirtring&amp;quot;, in the &amp;quot;name&amp;quot; attribute of the &amp;lt;info&amp;gt; node.&lt;br /&gt;
*Enter the name of the .map file in the &amp;quot;src&amp;quot; attribute of the &amp;lt;race&amp;gt; node, for example &amp;quot;Dirtring.map&amp;quot;.&lt;br /&gt;
*Save the meta.xml.&lt;br /&gt;
*Add more maps if you wish. When you're done, /refresh your server resources.&lt;br /&gt;
&lt;br /&gt;
===Installing maps in DM syntax===&lt;br /&gt;
If you created the map yourself in the MTA:SA DM map editor (not released at this point), everything will be in place and you only need to /refresh. If you downloaded the map, place it in your server &amp;quot;resources&amp;quot; folder and /refresh.&lt;br /&gt;
&lt;br /&gt;
===Converting maps from Race syntax to DM syntax===&lt;br /&gt;
The MTA:SA DM map editor can only edit maps in the DM syntax. If you want to edit maps that are in MTA:Race syntax, you need to convert them.&lt;br /&gt;
*Make sure the map you want to convert is not in a zip file. If it is, create a folder with the same name as the zip file and extract the zip contents into it.&lt;br /&gt;
*Make sure race is started. Either have a race map running, or do /start race.&lt;br /&gt;
*Enter the command /convrace &amp;lt;map resource name&amp;gt;.&lt;br /&gt;
*The conversion process should be very quick. Once conversion is complete a message will appear.&lt;br /&gt;
The map file is overwritten with the converted version. If you want to keep the original file, make sure you have a backup.&lt;br /&gt;
&lt;br /&gt;
==Map syntax==&lt;br /&gt;
===MTA:Race style syntax===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;race&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;meta&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Author name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Map description&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;Map version number&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;/meta&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;weather&amp;gt;Weather ID&amp;lt;/weather&amp;gt;&lt;br /&gt;
        &amp;lt;respawn&amp;gt;timelimit|none&amp;lt;/respawn&amp;gt;    &amp;lt;!-- Default = timelimit --&amp;gt;&lt;br /&gt;
        &amp;lt;duration&amp;gt;Maximum race time in seconds. Default is 10 minutes&amp;lt;/duration&amp;gt;&lt;br /&gt;
        &amp;lt;time&amp;gt;hour:minute&amp;lt;/time&amp;gt;        &amp;lt;!-- Time of day at which the race starts --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicleweapons&amp;gt;true|false&amp;lt;/vehicleweapons&amp;gt;    &amp;lt;!-- Vehicle weapon firing allowed or not. Default is false --&amp;gt;&lt;br /&gt;
        &amp;lt;ghostmode&amp;gt;true|false&amp;lt;/ghostmode&amp;gt;    &amp;lt;!-- Disables vehicle collision. Default is false. --&amp;gt;&lt;br /&gt;
        &amp;lt;skins&amp;gt;cj|random|rangelist&amp;gt;&amp;lt;/skins&amp;gt;    &amp;lt;!-- Skins for the players. See explanation below for rangelist --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- if respawn == timelimit --&amp;gt;&lt;br /&gt;
        &amp;lt;respawntime&amp;gt;Time from death to respawn in seconds. Default is 5.&amp;lt;/respawntime&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;rotation&amp;gt;Angle in degrees. 0 = north, higher values go counter clockwise.&amp;lt;/rotation&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle number&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;Paintjob ID, ranges from 0 to 3&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated list of vehicle upgrade numbers&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/spawnpoint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;size&amp;gt;Float. Higher values make the checkpoint marker bigger. Default is 2.25&amp;lt;/size&amp;gt;&lt;br /&gt;
        &amp;lt;color&amp;gt;R G B&amp;lt;/color&amp;gt;   &amp;lt;!-- R, G and B range from 0 to 255. Default color is 0 0 255 (blue) --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle ID to change into when passing through this checkpoint&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;Paintjob ID, ranges from 0 to 3&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated list of vehicle upgrade numbers&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/checkpoint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;rotation&amp;gt;rotX rotY rotZ&amp;lt;/rotation&amp;gt;  &amp;lt;!-- Each rotation is in radians. Rotations for X and Z are switched. --&amp;gt;&lt;br /&gt;
        &amp;lt;model&amp;gt;Model ID&amp;lt;/model&amp;gt;&lt;br /&gt;
    &amp;lt;/object&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup&amp;gt;&lt;br /&gt;
        &amp;lt;position&amp;gt;X Y Z&amp;lt;/position&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;repair|nitro|vehiclechange&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;!-- if type == vehiclechange --&amp;gt;&lt;br /&gt;
        &amp;lt;vehicle&amp;gt;Vehicle ID to change into&amp;lt;/vehicle&amp;gt;&lt;br /&gt;
        &amp;lt;!-- optional --&amp;gt;&lt;br /&gt;
        &amp;lt;paintjob&amp;gt;paintjob ID&amp;lt;/paintjob&amp;gt;&lt;br /&gt;
        &amp;lt;upgrades&amp;gt;Space separated upgrade list&amp;lt;/upgrades&amp;gt;&lt;br /&gt;
    &amp;lt;/pickup&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;skins&amp;gt; option can be &amp;quot;cj&amp;quot; (players are CJ in random clothes), &amp;quot;random&amp;quot; (players have random ped skins), or a range list. A range list is a space separated list of single numbers and ranges of numbers expressed as &amp;quot;start-end&amp;quot;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;18 40-50 65-68 72 200&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The skin of each player will be chosen at random from this list.&lt;br /&gt;
&lt;br /&gt;
===MTA:SA DM style syntax===&lt;br /&gt;
====.map file====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mod=&amp;quot;deathmatch&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- One or more --&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotation=&amp;quot;Rotation in degrees&amp;quot; vehicle=&amp;quot;Vehicle ID&amp;quot; id=&amp;quot;spawnpointID&amp;quot; [ paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;*comma*-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;checkpoint posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; color=&amp;quot;#FF0000&amp;quot; id=&amp;quot;textual or numeric checkpoint ID&amp;quot; nextid=&amp;quot;ID of checkpoint after this one&amp;quot; [ size=&amp;quot;checkpoint size&amp;quot; vehicle=&amp;quot;vehicle ID to change into&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;object posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; rotX=&amp;quot;in degrees&amp;quot; rotY=&amp;quot;in degrees&amp;quot; rotZ=&amp;quot;in degrees&amp;quot; model=&amp;quot;model ID&amp;quot; id=&amp;quot;objectID&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Zero or more --&amp;gt;&lt;br /&gt;
    &amp;lt;pickup posX=&amp;quot;X&amp;quot; posY=&amp;quot;Y&amp;quot; posZ=&amp;quot;Z&amp;quot; type=&amp;quot;repair|nitro|vehiclechange&amp;quot; id=&amp;quot;pickupID&amp;quot; [ vehicle=&amp;quot;vehicle ID&amp;quot; paintjob=&amp;quot;paintjob ID&amp;quot; upgrades=&amp;quot;comma-separated list of upgrades&amp;quot; ] /&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;race&amp;quot; name=&amp;quot;Map name&amp;quot; author=&amp;quot;Author name&amp;quot; description=&amp;quot;Map description&amp;quot; version=&amp;quot;Map version number&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;race src=&amp;quot;Map file.map&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;settings&amp;gt;&lt;br /&gt;
      &amp;lt;setting name=&amp;quot;#optionName&amp;quot; value=&amp;quot;optionValue&amp;quot;/&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
   &amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;setting&amp;gt;s correspond to options in MTA:Race syntax. For example, &amp;lt;time&amp;gt;4:0&amp;lt;/time&amp;gt; in MTA:Race syntax would correspond to &amp;lt;setting name=&amp;quot;#time&amp;quot; value=&amp;quot;4:0&amp;quot;/&amp;gt; in DM syntax.&lt;br /&gt;
&lt;br /&gt;
==Adding your scripts to Race==&lt;br /&gt;
If you want to add new features to Race, you can either modify the original Race resource files, or more preferably, add the features as a separate resource and communicate with Race via events.&lt;br /&gt;
Not hacking the Race core and is probably a good idea if you want to apply official updates and fixes for Race in the future. Choosing to use separate resources for your customization also means you can continue use customizations from other people, and if you so wish, share your customization with others.&lt;br /&gt;
&lt;br /&gt;
==Addons==&lt;br /&gt;
A Race 'addon' is no different from any other script resource, except that is has addon=&amp;quot;race&amp;quot; in the &amp;lt;info&amp;gt; section of it's meta.xml file. This is simply to allow Race to identify it and put it in the /config menu for you. Addons communicate with Race via events. The current list of Race events and what they do are here:&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3==&lt;br /&gt;
&lt;br /&gt;
==Server==&lt;br /&gt;
&lt;br /&gt;
'''onPlayerReachCheckpoint'''&lt;br /&gt;
&lt;br /&gt;
'''onPlayerPickUpRacePickup'''&lt;br /&gt;
&lt;br /&gt;
'''onMapStarting'''&lt;br /&gt;
&lt;br /&gt;
'''onPlayerFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onPostFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onPollStarting'''&lt;br /&gt;
&lt;br /&gt;
==Client==&lt;br /&gt;
'''onClientMapStarting'''&lt;br /&gt;
&lt;br /&gt;
'''onClientPlayerFinish'''&lt;br /&gt;
&lt;br /&gt;
'''onClientPlayerOutOfTime'''&lt;br /&gt;
&lt;br /&gt;
'''onClientMapStopping'''&lt;br /&gt;
&lt;br /&gt;
'''onClientScreenFadedOut'''&lt;br /&gt;
&lt;br /&gt;
'''onClientScreenFadedIn'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Events for version 0.8.3 in detail==&lt;br /&gt;
===onPlayerReachCheckpoint===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int checkpoint&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''checkpoint:''' the number of the checkpoint the player went through. The first checkpoint has number 1.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that reached the checkpoint.&lt;br /&gt;
&lt;br /&gt;
===onPlayerPickUpRacePickup===&lt;br /&gt;
====Parameters====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int/string pickupID&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''pickupID:''' the number of the pickup in case of MTA:Race syntax (starting at 1), or the &amp;quot;id&amp;quot; attribute of the pickup in case of DM syntax.&lt;br /&gt;
&lt;br /&gt;
====Source====&lt;br /&gt;
The source is the player that picked up the pickup.&lt;br /&gt;
&lt;br /&gt;
==Element data==&lt;br /&gt;
These element data are set on each player:&lt;br /&gt;
*'''Race rank:''' the current position of the player in the race. 1 = first, 2 = second etc. Updated on a 1 second interval.&lt;br /&gt;
*'''race.checkpoint:''' the number of the checkpoint the player is ''heading for''. When the player spawns this number is 1, after he passed the first checkpoint it's 2, etc.&lt;br /&gt;
*'''race.finished:''' ''true'' if the player has finished, ''false'' if he's still racing.&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=17718</id>
		<title>GetVehiclePanelState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=17718"/>
		<updated>2008-09-23T06:55:01Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|A list of panels would be nice and a more specific explanation on what the function returns --[[User:Norby89|Norby89]] 12:30, 26 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getVehiclePanelState ( vehicle thevehicle, int panel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to know the panel state of.&lt;br /&gt;
*'''panel:''' An ''integer'' ranging from 0 to 6.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[int]] indicating the state of the specified the panel. This value can be:&lt;br /&gt;
&lt;br /&gt;
NEEDS UPDATING&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This function creates an admiral and outputs every panel's state in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local admiral = createVehicle ( 445, 0, 0, 10 )&lt;br /&gt;
&lt;br /&gt;
for i=0, 6 do&lt;br /&gt;
  local panel = getVehiclePanelState ( admiral, i )&lt;br /&gt;
    outputChatBox ( panel )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsGarageOpen&amp;diff=17705</id>
		<title>IsGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsGarageOpen&amp;diff=17705"/>
		<updated>2008-09-19T12:37:21Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks whether or not a specific garage door is open.&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 isGarageOpen ( int garageID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door that is being checked.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the garage is open, ''false'' if it is closed or an invalid garage ID was given.&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 opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCube(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
[[Category:Needs_More_Examples]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=17704</id>
		<title>SetGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=17704"/>
		<updated>2008-09-19T12:37:04Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function opens or closes the specified garage door in the world.&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 setGarageOpen ( int garageID, bool open )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door being opened or closed.&lt;br /&gt;
*'''isOpen:''' A boolean indicating whether or not to open the door.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid garage id was given.&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 opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(getThisResource()),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCube(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
[[Category:Needs_More_Examples]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_XML_functions&amp;diff=16532</id>
		<title>Template:Client XML functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_XML_functions&amp;diff=16532"/>
		<updated>2008-04-06T11:18:01Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[xmlCopyFile]]&lt;br /&gt;
*[[xmlCreateFile]]&lt;br /&gt;
*[[xmlCreateSubNode]]&lt;br /&gt;
*[[xmlDestroyNode]]&lt;br /&gt;
*[[xmlFindSubNode]]&lt;br /&gt;
*[[xmlLoadFile]]&lt;br /&gt;
*[[xmlNodeGetAttribute]]&lt;br /&gt;
*[[xmlNodeGetValue]]&lt;br /&gt;
*[[xmlNodeSetAttribute]]&lt;br /&gt;
*[[xmlNodeSetValue]]&lt;br /&gt;
*[[xmlSaveFile]]&lt;br /&gt;
*[[xmlUnloadFile]]&lt;br /&gt;
{{New feature|3|DP3|&lt;br /&gt;
*[[xmlNodeGetChildren ]]&lt;br /&gt;
*[[xmlNodeGetParent ]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:XML_functions&amp;diff=16531</id>
		<title>Template:XML functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:XML_functions&amp;diff=16531"/>
		<updated>2008-04-06T11:17:34Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[xmlCopyFile]]&lt;br /&gt;
*[[xmlCreateFile]]&lt;br /&gt;
*[[xmlCreateSubNode]]&lt;br /&gt;
*[[xmlDestroyNode]]&lt;br /&gt;
*[[xmlFindSubNode]]&lt;br /&gt;
*[[xmlLoadFile]]&lt;br /&gt;
*[[xmlNodeGetAttribute]]&lt;br /&gt;
*[[xmlNodeGetValue]]&lt;br /&gt;
*[[xmlNodeSetAttribute]]&lt;br /&gt;
*[[xmlNodeSetValue]]&lt;br /&gt;
*[[xmlSaveFile]]&lt;br /&gt;
*[[xmlUnloadFile]]&lt;br /&gt;
{{New feature|3|DP3|&lt;br /&gt;
*[[xmlNodeGetChildren ]]&lt;br /&gt;
*[[xmlNodeGetParent ]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=16530</id>
		<title>XmlNodeGetChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=16530"/>
		<updated>2008-04-06T11:17:09Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a single child or all the children of a particular XML node.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;xmlnode/table xmlNodeGetChildren( xmlnode parent, [ int index ])&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''parent''': This is an [[xmlnode]] that you want to find the children under. &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''index''': This is the index of the node you wish to find. For example, to find the 5th subnode, you would use 4 as the index value. To find the first occurence, use 0. If this is not set, it will return a list of all children.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If index isn't specified, it returns a list of all children. Returns an [[xmlnode]] object if index was set and a node was found, otherwise it returns false.&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;
If you wanted to find the 'instructions' node in a map file like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map version=&amp;quot;2.0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;options&amp;gt;&lt;br /&gt;
            &amp;lt;instructions&amp;gt;Start at the begining and keep going until the end!&amp;lt;/instructions&amp;gt;&lt;br /&gt;
      &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
maproot = getLoadedMapXMLRoot ();&lt;br /&gt;
optionsnode = xmlNodeGetChildren( maproot, 0 ); -- In this case it would find the options sub node as the first under the 'map' node&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlNodeGetSubNodes&amp;diff=16529</id>
		<title>XmlNodeGetSubNodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlNodeGetSubNodes&amp;diff=16529"/>
		<updated>2008-04-06T11:13:06Z</updated>

		<summary type="html">&lt;p&gt;Norby89: XmlNodeGetSubNodes moved to XmlNodeGetChildren&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[XmlNodeGetChildren]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=16528</id>
		<title>XmlNodeGetChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=16528"/>
		<updated>2008-04-06T11:13:06Z</updated>

		<summary type="html">&lt;p&gt;Norby89: XmlNodeGetSubNodes moved to XmlNodeGetChildren&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a single sub node or a list of sub nodes of a particular XML node.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;xmlnode/table xmlNodeGetChildren( xmlnode parent, [ int index ])&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''parent''': This is an [[xmlnode]] that you want to find the children under. &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''index''': This is the index of the node you wish to find. For example, to find the 5th subnode, you would use 4 as the index value. To find the first occurence, use 0. If this is not set, it will return a list of all children.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If index isn't specified, it returns a list of all children. Returns an [[xmlnode]] object if index was set and a node was found, otherwise it returns false.&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;
If you wanted to find the 'instructions' node in a map file like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map version=&amp;quot;2.0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;options&amp;gt;&lt;br /&gt;
            &amp;lt;instructions&amp;gt;Start at the begining and keep going until the end!&amp;lt;/instructions&amp;gt;&lt;br /&gt;
      &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
maproot = getLoadedMapXMLRoot ();&lt;br /&gt;
optionsnode = xmlNodeGetChildren( maproot, 0 ); -- In this case it would find the options sub node as the first under the 'map' node&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=16527</id>
		<title>XmlNodeGetChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=16527"/>
		<updated>2008-04-06T11:11:37Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a single sub node or a list of sub nodes of a particular XML node.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;xmlnode/table xmlNodeGetChildren( xmlnode parent, [ int index ])&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''parent''': This is an [[xmlnode]] that you want to find the children under. &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''index''': This is the index of the node you wish to find. For example, to find the 5th subnode, you would use 4 as the index value. To find the first occurence, use 0. If this is not set, it will return a list of all children.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If index isn't specified, it returns a list of all children. Returns an [[xmlnode]] object if index was set and a node was found, otherwise it returns false.&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;
If you wanted to find the 'instructions' node in a map file like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map version=&amp;quot;2.0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;options&amp;gt;&lt;br /&gt;
            &amp;lt;instructions&amp;gt;Start at the begining and keep going until the end!&amp;lt;/instructions&amp;gt;&lt;br /&gt;
      &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
maproot = getLoadedMapXMLRoot ();&lt;br /&gt;
optionsnode = xmlNodeGetChildren( maproot, 0 ); -- In this case it would find the options sub node as the first under the 'map' node&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddCommandHandler&amp;diff=16471</id>
		<title>AddCommandHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddCommandHandler&amp;diff=16471"/>
		<updated>2008-04-01T13:29:53Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note_box|It is strongly advised that you do not use the same name for your handler function as the command name, as this can lead to confusion if multiple handler functions are used. Use a name that describes your handler's purpose more specifically.}}&lt;br /&gt;
This function will attach a scripting function (handler) to a console command, so that whenever a player or administrator uses the command the function is called.&lt;br /&gt;
&lt;br /&gt;
Multiple command handlers can be attached to a single command, and they will be called in the order that the handlers were attached. Equally, multiple commands can be handled by a single function, and the ''commandName'' parameter used to decide the course of action.&lt;br /&gt;
&lt;br /&gt;
For users, a command is in the format:&lt;br /&gt;
&lt;br /&gt;
''commandName'' ''argument1'' ''argument2''&lt;br /&gt;
&lt;br /&gt;
This can be triggered from the player's console or directly from the chat box by prefixing the message with a forward slash (''/''). For server side handlers, the server admin is also able to trigger these directly from the server's console in the same way as they are triggered from a player's console.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction, [bool restricted = false] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''commandName:''' This is the name of the command you wish to attach a handler to. This is what must be typed into the console to trigger the function.&lt;br /&gt;
*'''handlerFunction:''' This is the function that you want the command to trigger, which has to be defined before you add the handler. This function can take two parameters, playerSource and commandName, followed by as many parameters you expect after your command (see below). These are all optional.&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''restricted:''' Specify whether or not this command should be restricted by default. Use this on commands that should be inaccessible to everyone as default except special users specified in the ACL (Access Control List). This is to make sure admin commands such as ie. 'punish' won't be available to everyone if a server administrator forgets masking it in ACL. This argument defaults to false if nothing is specified.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addCommandHandler ( string commandName, function handlerFunction )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''commandName:''' This is the name of the command you wish to attach a handler to. This is what must be typed into the console to trigger the function.&lt;br /&gt;
*'''handlerFunction:''' This is the function that you want the command to trigger, which has to be defined before you add the handler. This function can take two parameters, playerSource and commandName, followed by as many parameters you expect after your command (see below). These are all optional.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Handler function parameters====&lt;br /&gt;
These are the parameters for the handler function that is called when the command is used.&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;player playerSource, string commandName, [string arg1, string arg2, ...] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''playerSource:''' The player who triggered the command. If not triggered by a player (e.g. by admin), this will be ''false''.&lt;br /&gt;
* '''commandName:''' The name of the command triggered. This is useful if multiple commands go through one function.&lt;br /&gt;
* '''arg1, arg2, ...:''' Each word after command name in the original command is passed here in a seperate variable. If there is no value for an argument, its variable will contain [[nil]]. You can deal with a variable number of arguments using the vararg expression, as shown in '''Example 3''' below.&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; string commandName, [string arg1, string arg2, ...] &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''commandName:''' The name of the command triggered. This is useful if multiple commands go through one function.&lt;br /&gt;
* '''arg1, arg2, ...:''' Each word after command name in the original command is passed here in a seperate variable. If there is no value for an argument, its variable will contain [[nil]]. You can deal with a variable number of arguments using the vararg expression, as shown in '''Example 3''' below.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the command handler was added successfully, ''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;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example defines a command handler for the command ''createmarker''. This will create a red marker at the position of the player player who uses it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Define our function that will handle this command&lt;br /&gt;
function consoleCreateMarker ( playerSource )&lt;br /&gt;
	-- If a player triggered it (rather than the admin) then&lt;br /&gt;
	if ( playerSource ) then&lt;br /&gt;
		-- Get that player's position&lt;br /&gt;
		local x, y, z = getElementPosition ( playerSource )&lt;br /&gt;
		-- Create a size 2, red checkpoint marker at their position&lt;br /&gt;
		createMarker ( x, y, z, &amp;quot;checkpoint&amp;quot;, 2, 255, 0, 0, 255 )&lt;br /&gt;
		-- Output it in his chat box&lt;br /&gt;
		outputChatBox ( &amp;quot;You got a red marker&amp;quot;, playerSource )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Attach the 'consoleCreateMarker' function to the &amp;quot;createmarker&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;createmarker&amp;quot;, consoleCreateMarker )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' A simple health setting command. If a player types ''/sethealth X'' in the chatbox his health will be set to X. Note that the function [[setElementHealth]] is used rather than something like &amp;quot;setPlayerHealth&amp;quot;. This function is more generic and can also be used to set the health of vehicles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleSetHealth(playerSource, commandName, health)&lt;br /&gt;
	setElementHealth(playerSource, tonumber(health))&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;sethealth&amp;quot;, consoleSetHealth)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example implements a ''set_vehicle_color'' command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Define our function that will handle this command&lt;br /&gt;
function consoleSetVehicleColor ( playerSource, commandName, col1, col2, col3, col4 )&lt;br /&gt;
	-- If a player triggered this in-game&lt;br /&gt;
	if ( playerSource ) then&lt;br /&gt;
		-- Get the player's vehicle&lt;br /&gt;
		local playerVehicle = getPlayerOccupiedVehicle ( playerSource )&lt;br /&gt;
		-- If the player is in a vehicle and we've got at least 1 parameter&lt;br /&gt;
		if ( playerVehicle and col1 ) then&lt;br /&gt;
			-- Get the vehicle's existing color and use it if fewer than 4 arguments were passed&lt;br /&gt;
			local exCol1, exCol2, exCol3, exCol4 = getVehicleColor ( playerVehicle )&lt;br /&gt;
&lt;br /&gt;
			if not col2 then col2 = exCol2 end&lt;br /&gt;
			if not col3 then col3 = exCol3 end&lt;br /&gt;
			if not col4 then col4 = exCol4 end&lt;br /&gt;
&lt;br /&gt;
			-- Set the vehicle's color&lt;br /&gt;
			setVehicleColor ( playerVehicle, col1, col2, col3, col4 )&lt;br /&gt;
		else&lt;br /&gt;
			-- If we didn't get at least 1 parameter or the player doesn't have a vehicle, display some help text&lt;br /&gt;
			outputConsole ( &amp;quot;This function will set your current vehicle's colors. A vehicle can have up to 4 colors.&amp;quot;, playerSource )&lt;br /&gt;
			outputConsole ( &amp;quot;Syntax: set_vehicle_color color1 [ color2 color3 color4 ]&amp;quot;, playerSource )&lt;br /&gt;
			outputConsole ( &amp;quot;You must be in a vehicle to use this function.&amp;quot;, playerSource )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Attach the 'consoleSetVehicleColor' function to the &amp;quot;set_vehicle_color&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;set_vehicle_color&amp;quot;, consoleSetVehicleColor )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 4:''' This example makes use of Lua's vararg expression to implement a ''check_parameters'' command to count the number of parameters passed, merge them all into a single string and output it. This is also shows you how you can use table.concat to merge all the passed arguments. This is particularly useful when you want to read in a sentence of text passed from the user. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Define our function that will handle this command (which can accept a variable number of arguments after commandName)&lt;br /&gt;
function consoleCheckParameters ( playerSource, commandName, ... )&lt;br /&gt;
	-- If a player, not an admin, triggered it,&lt;br /&gt;
	if playerSource then&lt;br /&gt;
		-- Pack all extra arguments passed in a table&lt;br /&gt;
		local parametersTable = {...}&lt;br /&gt;
		-- Get the number of arguments in that table&lt;br /&gt;
		local parameterCount = #parametersTable&lt;br /&gt;
		-- Output it to the player's chatbox&lt;br /&gt;
		outputChatBox ( &amp;quot;Number of parameters: &amp;quot; .. parameterCount, playerSource )&lt;br /&gt;
		-- Join them together in a single comma-separated string&lt;br /&gt;
		local stringWithAllParameters = table.concat( parametersTable, &amp;quot;, &amp;quot; )&lt;br /&gt;
		-- Output this parameter list to the player's chatbox&lt;br /&gt;
		outputChatBox ( &amp;quot;Parameters passed: &amp;quot; .. stringWithAllParameters, playerSource )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Attach the 'consoleCheckParameters' function to the &amp;quot;check_parameters&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;check_parameters&amp;quot;, consoleCheckParameters )&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;&amp;gt;&lt;br /&gt;
'''Example 1:''' This creates a GUI window and allows a player to change its alpha (transparency) value with a command. Note that, in a clientside script, the player using the command is not passed as a parameter to the handler function, since it is always the local player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;--Create a window&lt;br /&gt;
myWindow = guiCreateWindow ( 0.30, 0.10, 0.5, 0.60, &amp;quot;GUI window title&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
--Add a command handler to change the alpha of the GUI window. Usage example: 'alpha 0.15'&lt;br /&gt;
function changeAlpha ( commandName, alphaAmount )&lt;br /&gt;
	-- All command parameters are strings, so we'll convert the value to a number first&lt;br /&gt;
	alphaAmount = tonumber(alphaAmount)&lt;br /&gt;
	guiSetAlpha ( myGridList, alphaAmount )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;alpha&amp;quot;, changeAlpha )&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;
{{Server functions}}&lt;br /&gt;
{{Incomplete}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TriggerServerEvent&amp;diff=16012</id>
		<title>TriggerServerEvent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TriggerServerEvent&amp;diff=16012"/>
		<updated>2008-03-01T17:59:10Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function triggers an event previously registered on the server. This is the primary means of passing information between the client and the server. Servers have a similar [[triggerClientEvent]] function that can do the reverse. You can treat this function as if it was an asynchronous function call, using [[triggerClientEvent]] to pass back any returned information if necessary.&lt;br /&gt;
&lt;br /&gt;
Almost any data types can be passed as expected, including [[element]]s and complex nested [[table]]s. Non-element MTA data types like xmlNodes or resource pointers will not be able to be passed as they do not necessarily have a valid representation on the client.&lt;br /&gt;
&lt;br /&gt;
Events are sent reliably, so the server will receive them, but there may be (but shouldn't be) a significant delay before they are received. You should take this into account when using them.&lt;br /&gt;
&lt;br /&gt;
Keep in mind the bandwidth issues when using events - don't pass a large list of arguments unless you really need to. It is marginally more efficient to pass one large event than two smaller ones.&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 triggerServerEvent ( string event, element theElement, [arguments...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''event:''' The name of the event to trigger server-side. You should register this event with [[addEvent]] and add at least one event handler using [[addEventHandler]].&lt;br /&gt;
*'''theElement:''' The element that is the ''source'' of the event. This could be another player, or if this isn't relevant, use the root element.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''arguments...:''' A list of arguments to trigger with the event. You can pass any lua data type (except functions). You can also pass [[element]]s.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event trigger has been sent, ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example shows how you can pass a simple &amp;quot;Hello World&amp;quot; message from the client to the server using an event.&lt;br /&gt;
&lt;br /&gt;
'''Server:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function greetingHandler ( message )&lt;br /&gt;
    outputChatBox ( &amp;quot;The client says: &amp;quot; .. message )&lt;br /&gt;
end&lt;br /&gt;
addEvent(&amp;quot;onGreeting&amp;quot;, true)&lt;br /&gt;
addEventHandler(&amp;quot;onGreeting&amp;quot;, getRootElement(), greetingHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Client:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function greetingCommand ( source, commandName )&lt;br /&gt;
    triggerServerEvent ( &amp;quot;onGreeting&amp;quot;, getLocalPlayer(), &amp;quot;Hello World!&amp;quot; ) &lt;br /&gt;
--getLocalPlayer instead of getRootElement makes the client player the 'source' on the server function, eliminating the need for an additional player argument to be transferred.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;greet&amp;quot;, greetingCommand )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command &amp;quot;greet&amp;quot; is executed (by typing it in the server console or the player's console), the clients ''greetingCommand'' function is called. This triggers the server-side event ''onGreeting'' with the string ''&amp;quot;Hello World!&amp;quot;''. This event is then handled by the ''greetingHandler'' function server-side which then displays the message.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=15986</id>
		<title>XmlNodeGetChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlNodeGetChildren&amp;diff=15986"/>
		<updated>2008-02-28T15:23:32Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns a single sub node or a list of sub nodes of a particular XML node.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;xmlnode/table xmlNodeGetSubNodes( xmlnode parent, [ int index ])&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''parent''': This is an [[xmlnode]] that you want to find the sub nodes under. &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''index''': This is the index of the node you wish to find. For example, to find the 5th subnode, you would use 4 as the index value. To find the first occurence, use 0. If this is not set, it will return a list of all sub nodes.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If index isn't specified, it returns a list of all sub nodes. Returns an [[xmlnode]] object if index was set and a node was found, otherwise it returns false.&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;
If you wanted to find the 'instructions' node in a map file like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map version=&amp;quot;2.0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;options&amp;gt;&lt;br /&gt;
            &amp;lt;instructions&amp;gt;Start at the begining and keep going until the end!&amp;lt;/instructions&amp;gt;&lt;br /&gt;
      &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
maproot = getLoadedMapXMLRoot ();&lt;br /&gt;
optionsnode = xmlNodeGetSubNodes( maproot, 0 ); -- In this case it would find the options sub node as the first under the 'map' node&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AttachElementToElement&amp;diff=14020</id>
		<title>AttachElementToElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AttachElementToElement&amp;diff=14020"/>
		<updated>2007-12-31T09:35:29Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Optional Arguments */ no radians&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs Checking|What kinds of elements can be attached together? --[[User:Jbeta|jbeta]]}}&lt;br /&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;
This is not compatible with all elements.  The following elements are compatible:&lt;br /&gt;
* [[Marker|Markers]]&lt;br /&gt;
* [[Blip|Blips]]&lt;br /&gt;
* [[Object|Objects]]&lt;br /&gt;
* [[Player|Players]]&lt;br /&gt;
* [[Vehicle|Vehicles]]&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 attachElementToElement ( 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;
&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 offset (default 0).&lt;br /&gt;
*'''yRotOffset:''' The y offset (default 0).&lt;br /&gt;
*'''zRotOffset:''' The z 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 ( getClientName ( 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;
    attachElementToElement ( 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;
      attachElementToElement( 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;
      attachElementToElement( 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>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Object&amp;diff=13848</id>
		<title>Element/Object</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Object&amp;diff=13848"/>
		<updated>2007-12-27T12:48:52Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Optional Attributes */ changed radians to degrees&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
The object class represents static, 3-D models in the GTA world. Objects can only represent models created by the server, they cannot represent models that are part of the GTA's default landscape. Examples of objects include building models, roads, and terrain.&lt;br /&gt;
&lt;br /&gt;
The element type of this class is '''&amp;quot;object&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
==XML syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;object model=&amp;quot;&amp;quot; posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; rotX=&amp;quot;&amp;quot; rotY=&amp;quot;&amp;quot; rotZ=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Attributes===&lt;br /&gt;
* '''model''': The ID of the object being created. Since GTA has thousands of objects, these are hard to document on the wiki. Instead, they can be found using the object browser in the map editor.&lt;br /&gt;
* '''posX''': A float representing the X position of the object.&lt;br /&gt;
* '''posY''': A float representing the Y position of the object.&lt;br /&gt;
* '''posZ''': A float representing the Z position of the object.&lt;br /&gt;
&lt;br /&gt;
===Optional Attributes===&lt;br /&gt;
* '''rotX''': A float representing the X rotation of the object in degrees.&lt;br /&gt;
* '''rotY''': A float representing the Y rotation of the object in degrees.&lt;br /&gt;
* '''rotZ''': A float representing the Z rotation of the object in degrees.&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnColShapeLeave&amp;diff=13834</id>
		<title>OnColShapeLeave</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnColShapeLeave&amp;diff=13834"/>
		<updated>2007-12-24T11:42:58Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This event is triggered when a player leaves a collision shape.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onColShapeLeave ( element leaveElement, bool matchingDimension )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* The source of this event refers to the col object in which an element has left&lt;br /&gt;
*'''leaveElement''': The [[element]] that who exited the col shape.&lt;br /&gt;
*'''matchingDimension''': a boolean referring to whether the collision shape was in the same dimension as the element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example kills the player whenever they leave a certain collision shape:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
jailZone = createColCircle ( 1024, 1024, 15, 50 ) -- create a collision shape&lt;br /&gt;
&lt;br /&gt;
-- call 'jailZoneLeave' whenever a player leaves the collision shape:&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeLeave&amp;quot;, jailZone, &amp;quot;jailZoneLeave&amp;quot; )&lt;br /&gt;
function jailZoneLeave ( thePlayer )&lt;br /&gt;
   killPlayer ( thePlayer ) -- kill the player&lt;br /&gt;
   outputChatBox ( &amp;quot;You are not allowed to leave the jail!&amp;quot;, thePlayer )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnColShapeLeave&amp;diff=13833</id>
		<title>OnColShapeLeave</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnColShapeLeave&amp;diff=13833"/>
		<updated>2007-12-24T11:42:12Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This event is triggered when a player leaves a collision shape.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onColShapeLeave ( element leaveElement, bool matchingDimension )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
* The source of this event refers to the col object in which an element has left&lt;br /&gt;
*'''leaveElement''': The [[element]] that who exited the col shape.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example kills the player whenever they leave a certain collision shape:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
jailZone = createColCircle ( 1024, 1024, 15, 50 ) -- create a collision shape&lt;br /&gt;
&lt;br /&gt;
-- call 'jailZoneLeave' whenever a player leaves the collision shape:&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeLeave&amp;quot;, jailZone, &amp;quot;jailZoneLeave&amp;quot; )&lt;br /&gt;
function jailZoneLeave ( thePlayer )&lt;br /&gt;
   killPlayer ( thePlayer ) -- kill the player&lt;br /&gt;
   outputChatBox ( &amp;quot;You are not allowed to leave the jail!&amp;quot;, thePlayer )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnColShapeHit&amp;diff=13832</id>
		<title>OnColShapeHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnColShapeHit&amp;diff=13832"/>
		<updated>2007-12-24T11:40:20Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This event is triggered when the player hits a [[colshape]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
void onColShapeHit ( element hitElement, bool matchingDimension )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
*The '''source''' of this event refers to the [[colshape]] which was hit by the element.&lt;br /&gt;
*'''hitElement''': the [[element]] that entered the colshape.&lt;br /&gt;
*'''matchingDimension''': a boolean referring to whether the hit collision shape was in the same dimension as the element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a hill area for a ''King of the hill'' gamemode.  When a player enters or leaves the area, it's announced in the chatbox.&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 = createColSquare ( -2171.0678710938, 678.17950439453, 0, 15, 15 )&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player enters the hill area&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, hillArea, &amp;quot;hill_Enter&amp;quot; )&lt;br /&gt;
function hill_Enter ( thePlayer, matchingDimension )&lt;br /&gt;
	--announce to everyone that the player entered the hill&lt;br /&gt;
	outputChatBox( getClientName(thePlayer)..&amp;quot; entered the zone!&amp;quot;, getRootElement(),255, 255, 109, )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player leaves the hill area&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeLeave&amp;quot;, hillArea, &amp;quot;hill_Exit&amp;quot; )&lt;br /&gt;
function hill_Exit ( thePlayer, matchingDimension )&lt;br /&gt;
	--check if the player is not dead&lt;br /&gt;
	if isPlayerDead ( thePlayer ) ~= true then&lt;br /&gt;
		--if he was alive, announce to everyone that the player has left the hill&lt;br /&gt;
		outputChatBox ( getClientName(thePlayer)..&amp;quot; left the zone!&amp;quot;, getRootElement(), 255, 255, 109 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnColShapeHit&amp;diff=13831</id>
		<title>OnColShapeHit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnColShapeHit&amp;diff=13831"/>
		<updated>2007-12-24T11:39:53Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This event is triggered when the player hits a [[colshape]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
void onColShapeHit ( element hitElement, bool matchingDimension )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
*The '''source''' of this event refers to the [[colshape]] which was hit by the player.&lt;br /&gt;
*'''hitElement''': the [[element]] that entered the colshape.&lt;br /&gt;
*'''matchingDimension''': a boolean referring to whether the hit collision shape was in the same dimension as the player.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a hill area for a ''King of the hill'' gamemode.  When a player enters or leaves the area, it's announced in the chatbox.&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 = createColSquare ( -2171.0678710938, 678.17950439453, 0, 15, 15 )&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player enters the hill area&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, hillArea, &amp;quot;hill_Enter&amp;quot; )&lt;br /&gt;
function hill_Enter ( thePlayer, matchingDimension )&lt;br /&gt;
	--announce to everyone that the player entered the hill&lt;br /&gt;
	outputChatBox( getClientName(thePlayer)..&amp;quot; entered the zone!&amp;quot;, getRootElement(),255, 255, 109, )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add hill_Enter as a handler for when a player leaves the hill area&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeLeave&amp;quot;, hillArea, &amp;quot;hill_Exit&amp;quot; )&lt;br /&gt;
function hill_Exit ( thePlayer, matchingDimension )&lt;br /&gt;
	--check if the player is not dead&lt;br /&gt;
	if isPlayerDead ( thePlayer ) ~= true then&lt;br /&gt;
		--if he was alive, announce to everyone that the player has left the hill&lt;br /&gt;
		outputChatBox ( getClientName(thePlayer)..&amp;quot; left the zone!&amp;quot;, getRootElement(), 255, 255, 109 )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Event_functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAttachedElements&amp;diff=13754</id>
		<title>GetAttachedElements</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAttachedElements&amp;diff=13754"/>
		<updated>2007-12-15T10:11:29Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns a table of all the elements attached to the specified element&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getAttachedElements ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement''': The [[element]] which you require the information from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of all the elements attached to the specified element.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Print a list of all the players attached to the specified element&lt;br /&gt;
  local Inf = getElementByID ( &amp;quot;infernus1&amp;quot; )&lt;br /&gt;
  local attachedElements = getAttachedElements ( Inf )&lt;br /&gt;
  if ( attachedElements ) then -- if we got the table&lt;br /&gt;
    local attachedElementsList = &amp;quot;none&amp;quot;&lt;br /&gt;
    -- Loop through the table&lt;br /&gt;
    for ElementKey, ElementValue in ipairs ( attachedElements ) do&lt;br /&gt;
      -- add their name to the list&lt;br /&gt;
      if ( getElementType ( ElementValue ) == &amp;quot;player&amp;quot; ) then&lt;br /&gt;
        if ( attachedElementsList == &amp;quot;none&amp;quot; ) then&lt;br /&gt;
          attachedElementsList = getClientName ( ElementValue )&lt;br /&gt;
        else&lt;br /&gt;
          attachedElementsList = attachedElementsList .. &amp;quot;, &amp;quot; .. getClientName ( ElementValue )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    outputConsole ( &amp;quot;Players attached to the infernus: &amp;quot; .. attachedElementsList )&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;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AttachElementToElement&amp;diff=13440</id>
		<title>AttachElementToElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AttachElementToElement&amp;diff=13440"/>
		<updated>2007-12-01T09:47:04Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs Checking|What kinds of elements can be attached together? --[[User:Jbeta|jbeta]]}}&lt;br /&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;
This is not compatible with all elements.  The following elements are compatible:&lt;br /&gt;
* [[Marker|Markers]]&lt;br /&gt;
* [[Blip|Blips]]&lt;br /&gt;
* [[Object|Objects]]&lt;br /&gt;
* [[Player|Players]]&lt;br /&gt;
* [[Vehicle|Vehicles]]&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 attachElementToElement ( 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;
&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 offset (default 0).&lt;br /&gt;
*'''yRotOffset:''' The y offset (default 0).&lt;br /&gt;
*'''zRotOffset:''' The z offset (default 0).&lt;br /&gt;
Rotations are in radians.&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 ( getClientName ( 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;
    attachElementToElement ( 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;
      attachElementToElement( 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;
      attachElementToElement( 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>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateElement&amp;diff=13380</id>
		<title>CreateElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateElement&amp;diff=13380"/>
		<updated>2007-11-26T16:35:49Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */ minor fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to create a new dummy element in the [[element tree]] which do not necessarily represent an entity within the San Andreas world. A common use for this function is for creating custom elements, such as a Flag or a Base.&lt;br /&gt;
&lt;br /&gt;
Elements created using this function are placed in the element tree with their parent as the 'dynamic' map element.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element createElement ( string elementType, [ string elementID ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''elementType:''' The type of element being created.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''elementID:''' The ID of the element being created.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the element if it was successfully created. Returns ''false'' if the arguments are wrong.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a &amp;quot;flag&amp;quot; element, named &amp;quot;blue&amp;quot;, which will be at the resource's dynamic map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
blueTeamFlag = createElement( &amp;quot;flag&amp;quot;, &amp;quot;blue&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Except for it being placed in a different map root, that line will have the same effect as having this in a .map file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;flag id=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also== &lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerRotation&amp;diff=12370</id>
		<title>GetPlayerRotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerRotation&amp;diff=12370"/>
		<updated>2007-10-02T16:03:52Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current rotation (in degrees) of a player around the Z axis. It's used with on-foot players: use [[getVehicleRotation]] on the occupied [[vehicle]] if the player is in one.&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 getPlayerRotation ( player thePlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': the [[player]] whose rotation you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''float'' containing the player's rotation, or ''false'' if an invalid player (or one in a vehicle) was passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code adds a ''getrot'' command to get the player's current rotation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputPlayerRotation ( sourcePlayer )&lt;br /&gt;
	-- if the command was triggered by an ingame player&lt;br /&gt;
	if ( sourcePlayer ) then&lt;br /&gt;
		-- if he is in a vehicle&lt;br /&gt;
		if isPlayerInVehicle ( sourcePlayer ) then&lt;br /&gt;
			-- store the vehicle element&lt;br /&gt;
			local playerVehicle = getPlayerOccupiedVehicle ( sourcePlayer )&lt;br /&gt;
			-- and output its rotation&lt;br /&gt;
			local x,y,z = getVehicleRotation ( playerVehicle )&lt;br /&gt;
			outputChatBox ( &amp;quot;Your vehicle's rotation is: &amp;quot; .. z, sourcePlayer )&lt;br /&gt;
		-- if he is on foot&lt;br /&gt;
		else&lt;br /&gt;
			-- output the player's rotation&lt;br /&gt;
			outputChatBox ( &amp;quot;Your rotation is: &amp;quot; .. getPlayerRotation ( sourcePlayer ), sourcePlayer )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- register outputPlayerRotation as a handler for the getrot command&lt;br /&gt;
addCommandHandler ( &amp;quot;getrot&amp;quot;, outputPlayerRotation )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerTask&amp;diff=11724</id>
		<title>GetPlayerTask</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerTask&amp;diff=11724"/>
		<updated>2007-09-05T14:43:19Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to get the name of the current task of a certain type for a player.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getPlayerTask ( player thePlayer, string priority, int taskType, [int index = 0] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': The [[player]] whose task you want to retrieve.&lt;br /&gt;
*'''priority''': A string determining which set of tasks you want to retrieve it from. This must be either &amp;quot;priority&amp;quot; or &amp;quot;secondary&amp;quot;.&lt;br /&gt;
*'''taskType''': An integer value representing the task type (or slot) you want to get the task from. Types can be:&lt;br /&gt;
**'''PRIMARY TASKS'''&lt;br /&gt;
***'''0:''' TASK_PRIORITY_PHYSICAL_RESPONSE&lt;br /&gt;
***'''1:''' TASK_PRIORITY_EVENT_RESPONSE_TEMP&lt;br /&gt;
***'''2:''' TASK_PRIORITY_EVENT_RESPONSE_NONTEMP&lt;br /&gt;
***'''3:''' TASK_PRIORITY_PRIMARY&lt;br /&gt;
***'''4:''' TASK_PRIORITY_DEFAULT&lt;br /&gt;
**'''SECONDARY TASKS'''&lt;br /&gt;
***'''0:''' TASK_SECONDARY_ATTACK&lt;br /&gt;
***'''1:''' TASK_SECONDARY_DUCK&lt;br /&gt;
***'''2:''' TASK_SECONDARY_SAY&lt;br /&gt;
***'''3:''' TASK_SECONDARY_FACIAL_COMPLEX&lt;br /&gt;
***'''4:''' TASK_SECONDARY_PARTIAL_ANIM&lt;br /&gt;
***'''5:''' TASK_SECONDARY_IK&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''index''': An integer value representing how many sub tasks to go through. -1 to get the simplest task, 0 to get the most complex task.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the name of a task. See [[list of player tasks]] for valid strings. Returns ''false'' if invalid arguments are specified or if there is no task of the type or index specified.&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 prints the name of a player's task to the chat when they use the &amp;quot;task&amp;quot; command in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function myTask ( commandName, priority, taskType )&lt;br /&gt;
    task = getPlayerTask ( source, priority, tonumber(taskType) )&lt;br /&gt;
    taskName = &amp;quot;none&amp;quot;&lt;br /&gt;
    if ( task ) then&lt;br /&gt;
        taskName = task&lt;br /&gt;
    end&lt;br /&gt;
    outputChatBox ( getClientName ( source ) .. &amp;quot;'s &amp;quot; .. priority .. &amp;quot;(&amp;quot; .. taskType .. &amp;quot;) task is: &amp;quot; .. taskName )&lt;br /&gt;
end    &lt;br /&gt;
addCommandHandler ( &amp;quot;task&amp;quot;, myTask )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerTask&amp;diff=11723</id>
		<title>GetPlayerTask</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerTask&amp;diff=11723"/>
		<updated>2007-09-05T14:41:54Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to get the name of the current task of a certain type for a player.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getPlayerTask ( player thePlayer, string priority, int taskType, [int index = 0] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePlayer''': The [[player]] whose task you want to retrieve.&lt;br /&gt;
*'''priority''': A string determining which set of tasks you want to retrieve it from. This must be either &amp;quot;primary&amp;quot; or &amp;quot;secondary&amp;quot;.&lt;br /&gt;
*'''taskType''': An integer value representing the task type (or slot) you want to get the task from. Types can be:&lt;br /&gt;
**'''PRIMARY TASKS'''&lt;br /&gt;
***'''0:''' TASK_PRIORITY_PHYSICAL_RESPONSE&lt;br /&gt;
***'''1:''' TASK_PRIORITY_EVENT_RESPONSE_TEMP&lt;br /&gt;
***'''2:''' TASK_PRIORITY_EVENT_RESPONSE_NONTEMP&lt;br /&gt;
***'''3:''' TASK_PRIORITY_PRIMARY&lt;br /&gt;
***'''4:''' TASK_PRIORITY_DEFAULT&lt;br /&gt;
**'''SECONDARY TASKS'''&lt;br /&gt;
***'''0:''' TASK_SECONDARY_ATTACK&lt;br /&gt;
***'''1:''' TASK_SECONDARY_DUCK&lt;br /&gt;
***'''2:''' TASK_SECONDARY_SAY&lt;br /&gt;
***'''3:''' TASK_SECONDARY_FACIAL_COMPLEX&lt;br /&gt;
***'''4:''' TASK_SECONDARY_PARTIAL_ANIM&lt;br /&gt;
***'''5:''' TASK_SECONDARY_IK&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''index''': An integer value representing how many sub tasks to go through. -1 to get the simplest task, 0 to get the most complex task.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the name of a task. See [[list of player tasks]] for valid strings. Returns ''false'' if invalid arguments are specified or if there is no task of the type or index specified.&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 prints the name of a player's task to the chat when they use the &amp;quot;task&amp;quot; command in the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function myTask ( commandName, priority, taskType )&lt;br /&gt;
    task = getPlayerTask ( source, priority, tonumber(taskType) )&lt;br /&gt;
    taskName = &amp;quot;none&amp;quot;&lt;br /&gt;
    if ( task ) then&lt;br /&gt;
        taskName = task&lt;br /&gt;
    end&lt;br /&gt;
    outputChatBox ( getClientName ( source ) .. &amp;quot;'s &amp;quot; .. priority .. &amp;quot;(&amp;quot; .. taskType .. &amp;quot;) task is: &amp;quot; .. taskName )&lt;br /&gt;
end    &lt;br /&gt;
addCommandHandler ( &amp;quot;task&amp;quot;, myTask )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleTurnVelocity&amp;diff=11484</id>
		<title>SetVehicleTurnVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleTurnVelocity&amp;diff=11484"/>
		<updated>2007-08-27T17:08:18Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|We need a min-max values allowed or a recommended min-max/relevant range?&lt;br /&gt;
--[[User:Ransom|Ransom]] 02:46, 11 April 2007 (CDT)}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Sets the angular velocity of a vehicle. Basically applies a spin to it.&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 setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz )           &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] to apply the spin to.&lt;br /&gt;
*'''rx:''' velocity around the X axis&lt;br /&gt;
*'''ry:''' velocity around the Y axis&lt;br /&gt;
*'''rz:''' velocity around the Z axis&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if it was succesful, ''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;
function onColShapeHit ( thePlayer, matchingDimension )&lt;br /&gt;
    -- When a player hits the collision shape, check if he's in a vehicle&lt;br /&gt;
    local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
    if playerVehicle ~= false then&lt;br /&gt;
        -- If so, give it a spin&lt;br /&gt;
        setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, getRootElement ( ), onColShapeHit )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleTurnVelocity&amp;diff=11483</id>
		<title>SetVehicleTurnVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleTurnVelocity&amp;diff=11483"/>
		<updated>2007-08-27T17:07:33Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|We need a min-max values allowed or a recommended min-max/relevant range?&lt;br /&gt;
--[[User:Ransom|Ransom]] 02:46, 11 April 2007 (CDT)}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Sets the angular velocity of a vehicle. Basically applies a spin to it.&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 setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz )           &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' vehicle to apply the spin to&lt;br /&gt;
*'''rx:''' velocity around the X axis&lt;br /&gt;
*'''ry:''' velocity around the Y axis&lt;br /&gt;
*'''rz:''' velocity around the Z axis&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if it was succesful, ''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;
function onColShapeHit ( thePlayer, matchingDimension )&lt;br /&gt;
    -- When a player hits the collision shape, check if he's in a vehicle&lt;br /&gt;
    local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
    if playerVehicle ~= false then&lt;br /&gt;
        -- If so, give it a spin&lt;br /&gt;
        setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, getRootElement ( ), onColShapeHit )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleTurnVelocity&amp;diff=11482</id>
		<title>SetVehicleTurnVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleTurnVelocity&amp;diff=11482"/>
		<updated>2007-08-27T17:06:50Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|We need a min-max values allowed or a recommended min-max/relevant range?&lt;br /&gt;
--[[User:Ransom|Ransom]] 02:46, 11 April 2007 (CDT)}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Sets the angular velocity of a vehicle. Basically applies a spin to it.&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 setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz )           &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' vehicle to apply the spin to&lt;br /&gt;
*'''rx:''' velocity around the X axis&lt;br /&gt;
*'''ry:''' velocity around the Y axis&lt;br /&gt;
*'''rz:''' velocity around the Z axis&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if blah, ''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;
function onColShapeHit ( thePlayer, matchingDimension )&lt;br /&gt;
    -- When a player hits the collision shape, check if he's in a vehicle&lt;br /&gt;
    local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
    if playerVehicle ~= false then&lt;br /&gt;
        -- If so, give it a spin&lt;br /&gt;
        setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onColShapeHit&amp;quot;, getRootElement ( ), onColShapeHit )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleTurnVelocity&amp;diff=11481</id>
		<title>GetVehicleTurnVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleTurnVelocity&amp;diff=11481"/>
		<updated>2007-08-27T17:03:27Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
{{Needs Checking|can somebody try this and see if it works properly? I always got random numbers even when the vehicle was completely still --[[User:Norby89|Norby89]] 12:03, 27 August 2007 (CDT)}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to retrieve a vehicle's turning velocity for each axis.&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 getVehicleTurnVelocity ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis or ''false'' if wrong arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
This page does not currently have an example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--enter an example here&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleTurnVelocity&amp;diff=11477</id>
		<title>GetVehicleTurnVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleTurnVelocity&amp;diff=11477"/>
		<updated>2007-08-27T16:54:22Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to retrieve a vehicle's turning velocity for each axis.&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 getVehicleTurnVelocity ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis or ''false'' if wrong arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
This page does not currently have an example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--enter an example here&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleTurnVelocity&amp;diff=11476</id>
		<title>GetVehicleTurnVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleTurnVelocity&amp;diff=11476"/>
		<updated>2007-08-27T16:52:53Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to retrieve a vehicle's turning velocity for each axis.&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 getVehicleTurnVelocity ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
This page does not currently have an example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--enter an example here&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Vehicle Functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11475</id>
		<title>GetVehiclePanelState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11475"/>
		<updated>2007-08-27T11:15:43Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|A list of panels would be nice and a more specific explanation on what the function returns --[[User:Norby89|Norby89]] 12:30, 26 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getVehiclePanelState ( vehicle thevehicle, int panel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to know the panel state of.&lt;br /&gt;
*'''panel:''' An ''integer'' ranging from 0 to 6.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[int]] indicating the state of the specified the panel. This value can be:&lt;br /&gt;
&lt;br /&gt;
NEEDS UPDATING&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This function creates an admiral and outputs every panel's state in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
admiral = createVehicle ( 445, 0, 0, 10 )&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
for i=0, 6 do&lt;br /&gt;
  local panel = getVehiclePanelState ( admiral, i )&lt;br /&gt;
    outputChatBox ( panel )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDoorState&amp;diff=11474</id>
		<title>SetVehicleDoorState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDoorState&amp;diff=11474"/>
		<updated>2007-08-27T11:15:33Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the damage state of a specified door on a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server and Client&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;
setVehicleDoorState ( vehicle theVehicle, int door, int state )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to change the door state of.&lt;br /&gt;
*'''door:''' An integer between 0 and 5 specifying the door you want to change state of.&lt;br /&gt;
*'''state:''' An integer determining the new state of the door:&lt;br /&gt;
**'''0:''' intact&lt;br /&gt;
**'''1:''' swinging free&lt;br /&gt;
**'''2:''' bashed&lt;br /&gt;
**'''3:''' bashed and swinging free&lt;br /&gt;
**'''4:''' missing&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the door state was successfully set, ''false'' if invalid arguments, invalid door IDs or invalid state IDs are passed.&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 and Client&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;
-- create a new vehicle&lt;br /&gt;
local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
-- break its front left door off&lt;br /&gt;
state = setVehicleDoorState ( newcar, 2, 4 )&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11473</id>
		<title>GetVehiclePanelState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11473"/>
		<updated>2007-08-27T11:15:24Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|A list of panels would be nice and a more specific explanation on what the function returns --[[User:Norby89|Norby89]] 12:30, 26 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getVehiclePanelState ( vehicle thevehicle, int panel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to know the panel state of.&lt;br /&gt;
*'''panel:''' An [[integer]] ranging from 0 to 6.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[int]] indicating the state of the specified the panel. This value can be:&lt;br /&gt;
&lt;br /&gt;
NEEDS UPDATING&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This function creates an admiral and outputs every panel's state in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
admiral = createVehicle ( 445, 0, 0, 10 )&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
for i=0, 6 do&lt;br /&gt;
  local panel = getVehiclePanelState ( admiral, i )&lt;br /&gt;
    outputChatBox ( panel )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11472</id>
		<title>GetVehiclePanelState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11472"/>
		<updated>2007-08-27T11:13:03Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|A list of panels would be nice and a more specific explanation on what the function returns --[[User:Norby89|Norby89]] 12:30, 26 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getVehiclePanelState ( vehicle thevehicle, int panel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to know the panel state of.&lt;br /&gt;
*'''panel:''' A whole number ranging from 0 to 6.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[int]] indicating the state of the specified the panel. This value can be:&lt;br /&gt;
&lt;br /&gt;
NEEDS UPDATING&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This function creates an admiral and outputs every panel's state in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
admiral = createVehicle ( 445, 0, 0, 10 )&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
for i=0, 6 do&lt;br /&gt;
  local panel = getVehiclePanelState ( admiral, i )&lt;br /&gt;
    outputChatBox ( panel )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11471</id>
		<title>GetVehiclePlateText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11471"/>
		<updated>2007-08-27T10:36:00Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs Checking|This function doesn't work, mantis #2457 --[[User:Norby89|Norby89]] 13:47, 26 August 2007 (CDT)}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to retrieve the text on the number plate of a specified vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getVehiclePlateText ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to retrieve the plate text from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' that corresponds to the plate on the text, ''false'' if a bad argument was passed or if the vehicle is not a car.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputLicensePlate ( command )&lt;br /&gt;
  -- get the vehicle the local player is in&lt;br /&gt;
  local localPlayerOccupiedVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )&lt;br /&gt;
  -- if he is in a vehicle,&lt;br /&gt;
  if localPlayerOccupiedVehicle then&lt;br /&gt;
    -- get the license plate text&lt;br /&gt;
    local plateText = getVehiclePlateText ( localPlayerOccupiedVehicle )&lt;br /&gt;
    -- if there was a license plate,&lt;br /&gt;
    if plateText then&lt;br /&gt;
      -- output it to the chatbox&lt;br /&gt;
      outputChatBox ( &amp;quot;Your license plate is: &amp;quot; .. plateText )&lt;br /&gt;
    else&lt;br /&gt;
      outputChatBox ( &amp;quot;Your vehicle has no license plate.&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
  else&lt;br /&gt;
    outputChatBox ( &amp;quot;You're not in a vehicle.&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
-- add our function as a handler to the &amp;quot;plate&amp;quot; command&lt;br /&gt;
addCommandHandler( &amp;quot;plate&amp;quot;, outputLicensePlate )&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11453</id>
		<title>GetVehiclePlateText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11453"/>
		<updated>2007-08-26T18:47:50Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
{{Needs Checking|This function doesn't work, mantis #2457 --[[User:Norby89|Norby89]] 13:47, 26 August 2007 (CDT)}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to retrieve the text on the number plate of a specified vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getVehiclePlateText ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' A handle to the vehicle that you wish to retrieve the plate text from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' that coresponds to the plate on the text or ''false'' if a bad argument was passed or if the vehicle is not a car.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptPlate ( player, command )&lt;br /&gt;
  local aVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )&lt;br /&gt;
  local text = getVehiclePlateText ( aVehicle )&lt;br /&gt;
  if ( text and aVehicle ) then&lt;br /&gt;
    outputChatBox ( &amp;quot;text&amp;quot; )&lt;br /&gt;
  else outputChatBox ( &amp;quot;your vehicle has no licence plate or you're not in a vehicle&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;plate&amp;quot;, scriptPlate )&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11452</id>
		<title>GetVehiclePlateText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11452"/>
		<updated>2007-08-26T18:46:50Z</updated>

		<summary type="html">&lt;p&gt;Norby89: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to retrieve the text on the number plate of a specified vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getVehiclePlateText ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' A handle to the vehicle that you wish to retrieve the plate text from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' that coresponds to the plate on the text or ''false'' if a bad argument was passed or if the vehicle is not a car.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptPlate ( player, command )&lt;br /&gt;
  local aVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )&lt;br /&gt;
  local text = getVehiclePlateText ( aVehicle )&lt;br /&gt;
  if ( text and aVehicle ) then&lt;br /&gt;
    outputChatBox ( &amp;quot;text&amp;quot; )&lt;br /&gt;
  else outputChatBox ( &amp;quot;your vehicle has no licence plate or you're not in a vehicle&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;plate&amp;quot;, scriptPlate )&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11450</id>
		<title>GetVehiclePlateText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePlateText&amp;diff=11450"/>
		<updated>2007-08-26T18:41:53Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to retrieve the text on the number plate of a specified vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getVehiclePlateText ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' A handle to the vehicle that you wish to retrieve the plate text from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' that coresponds to the plate on the text or ''false'' if a bad argument was passed or if the vehicle is not a car.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptPlate ( player, command )&lt;br /&gt;
  local aVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )&lt;br /&gt;
  local text = getVehiclePlateText ( aVehicle )&lt;br /&gt;
  if ( text and aVehicle ) then&lt;br /&gt;
    outputChatBox ( &amp;quot;text&amp;quot; )&lt;br /&gt;
  else outputChatBox ( &amp;quot;your vehicle has no licence plate or you're not in a vehicle&amp;quot; )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;plate&amp;quot;, scriptPlate )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11438</id>
		<title>GetVehiclePanelState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehiclePanelState&amp;diff=11438"/>
		<updated>2007-08-26T17:30:38Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|A list of panels would be nice and a more specific explanation on what the function returns --[[User:Norby89|Norby89]] 12:30, 26 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getVehiclePanelState ( vehicle thevehicle, int panel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the panel state of.&lt;br /&gt;
*'''panel:''' A whole number ranging from 0 to 6.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns an [[int]] indicating the state of the specified the panel. This value can be:&lt;br /&gt;
&lt;br /&gt;
NEEDS UPDATING&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This function creates an admiral and outputs every panel's state in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
admiral = createVehicle ( 445, 0, 0, 10 )&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
for i=0, 6 do&lt;br /&gt;
  local panel = getVehiclePanelState ( admiral, i )&lt;br /&gt;
    outputChatBox ( panel )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleDoorState&amp;diff=11437</id>
		<title>GetVehicleDoorState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleDoorState&amp;diff=11437"/>
		<updated>2007-08-26T17:14:13Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current state of a specifed door on the vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getVehicleDoorState ( vehicle theVehicle, int door )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the door state of.&lt;br /&gt;
*'''door:''' A whole number, 0 (hood), 1 (trunk), 2 (front left), 3 (front right), 4 (rear left), 5 (rear right)&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns 4 [[int]]s indicating the states of the door. These values can be:&lt;br /&gt;
* '''0:''' Shut (Undamaged)&lt;br /&gt;
* '''1:''' Open (Undamaged)&lt;br /&gt;
* '''2:''' Shut (Damaged)&lt;br /&gt;
* '''3:''' Open (Damaged)&lt;br /&gt;
* '''4:''' Fallen off&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
local state = getVehicleDoorState ( newcar, 2 )&lt;br /&gt;
outputChatBox ( &amp;quot;The 3rd door state on this car: &amp;quot; .. state )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeatherBlended&amp;diff=11427</id>
		<title>SetWeatherBlended</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeatherBlended&amp;diff=11427"/>
		<updated>2007-08-26T16:49:51Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Needs Checking|when trying it clientside it changed the weather instantly and not over a period of time, #2422 --[[User:Norby89|Norby89]] 09:16, 5 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will change the weather from the current weather (set using [[setWeather]]) to another weather state over a period of 60 seconds.&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 setWeatherBlended ( int weatherID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''weatherID:''' The ID of the weather state you wish to set. Valid values are 0 to 19 inclusive.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid ''weatherID'' is passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example sets the weather to sunny, then makes it change to a foggy over the period of a minute.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Set the weather to sunny&lt;br /&gt;
setWeather ( 0 )&lt;br /&gt;
-- Blend the weather to foggy&lt;br /&gt;
setWeatherBlended ( 9 )&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>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleRotation&amp;diff=11426</id>
		<title>SetVehicleRotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleRotation&amp;diff=11426"/>
		<updated>2007-08-26T16:47:35Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|the server side function seems to work counter clockwise meaning setting the rotation to (0 0 90) will make the vehicle face West serverside and East clentside, also serverside 0 rotation is displayed as 360 no biggie though, #2421 --[[User:Norby89|Norby89]] 09:17, 5 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function rotates a vehicle around a single point. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleRotation ( vehicle theVehicle, rx, ry, rz )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[vehicle]] that you wish to apply the warp to.&lt;br /&gt;
*'''x''': The x-axis rotation in degrees.&lt;br /&gt;
*'''y''': The y-axis rotation in degrees.&lt;br /&gt;
*'''z''': The z-axis rotation in degrees.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a boolean value ''true'' or ''false'' that tells you if it was successful or not.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local newcar = createVehicle ( 520, 1024, 1024, 1024 ) &lt;br /&gt;
if setVehicleRotation ( newcar, 0, 0, 270 ) then&lt;br /&gt;
    outputChatBox ( &amp;quot;Rotation change successful.&amp;quot; )&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleWheelStates&amp;diff=11424</id>
		<title>GetVehicleWheelStates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleWheelStates&amp;diff=11424"/>
		<updated>2007-08-26T16:45:23Z</updated>

		<summary type="html">&lt;p&gt;Norby89: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Needs Checking|the function doesn't work how it should, the order is FrontL, RearL, FrontR, RearR, when trying to pop out a tire and the ones before them (in the order I mentioned earlier) aren't flat it will remain unchanged, for instance I pop out the RealL tire the function will still say it's inflated but if I pop out the FrontL tire then it works, also it doesn't seem to work with bikes EDIT: it seems to be working well client side (except with bikes), mantis #2420 --[[User:Norby89|Norby89]] 09:15, 5 August 2007 (CDT)}}&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the current states of all the wheels on the vehicle.&lt;br /&gt;
&lt;br /&gt;
No vehicles have more than 4 wheels, if they appear to they will be duplicating other wheels.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int, int, int getVehicleWheelStates ( vehicle theVehicle )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the wheel states of.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns 4 [[int]]s indicating the states of the wheel. These values can be:&lt;br /&gt;
* '''0:''' Inflated&lt;br /&gt;
* '''1:''' Flat&lt;br /&gt;
* '''2:''' Fallen off&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example displays the states of the vehicle's wheels and changes their states if any arguments were passed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptWheelStates ( thePlayer, command, newFLeft, newRLeft, newFRight, newRRight )&lt;br /&gt;
  local theVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
  if ( theVehicle ) then -- check if the player is in a car&lt;br /&gt;
  	if ( newFLeft ) then -- if there's at least one argument passed, we change the wheel states&lt;br /&gt;
	  if not setVehicleWheelStates ( theVehicle, newFLeft, newRLeft, newFRight, newRRight ) then&lt;br /&gt;
	    outputChatBox ( &amp;quot;Bad arguments.&amp;quot; )&lt;br /&gt;
	  end&lt;br /&gt;
	end&lt;br /&gt;
    local states = { [0]=&amp;quot;inflated&amp;quot;, [1]=&amp;quot;flat&amp;quot;, [2]=&amp;quot;fallen off&amp;quot; } -- we store the states in a table&lt;br /&gt;
    local frontLeft, frontRight, rearLeft, rearRight = getVehicleWheelStates ( theVehicle )&lt;br /&gt;
    outputChatBox ( &amp;quot;Your vehicle's wheel states:&amp;quot;, thePlayer ) -- output them in the chatbox&lt;br /&gt;
    outputChatBox ( &amp;quot;Front-Left: &amp;quot; .. states [ frontLeft ] .. &amp;quot;, Front-Right: &amp;quot; .. states [ frontRight ]&lt;br /&gt;
      .. &amp;quot;, Rear-Left: &amp;quot; .. states [ rearLeft ] .. &amp;quot;, Rear-Right: &amp;quot; .. states [ rearRight ], thePlayer )&lt;br /&gt;
  else outputChatBox ( &amp;quot;You have to be in a vehicle to use this command.&amp;quot;, thePlayer )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;wheelstates&amp;quot;, scriptWheelStates )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Norby89</name></author>
	</entry>
</feed>