<?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=1337MaVe</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=1337MaVe"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/1337MaVe"/>
	<updated>2026-04-24T11:17:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Int&amp;diff=21399</id>
		<title>Int</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Int&amp;diff=21399"/>
		<updated>2009-09-02T11:39:07Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An integer is any whole number. It can be positive, zero, or negative. Examples: 1 0 -1 3 1 6 6 19 -152 5127 -8913 9000&lt;br /&gt;
&lt;br /&gt;
Note: it can also be over 9000&lt;br /&gt;
&lt;br /&gt;
A number with decimals is referred to as a [[float]] number&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerContact&amp;diff=21392</id>
		<title>OnPlayerContact</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerContact&amp;diff=21392"/>
		<updated>2009-08-31T18:05:33Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player stands on a different element than before.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element previousElement, element currentElement&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''previousElement''': The [[element]] player was standing on before. ''nil'' if none.&lt;br /&gt;
*'''currentElement''': The new [[element]] that the player is standing on now. ''nil'' if none.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who hit an element.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs the element type of an element you have hit&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputElementType ( prev, current )&lt;br /&gt;
	if ( current ) then&lt;br /&gt;
		outputChatBox ( &amp;quot;You have hit an &amp;quot;..getElementType ( current ) )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerContact&amp;quot;, getRootElement(), outputElementType )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleTaxiLightOn&amp;diff=21375</id>
		<title>SetVehicleTaxiLightOn</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleTaxiLightOn&amp;diff=21375"/>
		<updated>2009-08-30T19:46:12Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
[[Category:Needs_Example]]&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will set the taxi light on in a taxi (vehicle ID's 420 and 438)&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 setVehicleTaxiLightOn ( vehicle taxi, bool LightState )              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''taxi:''' The vehicle element of the taxi that you wish to turn the light on.&lt;br /&gt;
*'''LightState:''' whether the light is on. ''True'' for on, ''False'' for off.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the state was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example sets the taxi light on when the player presses &amp;quot;o&amp;quot; in a taxi.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot; , getRootElement ( ) , &lt;br /&gt;
function ( )&lt;br /&gt;
  bindKey ( source , &amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, &lt;br /&gt;
    function ( thePlayer )&lt;br /&gt;
      if ( isPedInVehicle ( thePlayer ) ) then --is in vehicle or not?&lt;br /&gt;
        local vehicle = getPedOccupiedVehicle ( thePlayer ) --getting player's occupied vehicle&lt;br /&gt;
        if ( getVehicleController ( vehicle ) == thePlayer ) then --is driver or not?&lt;br /&gt;
          local id = getElementModel ( vehicle ) --getting vehicle's model&lt;br /&gt;
          if ( ( id == 420 ) or ( id == 438 ) ) then --is a taxi?&lt;br /&gt;
            setVehicleTaxiLightOn ( vehicle, not isVehicleTaxiLightOn ( vehicle ) ) --changing taxi light on/off&lt;br /&gt;
          end&lt;br /&gt;
        end	&lt;br /&gt;
      end&lt;br /&gt;
   end)&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{vehicle functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI&amp;diff=21374</id>
		<title>Introduction to Scripting the GUI</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI&amp;diff=21374"/>
		<updated>2009-08-30T19:38:39Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- place holder --&amp;gt;&lt;br /&gt;
One important feature in MTA:SA is the ability to script customized GUI (Graphic User Interface). The GUI consists of windows, button, edit boxes, check boxes... Almost every standard form components in graphical environments. They can be displayed while the user is in game, and used for inputs and outputs in place of traditional commands. &lt;br /&gt;
&lt;br /&gt;
[[Image:AdminGUI.png|thumb|Admin Console GUI]]&lt;br /&gt;
&lt;br /&gt;
==A tutorial to make a login window==&lt;br /&gt;
In this tutorial we'll make a simple login window, with two input boxes and a button. The window appears when the player joins the game, and once the button is clicked, the player is spawned. The tutorial will continue the gamemode we made in [[Scripting Introduction|Introduction to Scripting]]. We'll also take a look at client-side scripting. &lt;br /&gt;
&lt;br /&gt;
===Draw the window===&lt;br /&gt;
All the GUI must be made client side. It is also a good practice to keep all the client scripts in a separate folder. Browse to /Your MTA Server/mods/deathmatch/resources/myserver/ directory, and create a folder named &amp;quot;client&amp;quot;. Under /client/ directory, create a text file and name it &amp;quot;gui.lua&amp;quot;, and in this file we will write a funtion that draws the window:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function CreateLoginWindow()&lt;br /&gt;
	local X = 0.375&lt;br /&gt;
	local Y = 0.375&lt;br /&gt;
	local Width = 0.25&lt;br /&gt;
	local Height = 0.25&lt;br /&gt;
	wdwLogin = guiCreateWindow(X, Y, Width, Height, &amp;quot;Please Log In&amp;quot;, true)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You may click on the function's name to read its documentation. Note that the coordinates of the window is in ''percentage'' of the screen. It means that if the screen is labelled with 0 on the left end, and 1 on the right end, and if &amp;quot;X&amp;quot; is 0.5, it represents the middle of the screen. It applies to Y, window width, and window height as well (if &amp;quot;width&amp;quot; is 0.5, the window will be half as wide as the screen). Next we'll add the text labels (saying &amp;quot;username:&amp;quot; and &amp;quot;password:&amp;quot;), edit boxes and a button. Replace the function with its complete version:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function CreateLoginWindow()&lt;br /&gt;
	local X = 0.375&lt;br /&gt;
	local Y = 0.375&lt;br /&gt;
	local Width = 0.25&lt;br /&gt;
	local Height = 0.25&lt;br /&gt;
	wdwLogin = guiCreateWindow(X, Y, Width, Height, &amp;quot;Please Log In&amp;quot;, true)&lt;br /&gt;
	&lt;br /&gt;
	X = 0.0825&lt;br /&gt;
	Y = 0.2&lt;br /&gt;
	Width = 0.25&lt;br /&gt;
	Height = 0.25&lt;br /&gt;
	guiCreateLabel(X, Y, Width, Height, &amp;quot;Username&amp;quot;, true, wdwLogin)&lt;br /&gt;
	Y = 0.5&lt;br /&gt;
	guiCreateLabel(X, Y, Width, Height, &amp;quot;Password&amp;quot;, true, wdwLogin)&lt;br /&gt;
	&lt;br /&gt;
	X = 0.415&lt;br /&gt;
	Y = 0.2&lt;br /&gt;
	Width = 0.5&lt;br /&gt;
	Height = 0.15&lt;br /&gt;
	edtUser = guiCreateEdit(X, Y, Width, Height, &amp;quot;&amp;quot;, true, wdwLogin)&lt;br /&gt;
	Y = 0.5&lt;br /&gt;
	edtPass = guiCreateEdit(X, Y, Width, Height, &amp;quot;&amp;quot;, true, wdwLogin)&lt;br /&gt;
	guiEditSetMaxLength(edtUser, 50)&lt;br /&gt;
	guiEditSetMaxLength(edtPass, 50)&lt;br /&gt;
	&lt;br /&gt;
	X = 0.415&lt;br /&gt;
	Y = 0.7&lt;br /&gt;
	Width = 0.25&lt;br /&gt;
	Height = 0.2&lt;br /&gt;
	btnLogin = guiCreateButton(X, Y, Width, Height, &amp;quot;Log In&amp;quot;, true, wdwLogin)&lt;br /&gt;
	&lt;br /&gt;
	guiSetVisible(wdwLogin, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that every GUI component created is a child of the window, this is done by specifying the parent element (wdwLogin, in this case) when creating the component:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
guiCreateLabel(X, Y, Width, Height, &amp;quot;Password&amp;quot;, true, wdwLogin)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is very useful because later when you need to control the entire set of GUI, you can just refer to the parent element. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
guiSetVisible(wdwLogin, false) --hides all the GUI we made so we can show them to the player at the appropriate moment. &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the function we wrote===&lt;br /&gt;
The CreateLoginWindow function is done, but it won't do anything until we call it. It is recommended to create all GUI when the client resource starts, hide them, and show them to player later when needed. Therefore, we'll write an event handler for &amp;quot;[[onClientResourceStart]]&amp;quot; to create the window:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), &lt;br /&gt;
	function ()&lt;br /&gt;
		CreateLoginWindow()&lt;br /&gt;
	end&lt;br /&gt;
)	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
We would like to show the window when the client joins the game, using the same event &amp;quot;[[onClientResourceStart]]&amp;quot;. Now the event handler looks like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), &lt;br /&gt;
	function ()&lt;br /&gt;
		CreateLoginWindow()&lt;br /&gt;
&lt;br /&gt;
                outputChatBox(&amp;quot;Welcome to My MTA:SA Server, please log in.  &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	        if (wdwLogin ~= nil) then&lt;br /&gt;
		         guiSetVisible(wdwLogin, true)&lt;br /&gt;
	        end &lt;br /&gt;
&lt;br /&gt;
	        showCursor(true)&lt;br /&gt;
	        guiSetInputEnabled(true)&lt;br /&gt;
	end&lt;br /&gt;
)	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that we have a security check before making the window visible, so that in case the window had not been created, in which case wdwLogin is not a valid element, we don't get an error. The [[showCursor]] function gives control to your mouse, and [[guiSetInputEnabled]] makes sure when you type in the GUI, certain letters like &amp;quot;A&amp;quot;, &amp;quot;S&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;W&amp;quot;, &amp;quot;T&amp;quot; don't move your character or bring out the chatbox input. In the next step, we'll make the button work as desired.&lt;br /&gt;
&lt;br /&gt;
===Scripting the button===&lt;br /&gt;
When the player clicks on any part of the GUI, the event &amp;quot;[[onClientGUIClick]]&amp;quot; will be triggered for the GUI component you clicked on. For instance, if you click on the button, you can add the event handler attached to the button:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, theButtonElement, theHandlerFunction, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In our script, we only need the event handler attached to the button. When it's clicked, the client will tell the server to spawn the player. Find the event handler code for &amp;quot;onClientResourceStart&amp;quot; from the previous section, and add the following line right AFTER CreateLoginWindow() is called:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, btnLogin, clientSubmitLogin, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The event handler must be added here because it makes sure variable btnLogin contains the actual button. You cannot attach an event to an non-existant element. You should have noticed that we need the &amp;quot;clientSubmitLogin&amp;quot; function, as stated in the line above.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function clientSubmitLogin(button)&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
		&lt;br /&gt;
		triggerServerEvent(&amp;quot;SubmitLogin&amp;quot;, getRootElement(), guiGetText(edtUser), guiGetText(edtPass))&lt;br /&gt;
		guiSetInputEnabled(false)&lt;br /&gt;
		guiSetVisible(wdwLogin, false)&lt;br /&gt;
		showCursor(false)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The variable &amp;quot;button&amp;quot; is passed by the event handler, and it's a string with the name of the button (either &amp;quot;left&amp;quot; or &amp;quot;right&amp;quot;). Here we also hit a new concept, which is custom events. Custom events can be triggered by script from the same side (server to server, or client to client), or from the other side (server to client, or vice versa). Here we use the [[triggerServerEvent]] function to trigger a custom event on the server, &amp;quot;SubmitLogin&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
At this point we have all the code needed on the client side. On the server side, recall that we are spawning the player as soon as they join, as shown below: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	local x,y,z&lt;br /&gt;
	x = 1959.55&lt;br /&gt;
	y = -1714.46&lt;br /&gt;
	z = 10&lt;br /&gt;
	spawnPlayer(source, x, y, z)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
However, since we are going to spawn the player when the button is clicked, we must replace the &amp;quot;onPlayerJoin&amp;quot; event with the custom event triggered by the client script. Replace the above code with the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinHandler(username, password)&lt;br /&gt;
	local x,y,z&lt;br /&gt;
	x = 1959.55&lt;br /&gt;
	y = -1714.46&lt;br /&gt;
	z = 10&lt;br /&gt;
        if (client) then&lt;br /&gt;
	      spawnPlayer(client, x, y, z)&lt;br /&gt;
	      fadeCamera(client, true)&lt;br /&gt;
	      outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, client)&lt;br /&gt;
        end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEvent(&amp;quot;SubmitLogin&amp;quot;, true)&lt;br /&gt;
addEventHandler(&amp;quot;SubmitLogin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the second arguement of [[addEvent]] function (the one with value &amp;quot;true&amp;quot;) specifies whether the event can be triggered by the other side, therefore we need to turn it on since the client is triggering it. Also note the variable &amp;quot;client&amp;quot;, it's an internal variable used by MTA to identify the player who triggered the event. &lt;br /&gt;
&lt;br /&gt;
Finally, do not forget to include the new gui.lua file in the meta.xml of the main resource, and label it as a client script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client/gui.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As to this point, we have a basic login window that spawns the player when the &amp;quot;login&amp;quot; button is clicked. You can also use the username and password submitted by the [[triggerServerEvent]] function to verify the player's identify before spawning him.&lt;br /&gt;
&lt;br /&gt;
[[it:Introduzione_allo_scripting_della_GUI]]&lt;br /&gt;
[[ru:Introduction to Scripting the GUI]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TextItemSetText&amp;diff=21342</id>
		<title>TextItemSetText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TextItemSetText&amp;diff=21342"/>
		<updated>2009-08-27T13:51:19Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
Overwrites a previously created text item with the specified text.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;void textItemSetText ( textitem theTextitem, string text )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theTextitem:''' An existing text item that was previously created with [[textCreateTextItem]]&lt;br /&gt;
*'''text:''' The new text for the text item&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Here, it is being used to update a scoreboard:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function updateScoreOnWasted ( ammo, killer, weapon )&lt;br /&gt;
	if ( killer ~= false) then                            -- Check to see if anything killed the player&lt;br /&gt;
		local killerTeam = getTeamName ( getPlayerTeam(killer) )&lt;br /&gt;
		if ( killerTeam == &amp;quot;grove&amp;quot; ) then             -- if a Grove player scored the kill&lt;br /&gt;
			groveteamscore = groveteamscore + 1   -- Grove gets 1 point&lt;br /&gt;
			textItemSetText ( scoregrove, tostring(groveteamscore) ) -- Update scoreboard.&lt;br /&gt;
		elseif ( killerTeam == &amp;quot;balla&amp;quot; ) then         -- if a Balla player scored the kill&lt;br /&gt;
			ballateamscore = ballateamscore + 1   -- Ballas get 1 point&lt;br /&gt;
			textItemSetText ( scoreballa, tostring(ballateamscore) ) -- Update scoreboard.&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, getRootElement(), updateScoreOnWasted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Text functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TextItemSetText&amp;diff=21341</id>
		<title>TextItemSetText</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TextItemSetText&amp;diff=21341"/>
		<updated>2009-08-27T13:50:53Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
Overwrites a previously created text item with the specified text.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;void textItemSetText ( textitem theTextitem, string text )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theTextitem:''' An existing text item that was previously created with [[textDisplayCreateText]]&lt;br /&gt;
*'''text:''' The new text for the text item&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Here, it is being used to update a scoreboard:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function updateScoreOnWasted ( ammo, killer, weapon )&lt;br /&gt;
	if ( killer ~= false) then                            -- Check to see if anything killed the player&lt;br /&gt;
		local killerTeam = getTeamName ( getPlayerTeam(killer) )&lt;br /&gt;
		if ( killerTeam == &amp;quot;grove&amp;quot; ) then             -- if a Grove player scored the kill&lt;br /&gt;
			groveteamscore = groveteamscore + 1   -- Grove gets 1 point&lt;br /&gt;
			textItemSetText ( scoregrove, tostring(groveteamscore) ) -- Update scoreboard.&lt;br /&gt;
		elseif ( killerTeam == &amp;quot;balla&amp;quot; ) then         -- if a Balla player scored the kill&lt;br /&gt;
			ballateamscore = ballateamscore + 1   -- Ballas get 1 point&lt;br /&gt;
			textItemSetText ( scoreballa, tostring(ballateamscore) ) -- Update scoreboard.&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, getRootElement(), updateScoreOnWasted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Text functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=21058</id>
		<title>SetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=21058"/>
		<updated>2009-08-13T16:35:33Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function stores [[element data]] under a certain key, attached to an element. Element data set using this is then synced with all clients or the server. As such you should avoid passing data that is not able to be synced into this function (i.e. xmlnodes, acls, aclgroups etc.) Server-created elements are able to be synced.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value, [bool synchronize = true] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;/section&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, [bool synchronize = true], var value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;/section&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under.&lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the server (client-side variation) and remote clients (both variations).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set succesfully, ''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;false&amp;quot;&amp;gt;&lt;br /&gt;
This example allows for a player to add a custom tag onto their nickname, and also revert it back to normal if they wish&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function addPlayerCustomTag ( thePlayer, command, newTag )&lt;br /&gt;
	--Let's make sure the newTag param has been entered...&lt;br /&gt;
	if ( newTag ) then&lt;br /&gt;
		--Grab their current playername for saving.&lt;br /&gt;
		local sPlayerNickname = getClientName ( thePlayer )&lt;br /&gt;
		--Create their new nickname with their tag&lt;br /&gt;
		local sNewPlayerNickname = newTag .. &amp;quot; &amp;quot; .. sPlayerNickname&lt;br /&gt;
		&lt;br /&gt;
		--Let's first load the element data, see if it's there already&lt;br /&gt;
		--The reason for this is that if a player were to do /addtag twice,&lt;br /&gt;
		--the tag would be prepended a second time&lt;br /&gt;
		local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
		if ( sOldNick == false ) then&lt;br /&gt;
			--Save their orignal nickname in their element data&lt;br /&gt;
			setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, sPlayerNickname )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Set their new nickname globally&lt;br /&gt;
		setClientName ( thePlayer, sNewPlayerNickname )&lt;br /&gt;
		&lt;br /&gt;
		--Tell them it's done&lt;br /&gt;
		outputChatBox ( &amp;quot;Your new nickname has been set, to put it back to its original state you can use /deltag&amp;quot;, thePlayer )&lt;br /&gt;
	else&lt;br /&gt;
		--The newTag param was not entered, give an error message&lt;br /&gt;
		outputChatBox ( &amp;quot;/addtag - Incorrect syntax, Correct: /addtag &amp;lt;newtag&amp;gt;&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;addtag&amp;quot;, addPlayerCustomTag )&lt;br /&gt;
&lt;br /&gt;
function removePlayerCustomTag ( thePlayer, command )&lt;br /&gt;
	--We first need to check that they have already used /addtag, let's do that now&lt;br /&gt;
	local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
	if ( sOldNick ) then&lt;br /&gt;
		--Great, they have a tag added, let's reset them&lt;br /&gt;
		&lt;br /&gt;
		--First we will want to reset the element data back to its default (that being false)&lt;br /&gt;
		setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, false )&lt;br /&gt;
		&lt;br /&gt;
		--Now set the client name back&lt;br /&gt;
		setClientName ( thePlayer, sOldNick )&lt;br /&gt;
		&lt;br /&gt;
		--Notify them&lt;br /&gt;
		outputChatBox ( &amp;quot;Your old nickname has been set&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;deltag&amp;quot;, removePlayerCustomTag )&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>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IfElse&amp;diff=21023</id>
		<title>IfElse</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IfElse&amp;diff=21023"/>
		<updated>2009-08-09T08:16:55Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function just adds a possibility to integrate a condition in e.g. some variable definition. It is as useful as simple. It's like the short ”(c) ? t : f ;“ statement that exists in e.g. PHP or JavaScript.&lt;br /&gt;
&lt;br /&gt;
''Note: This function is basically on the wiki to enable using it in other useful functions.''&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;var IfElse( bool condition, var trueReturn, var falseReturn )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''condition''': A condition like you could use it in an if-statement.&lt;br /&gt;
* '''trueReturn''': The value that should be returned if the condition is true.&lt;br /&gt;
* '''falseReturn''': The value that should be returned if the condition is false.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the second argument if condition is true, the third otherwise.&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;&amp;gt;&lt;br /&gt;
function IfElse(condition, trueReturn, falseReturn)&lt;br /&gt;
    if (condition) then return trueReturn&lt;br /&gt;
    else return falseReturn end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a command to retrieve the actual player count.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define the commandhandler function&lt;br /&gt;
function CmdPlayerCount(source)&lt;br /&gt;
    -- get the actual player count&lt;br /&gt;
    local playerCount = getPlayerCount()&lt;br /&gt;
    -- send message to the player&lt;br /&gt;
    outputChatBox(&amp;quot;There &amp;quot;..IfElse(playerCount == 1, &amp;quot;is&amp;quot;, &amp;quot;are&amp;quot;)..&amp;quot; actually &amp;quot;..playerCount..&amp;quot; Player&amp;quot;..IfElse(playerCount == 1, &amp;quot;&amp;quot;, &amp;quot;s&amp;quot;)..&amp;quot; online.&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
-- add the command handler&lt;br /&gt;
addCommandHandler(&amp;quot;playerCount&amp;quot;, CmdPlayerCount, false, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: NeonBlack&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ExecuteCommandHandler&amp;diff=21022</id>
		<title>ExecuteCommandHandler</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ExecuteCommandHandler&amp;diff=21022"/>
		<updated>2009-08-09T07:39:02Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will call all the attached functions of an existing console command, for a 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;bool executeCommandHandler ( string commandName, player thePlayer, [ string args ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''commandName:''' The name of the command you wish to execute. This is what must be typed into the console to trigger the function.&lt;br /&gt;
*'''thePlayer:''' The player that will be presented as executer of the command to the handler function(s) of the command&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''args:''' Additional parameters that will be passed to the handler function(s) of the command that is called.&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;bool executeCommandHandler ( string commandName, [ string args ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''commandName:''' The name of the command you wish to execute. This is what must be typed into the console to trigger the function.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''args:''' Additional parameters that will be passed to the handler function(s) of the command that is called.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the command handler was called 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; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example defines a command handler for the command ''createmarker'' (which creates a red marker at the caller's position). It then creates a second command handler ''createmarker2'' which will call the first one.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Define the function that will handle the 'createmarker' command&lt;br /&gt;
function consoleCreateMarker ( playerSource, commandName )&lt;br /&gt;
	-- If a player triggered it (rather than the admin) then&lt;br /&gt;
	if ( playerSource )&lt;br /&gt;
		-- Get that player's position&lt;br /&gt;
		x, y, z = getElementPosition ( playerSource )&lt;br /&gt;
		-- Create a marker at their position&lt;br /&gt;
		createMarker ( x, y, z, 0, &amp;quot;checkpoint&amp;quot;, 255, 0, 0, 255 )&lt;br /&gt;
		-- Output it in the 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;
-- Add the function as a handler for the command&lt;br /&gt;
addCommandHandler ( &amp;quot;createmarker&amp;quot;, consoleCreateMarker )&lt;br /&gt;
&lt;br /&gt;
-- Define a second console command that will just call the first.&lt;br /&gt;
-- First define the function&lt;br /&gt;
function consoleCreateMarker2 ( playerSource, commandName )&lt;br /&gt;
	-- re-route back to the original&lt;br /&gt;
	executeCommandHandler ( &amp;quot;createmarker&amp;quot;, playerSource )&lt;br /&gt;
end&lt;br /&gt;
-- Then add it as a handler for the new console command&lt;br /&gt;
addCommandHandler ( &amp;quot;createmarker2&amp;quot;, consoleCreateMarker2 )&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;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:SetPedAnimation&amp;diff=21021</id>
		<title>Talk:SetPedAnimation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:SetPedAnimation&amp;diff=21021"/>
		<updated>2009-08-09T07:32:17Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why is there only the ''one'' ped argument actually needed? An argument specyfing if it should start or cancel would be more useful imo [[User:1337MaVe|1337MaVe]] 07:32, 9 August 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:SetPedAnimation&amp;diff=21020</id>
		<title>Talk:SetPedAnimation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:SetPedAnimation&amp;diff=21020"/>
		<updated>2009-08-09T07:30:50Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: Created page with 'Why is there only the ''one'' ped argument actually needed? ~~~~'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why is there only the ''one'' ped argument actually needed? [[User:1337MaVe|1337MaVe]] 07:30, 9 August 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=20997</id>
		<title>OnPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerChangeNick&amp;diff=20997"/>
		<updated>2009-08-07T07:49:58Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: Added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete Event]]&lt;br /&gt;
{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when a player changes his nickname.&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string oldNick, string newNick&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick:''' the nickname the player had before.&lt;br /&gt;
*'''newNick:''' the new nickname of the player.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the player that changed his nick&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 nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    -- check if there's account with newNick as username&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        local thePlayer = getPlayerFromNick(newNick)&lt;br /&gt;
        outputChatBox(&amp;quot;Sorry, there already exists an account with your new nickname as username.&amp;quot;, thePlayer, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Please choose another one.&amp;quot;, thePlayer, 0, 255, 0)&lt;br /&gt;
        -- cancel the event to prevent the nick from being changed&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add an event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DE/Server_Anleitung&amp;diff=20961</id>
		<title>DE/Server Anleitung</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DE/Server_Anleitung&amp;diff=20961"/>
		<updated>2009-08-04T07:05:18Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: /* Allgemein */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Vorwort==&lt;br /&gt;
Einen MTA Server einzurichten ist einfacher, als es aussieht. Wenn Du dieser Anleitung folgst, brauchst Du nur wenige Minuten, um Deinen eigenen MTA Server zu konfigurieren.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
===Windows (DP2)===&lt;br /&gt;
* Windows-Server von der [http://mtasa.com/deathmatch.html Downloadseite] herunterladen.&lt;br /&gt;
* Die Datei öffnen und auswählen, wohin der Server entpackt werden soll.&lt;br /&gt;
* Zum Schluss auf &amp;quot;Extract&amp;quot; klicken&lt;br /&gt;
&lt;br /&gt;
===Windows (1.0)===&lt;br /&gt;
Der Windows-Server für die Nightlies ist bereits im Installer integriert.&lt;br /&gt;
* Aktuelle Nightly von [http://nightly.mtasa.com/mtasadm-1.0-r1294.exe nightly.mtasa.com] herunterladen&lt;br /&gt;
* Während der Installation wird der Server standardmäßig installiert&lt;br /&gt;
* Zusätzlich kann man noch die [http://code.google.com/p/multitheftauto-resources/downloads/list aktuellen Resourcen von der Google-Code-Seite] herunterladen. Diese werden dann in &amp;lt;server&amp;gt;/mods/deathmatch/resources entpackt.&lt;br /&gt;
&lt;br /&gt;
==Den Server konfigurieren==&lt;br /&gt;
Der Server kann sowohl über die Konsole (das Fenster, das sich öffnet, wenn man die MTA Server.exe aufmacht) als auch im Spiel oder über das Webinterface verwaltet werden. Für die letzten beiden Optionen ist es nötig, mindestens einen Administrator hinzuzufügen.&lt;br /&gt;
&lt;br /&gt;
===Allgemein===&lt;br /&gt;
Die hauptsächlichen Konfigurationsoptionen eures Server befinden sich in '''&amp;lt;server&amp;gt;/mods/deathmatch/mtaserver.conf'''.&lt;br /&gt;
Gespeicherte Accounts sind in '''&amp;lt;server&amp;gt;/mods/deathmatch/accounts.xml''' und Zugangsberechtigungen in '''&amp;lt;server&amp;gt;/mods/deathmatch/accounts.xml''' zu finden.&lt;br /&gt;
&lt;br /&gt;
===Port-Konfiguration===&lt;br /&gt;
Hier wird erklärt welche Ports ihr öffnen müsst, damit auch andere Spieler auf eurem Server spielen können.&lt;br /&gt;
&lt;br /&gt;
Als erstes öffnet ihr die Datei '''&amp;lt;server&amp;gt;/mods/deathmatch/mtaserver.conf'''' und sucht nach diesen Zeilen:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverport&amp;gt;22004&amp;lt;/serverport&amp;gt;&lt;br /&gt;
&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Diese geben den Port für den Gameserver (in diesem Fall 22004) und für den eingebauten Webserver (22005) an.&lt;br /&gt;
&lt;br /&gt;
Um den Server überhaupt von Außen erreichbar zu machen, müssen die entsprechenden Ports freigegeben werden. Auf der Seite [http://portforward.com/ portforward.com] wird für viele Router erklärt, wie dies funktioniert. Auch in eurer Firewall müssen (falls vorhanden) die Ports konfiguriert werden. Der MTA-Server an sich benötigt '''UDP''' für &amp;lt;serverport&amp;gt;, und sofern ihr keinen externen Webserver (später dazu mehr) nutzen wollt, noch eine TCP-Freigabe für &amp;lt;httpport&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Um festzulegen, ob euer Server für Jeden in der Serverliste angezeigt werden soll, ist folgende Option vorhanden:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt; &amp;lt;!-- 0 = aus and 1 = ein.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Falls Ihr dies einschaltet, muss zusätzlich noch der ''&amp;lt;serverport&amp;gt;+123'' geöffnet werden, in obigem Falle also 22127.&lt;br /&gt;
&lt;br /&gt;
===Administratoren hinzufügen===&lt;br /&gt;
Es ist empfohlen, mindestens einen Adminstrator einzurichten, der dann in der Lage ist, den Server zu konfigurieren und verwalten. Dies kann entweder über das eingebaute Webinterface geschehen oder mittels Konsole im Spiel (F8 oder `)&lt;br /&gt;
&lt;br /&gt;
Folgende einfache Schritte helfen euch dabei, dies zu tun. &lt;br /&gt;
&lt;br /&gt;
Für das Hinzufügen eures eigenen Accounts gibt es mehrere Möglichkeiten&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Falls das Admin-Panel läuft, kann man im Spiel einfach '''/register &amp;lt;passwort&amp;gt;''' machen&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Alternativ kann man über die Server-Konsole den Befehl '''addaccount &amp;lt;accountname&amp;gt; &amp;lt;passwort&amp;gt;''' verwenden&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Die dritte Variante ist eine Änderung der '''&amp;lt;server&amp;gt;/mods/deathmatch/accounts.xml'''.&amp;lt;br /&amp;gt;Falls der Server läuft, muss er ausgeschaltet werden, da sonst alle Änderungen überschrieben werden.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Öffnet also diese Datei mit einem beliebigen Texteditor und fügt euren eigenen Account hinzu. Für DP2 muss das Passwort dabei im Klartext stehen, für 1.0 muss der MD5-Hash verwendet werden. Im Beispiel wird der Benutzer ''BennyLava'' mit dem Passwort ''123password'' angelegt.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;accounts&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;account name=&amp;quot;BennyLava&amp;quot; password=&amp;quot;123password&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/accounts&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Anschließend speichern und schließen.&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nachdem nun der Account angelegt ist, müssen ihm noch die entsprechenden Rechte gegeben werden. Diese werden in der Datei '''&amp;lt;server&amp;gt;/mods/deathmatch/acl.xml''' festgelegt. Der Server sollte aus sein, sonst wird die geänderte Datei wieder überschrieben.&lt;br /&gt;
&lt;br /&gt;
Als Administrator werden wir den neuen Benutzer ''BennyLava'' natürlich der '''Admin'''-Gruppe zuordnen, dies geschieht mittels folgenden XML-Syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;acl&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;Admin&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;!-- Für Benutzer: user.&amp;lt;accountname&amp;gt;, derselbe wie in der accounts.xml --&amp;gt;&lt;br /&gt;
    &amp;lt;object name=&amp;quot;user.BennyLava&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/group&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Resourcen und Accounts kann man in Gruppen einordnen, und jeder Gruppe ist mindestens eine [[Access Control List]] zugeordnet. Diese gibt an, welche Rechte die Resource oder der Benutzer haben, welche Befehle jemand ausführen oder nicht ausführen darf und welche der Scripting-Funktionen nur bestimmten Resourcen zur Verfügung stehen. Alle registrierten und unregistrierten Benutzer fallen standardmäßig in die Gruppe ''Everyone'', die einigen Beschränkungen unterliegt, so fehlt beispielsweise das Recht zum Kicken und Bannen.&lt;br /&gt;
&lt;br /&gt;
''Weitere Informationen zur ACL finden sich auf einer [[Access Control List|Extraseite]].''&lt;br /&gt;
&lt;br /&gt;
===Das Webinterface===&lt;br /&gt;
===externen Webserver einrichten===&lt;br /&gt;
==Den Server verwalten==&lt;br /&gt;
Sobald man auf dem Server ist, kann man sich nun mit '''/login &amp;lt;passwort&amp;gt;''', oder falls der Benutzername unterschiedlich zum Accountname (in der ACL) ist, '''/login &amp;lt;accontname&amp;gt; &amp;lt;passwort&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
War dies erfolgreich, ist man Admin und kann einige Befehle, die speziell für Administratoren gedacht sind, nutzen.&lt;br /&gt;
&lt;br /&gt;
Abgesehen von den in der '''mtaserver.conf''' eingestellten Resourcen für den Server-Start kann man jederzeit weitere starten oder bereits laufende anhalten, dazu gibt es die die Befehle&lt;br /&gt;
* '''start &amp;lt;Name der Resource&amp;gt;''', die die Resource mit dem Namen startet,&lt;br /&gt;
* '''stop &amp;lt;Name der Resource&amp;gt;''', um die Resource wieder zu stoppen, und&lt;br /&gt;
* '''restart &amp;lt;Name der Resource&amp;gt;''', welcher die Resource erst anhält und wieder startet.&lt;br /&gt;
&lt;br /&gt;
Eine Übersicht über alle Befehle kann man mittels '''help''' in der Server- oder Ingame-Konsole (standardmäßig mit F8 bzw. ` erreichbar) anzeigen lassen.&lt;br /&gt;
&lt;br /&gt;
Resourcen können weitere Funktionen und Befehle bereitstellen. Als Beispiel sei hier nur das Admin-Panel genannt, welches sich beim Einloggen mit der Meldung ''Press 'p' to open your admin panel'' zu Wort meldet. Durch Drücken dieser Taste erhält man Zugriff auf eine grafische Oberfläche, die viele zusätzliche Funktionen bereitstellt, unter anderem Kicken, Bannen und Teleportieren.&lt;br /&gt;
&lt;br /&gt;
==Resourcen hinzufügen/aktualisieren==&lt;br /&gt;
Die Resourcen können entweder als ZIP-Archive gepackt sein oder einfache Ordner, in denen sich die zugehörigen Dateien befinden - beides wird von MTA unterstützt.&lt;br /&gt;
# Die Resource (ZIP oder Ordner) nach ''&amp;lt;server&amp;gt;/mods/deathmatch/resources'' kopieren&lt;br /&gt;
# Als Admin in der Konsole '''refresh''' eingeben. Dies durchsucht den kompletten resources-Ordner nach geänderten Resourcen, neue Resourcen werden der internen Liste hinzugefügt und nicht mehr existierende angehalten und gelöscht.&lt;br /&gt;
&lt;br /&gt;
==Resourcen entfernen==&lt;br /&gt;
Sofern Resourcen nicht mehr benötigt werden, kann man diese ähnlich einfach entfernen:&lt;br /&gt;
# Den Ordner oder das ZIP-Archiv aus ''&amp;lt;server&amp;gt;/mods/deathmatch/resources'' löschen&lt;br /&gt;
# Als Admin in der Konsole '''refresh''' eingeben.&lt;br /&gt;
&lt;br /&gt;
==Einen Gamemode oder eine Map starten==&lt;br /&gt;
Für diesen Zweck steht die Resource [[Resource:Mapmanager|mapmanager]] bereit, auf deren Dokumentation an dieser Stelle nur verwiesen sei. Wichtig ist natürlich, dass die Resource auch läuft.&lt;br /&gt;
&lt;br /&gt;
[[en:Deathmatch Server Manual]]&lt;br /&gt;
[[it:Manuale del Server]]&lt;br /&gt;
[[nl:Deathmatch Server Manual]]&lt;br /&gt;
[[ru:Deathmatch Server Manual]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_Manual&amp;diff=20959</id>
		<title>Server Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_Manual&amp;diff=20959"/>
		<updated>2009-08-03T11:56:36Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
It is much easier than it looks to get a server up and running for your internet or LAN buddies: follow this wiki article and you will hopefully be on your way to hosting your own MTA:SA DM Server in no time!&lt;br /&gt;
&lt;br /&gt;
==Installing the server==&lt;br /&gt;
The dedicated server application is available in different flavours depending on the platform of the server.&lt;br /&gt;
&lt;br /&gt;
==Linux installation==&lt;br /&gt;
===Ubuntu===&lt;br /&gt;
I installed the server on Ubuntu 6.05 LTS. I will add installation instructions for other linux distros at a later time.&lt;br /&gt;
This install was done on a fresh os install so a few things have to be installed first.&lt;br /&gt;
First of all ssh into your server using whatever client you like. I prefer putty.&lt;br /&gt;
Start by typing   '''sudo apt-get upgrade''' It will prompt you to put your password in again. After the upgrade is done running type&lt;br /&gt;
'''sudo apt-get install pico''' this will install the easy to use pico text editor that you will use to edit the config files.&lt;br /&gt;
After the install is done running you need to get a copy of libcurl3 for the server to run so type '''sudo apt-get install libcurl3'''&lt;br /&gt;
Once again it will ask you for your password. Once this is done now we have to get the server program onto your Linux server. There are a few methods for doing this. you can install a ftp server. you can use putty file transfer. If you know someone with a website you can ask them to put the file on their website then use '''wget http://www.websitename.com/file.tar''' Obviously where website name is change to your friends website. Either way once you have the tar file on your server you need to unpack it you do this by using the command '''tar -zxvf filename.tar'''&lt;br /&gt;
===Gentoo===&lt;br /&gt;
I assume that if people are using Gentoo, they know enough of an operating system to get files from the web to their server theirselves... (otherwise, look above and read the ubuntu part)&lt;br /&gt;
&lt;br /&gt;
These versions I needed for DP2:&lt;br /&gt;
&lt;br /&gt;
Update your gcc version to 4.2.2:&lt;br /&gt;
* unmask gcc in /etc/portage/package.unmask)&lt;br /&gt;
* emerge gcc&lt;br /&gt;
* switch to gcc 4.2.2: gcc-config i686-pc-linux-gnu-4.2.2&lt;br /&gt;
Update your libstdc++ version to 3.3 if you haven't got that version&lt;br /&gt;
* emerge libstdc++&lt;br /&gt;
Install libcurl:&lt;br /&gt;
* emerge libcurl&lt;br /&gt;
Unpack mtasa, and run it...&lt;br /&gt;
&lt;br /&gt;
==Windows installation==&lt;br /&gt;
Installation of the MTA:SA DM server on Windows is easy as pie.&lt;br /&gt;
*Go to the [http://mtasa.com/deathmatch.html download page] and scroll down to the &amp;quot;Dedicated servers&amp;quot; section&lt;br /&gt;
*Click the Windows download link.&lt;br /&gt;
*Once the installer is downloaded, open it.&lt;br /&gt;
*Select a folder where you want to install the server.&lt;br /&gt;
*Click Install.&lt;br /&gt;
*Done!&lt;br /&gt;
&lt;br /&gt;
''For a full explanation of acl.xml (access control list) read: [[Access_Control_List|Access Control List]]''&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuring your server==&lt;br /&gt;
The Multi Theft Auto dedicated server is initially configurable through it's console window, from within the game, and from a webbrowser. In order to make use of the two last options, it is necessary to add at least one administrator user to your configuration file.&lt;br /&gt;
&lt;br /&gt;
===General configuration===&lt;br /&gt;
All general configuration options can be found in the 'mods/deathmatch/'''mtaserver.conf'''' file and can be opened by any regular text editor.&lt;br /&gt;
&lt;br /&gt;
This file is fairly straightforward; every variable has a description of what to do with it and how to change it.&lt;br /&gt;
&lt;br /&gt;
===Port forwarding===&lt;br /&gt;
If you run your server on your own private computer, and you have an router between the internet and your computer. You need to forward 3 ports.&lt;br /&gt;
&lt;br /&gt;
First of all open the file 'mods/deathmatch/'''mtaserver.conf'''' and search for the next lines:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverport&amp;gt;22004&amp;lt;/serverport&amp;gt; &lt;br /&gt;
&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ports are needed to setup the server right. We explain later how to set them, but first if you want your server to list in the server browser there is an other port we need, and that is the ase port. &lt;br /&gt;
(quick example for how to turn ase on or of):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt; &amp;lt;!-- 0 = off, 1 = on --&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we going to forward the ports in router, which is not needed if you already have all ports open, or if you don't have a router with a firewall. If so, skip this part.&lt;br /&gt;
&lt;br /&gt;
If you don't know how port forwarding works in your router, go to: http://portforward.com/, find your router there, and follow the instructions there.&lt;br /&gt;
&lt;br /&gt;
In almost every router you can set the port type: UDP or TCP. The following list will explain which port type is needed for what:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Main server port: UDP&lt;br /&gt;
&lt;br /&gt;
HTTP Port: TCP&lt;br /&gt;
&lt;br /&gt;
ASE Port: UDP (this is needed if you want your server to appear in the server list)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ASE port is also simply to get:&lt;br /&gt;
&lt;br /&gt;
ASE port = Main Server port + 123&lt;br /&gt;
&lt;br /&gt;
So, if you have the main server port set to 22003, then the ASE port will be 22126.&lt;br /&gt;
&lt;br /&gt;
Good luck!&lt;br /&gt;
&lt;br /&gt;
===Adding administrators===&lt;br /&gt;
It is strongly recommended to add at least one administrator to your server in order to make use of the built-in webserver to easily maintain and configure your server. This administrator will then also be able to log-in from within the game and control the server.&lt;br /&gt;
&lt;br /&gt;
To add an administrator to your server, follow these steps:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure your server is stopped; if your server is still running, all changes you make will be overwritten&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file 'mods/deathmatch/'accounts.xml'''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add a new account into the file by using the XML-syntax below, we use the username &amp;quot;BennyLava&amp;quot; with password &amp;quot;123password&amp;quot; for illustration purposes&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;accounts&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;account name=&amp;quot;BennyLava&amp;quot; password=&amp;quot;123password&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/accounts&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save and close the file&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file 'mods/deathmatch/'acl.xml'''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the account to the ''Admin'' group by using the XML-syntax below&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ACL&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;Admin&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;object name=&amp;quot;user.BennyLava&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/group&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/ACL&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can actually add your user to any group you want. Each group is linked to an ACL ([[Access Control List]]). Each ACL contains a series of specific allowed or denied rights. These groups exist so different users can be assigned different rights. The ''Admin'' group points to the ''Admin'' ACL, which is empty (thus allowing all possible commands). The ''Everyone'' group points to the ''Default'' ACL that puts a series of restrictions on the available commands (to disallow regular players from using admin commands).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You're done! You can add as many administrators or users as you want this way, take a look at some of the other groups and ACLs for example. The ACL is also accessible through the [[Access_Control_List|Lua scripting engine]].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to take a look at the web interface, we will explain how to do this below.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
'''Note''': There are also ways to add accounts and edit rights for the server while it's running. &amp;quot;addaccount &amp;lt;user&amp;gt; &amp;lt;password&amp;gt;&amp;quot; is an internal command to add accounts, but you will have to use the web interface to add these accounts to specific groups/ACLs!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the web interface===&lt;br /&gt;
The dedicated server comes with a few Lua [[resources]] that provide a nice little web interface to your server. This can be used to easily maintain your server, as it allows you to add users, start/stop resources, and more.&lt;br /&gt;
&lt;br /&gt;
The web interface resources are enabled by default and are served through the built-in HTTP web server. To make sure the built-in HTTP web server runs on a port you like (22005 by default), follow these steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure your server is stopped&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file '''mods/deathmatch/mtaserver.conf''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Verify that the HTTP server is enabled:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Change the HTTP server port to your liking:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save and close the configuration file&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start your server&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you happened to have changed the start-up resources in your configuration file, make sure the following resources are started:&lt;br /&gt;
&lt;br /&gt;
# resourcebrowser&lt;br /&gt;
# resourcemanager&lt;br /&gt;
# webadmin&lt;br /&gt;
# webmap&lt;br /&gt;
&lt;br /&gt;
These are automatically started in the default configuration file, in case you just installed your server.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a web browser (Internet Explorer 6 or 7 are NOT supported: use [http://www.mozilla.com/firefox Mozilla Firefox], [http://www.google.com/chrome Google Chrome], [http://www.apple.com/safari/download Apple Safari], [http://www.opera.com Opera] or others) and navigate to the HTTP server URL: '''http://server:port/'''. For example, If you are running a local server on HTTP port 22005, use '''http://127.0.0.1:22005/'''.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter the username and password of the administrator you added in the previous section.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
You should now be able to maintain your server from the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Configuring an external web server ===&lt;br /&gt;
The built-in web server is also used to serve files that are required by resources running on your server to any player that is connected to your server. For example, if you are running a game script with a scripted graphical user interface, or custom models, these need to be transferred to every connected player in order to function properly. This is done by either the built-in web server, or an external web server (that is usually a bit faster) but needs to be set up separately.&lt;br /&gt;
&lt;br /&gt;
For performance or consistency reasons during the game, you could choose to make use of such an external web server if you have one set up. The external web server needs to be accessible for the public, so any client will be able to download the necessary client-side files in order to join and play on your server.&lt;br /&gt;
&lt;br /&gt;
To enable downloading off an external web server, you should configure the ''httpdownload'' and ''httpdownloadurl'' tags in your server configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;httpdownload&amp;gt;1&amp;lt;/httpdownload&amp;gt;	&lt;br /&gt;
&amp;lt;httpdownloadurl&amp;gt;http://www.myserver.tld/directory/here&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since all the default resources provided with the dedicated server are zipped, and are normally automatically extracted by the built-in web server, you now have to provide a way for the clients to download the unextracted files to their computers. The unextracted files are always available in the '''&amp;lt;SERVER&amp;gt;/mods/deathmatch/resourcecache''' directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Launch the dedicated server once and exit again. This will extract the zip files into the '''&amp;lt;SERVER&amp;gt;/mods/deathmatch/resourcecache''' directory.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Go into the directory above and copy the resources to your external web server's public directory, this can be done in several ways:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you don't care about your '''server-side files being publically available''': create a symbolic link (Linux), a junction (Windows) or just plain copy the contents of the '''resourcecache''' directory to your public web server directory.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you don't want your server files to be publically available through your web server: go into the '''resourcecache''' directory and manually copy the folders over to your public web server directory, removing any server-side files (they are '''not''' necessary for the client-side downloading) you do not want to be hosting on your web server.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick way of securing your server-side files is currently not available. We will investigate into developing a tool that automatically copies only the necessary client-side files for all resources on your server.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note 1''': Please try to avoid any special characters (e.g. ~, !) in your download URLs.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note 2''': Please do not use a trailing slash in your download URL (e.g. ''hxxp://www.myserver.tld/directory'' rather than ''hxxp://www.myserver.tld/directory/'')&lt;br /&gt;
&lt;br /&gt;
==Starting your server==&lt;br /&gt;
Begin by making sure that you have finished all configuration of your server, starting your server is the last stage so everything must be ready!&lt;br /&gt;
&lt;br /&gt;
To start your server double click on MTA Server.exe, make sure you allow it through any firewalls and forward ports where nessessary.&lt;br /&gt;
&lt;br /&gt;
==Installing/Updating resources on your server==&lt;br /&gt;
Resources can come in two formats, either a ZIP format or just a normal folder with the script files inside it. The MTA:SA DM server supports both these methods.&lt;br /&gt;
&lt;br /&gt;
# Move or copy the new resource to your &amp;lt;SERVER&amp;gt;\mods\deathmatch\resources folder.&lt;br /&gt;
# In the server window type in the command &amp;quot;refresh&amp;quot; (without the quotes), this will re-scan the resources folder and update the live resources where necessary.&lt;br /&gt;
&lt;br /&gt;
==Uninstalling resources==&lt;br /&gt;
Resources can easily be removed from your server if you no longer want them.&lt;br /&gt;
&lt;br /&gt;
# Delete the ZIP file or the folder of the resource you wish to uninstall&lt;br /&gt;
# In the server window type in the command &amp;quot;refresh&amp;quot; (without the quotes), this will re-scan the resources folder and update the live resources where necessary.&lt;br /&gt;
&lt;br /&gt;
==Administrating your server==&lt;br /&gt;
You can start resources by typing the command &amp;quot;start resourcename&amp;quot; in the server console, or stop ones with &amp;quot;stop resourcename&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
It's also possible to execute these and other admin commands from the ingame console (which you can bring up with the ` key or F8); for this to work, you first need to log in with the command &amp;quot;login username password&amp;quot;. Additionally, you can press the p key to bring up the admin panel: this is a graphical interface which allows you to easily kick or ban misbehaving players, among others.&lt;br /&gt;
&lt;br /&gt;
For further commands, type &amp;quot;help&amp;quot; in a console.&lt;br /&gt;
&lt;br /&gt;
==Starting a map/gamemode==&lt;br /&gt;
See the commands section of the documentation for [[Resource:Map manager|mapmanager]] for more information.&lt;br /&gt;
&lt;br /&gt;
==Useful Notes==&lt;br /&gt;
&lt;br /&gt;
# You may also update the resources while ingame as long as you have the correct access levels by typing &amp;quot;refresh&amp;quot; in the clients console or &amp;quot;/refresh&amp;quot; in the chat window. This may cause a second of lag if you have many resources.&lt;br /&gt;
# In the above instructions, &amp;lt;SERVER&amp;gt; is the path to your server's main directory. In most cases this is C:\Program Files\MTA San Andreas\server&lt;br /&gt;
# You can choose a different config file for the server to use by passing it in the command line after a --config argument, e.g. mtaserver.exe --config anotherconfig.cfg.&lt;br /&gt;
# Do not be alarmed by the warning regarding the parsing of the settings.xml file. This happens because your server installation is still clean and unused.&lt;br /&gt;
&lt;br /&gt;
====Need further help?====&lt;br /&gt;
Why not pop over to our [http://forum.mtasa.com/ Forums] or join us on [irc://irc.multitheftauto.com/mta IRC] (irc.multitheftauto.com #mta - [http://www.mirc.com MIRC])&lt;br /&gt;
&lt;br /&gt;
[[de:MTA DM Server Anleitung]]&lt;br /&gt;
[[it:Manuale del Server]]&lt;br /&gt;
[[nl:Deathmatch Server Manual]]&lt;br /&gt;
[[ru:Deathmatch Server Manual]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_Manual&amp;diff=20958</id>
		<title>Server Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_Manual&amp;diff=20958"/>
		<updated>2009-08-03T11:54:23Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
It is much easier than it looks to get a server up and running for your internet or LAN buddies: follow this wiki article and you will hopefully be on your way to hosting your own MTA:SA DM Server in no time!&lt;br /&gt;
&lt;br /&gt;
==Installing the server==&lt;br /&gt;
The dedicated server application is available in different flavours depending on the platform of the server.&lt;br /&gt;
&lt;br /&gt;
==Linux installation==&lt;br /&gt;
===Ubuntu===&lt;br /&gt;
I installed the server on ubuntu 6.05 LTS. I will add installation instructions for other linux distros at a later time.&lt;br /&gt;
This install was done on a fresh os install so a few things have to be installed first.&lt;br /&gt;
First of all ssh into your server using whatever client you like. I prefer putty.&lt;br /&gt;
Start by typing   '''sudo apt-get upgrade''' It will prompt you to put your password in again. After the upgrade is done running type&lt;br /&gt;
'''sudo apt-get install pico''' this will install the easy to use pico text editor that you will use to edit the config files.&lt;br /&gt;
After the install is done running you need to get a copy of libcurl3 for the server to run so type '''sudo apt-get install libcurl3'''&lt;br /&gt;
Once again it will ask you for your password. Once this is done now we have to get the server program onto your Linux server. There are a few methods for doing this. you can install a ftp server. you can use putty file transfer. If you know someone with a website you can ask them to put the file on their website then use '''wget http://wwww.websitename.com/file.tar''' Obviously where website name is change to your friends website. Either way once you have the tar file on your server you need to unpack it you do this by using the command '''tar -zxvf filename.tar'''&lt;br /&gt;
===Gentoo===&lt;br /&gt;
I assume that if people are using Gentoo, they know enough of an operating system to get files from the web to their server theirselves... (otherwise, look above and read the ubuntu part)&lt;br /&gt;
&lt;br /&gt;
These versions I needed for DP2:&lt;br /&gt;
&lt;br /&gt;
Update your gcc version to 4.2.2:&lt;br /&gt;
* unmask gcc in /etc/portage/package.unmask)&lt;br /&gt;
* emerge gcc&lt;br /&gt;
* switch to gcc 4.2.2: gcc-config i686-pc-linux-gnu-4.2.2&lt;br /&gt;
Update your libstdc++ version to 3.3 if you haven't got that version&lt;br /&gt;
* emerge libstdc++&lt;br /&gt;
Install libcurl:&lt;br /&gt;
* emerge libcurl&lt;br /&gt;
Unpack mtasa, and run it...&lt;br /&gt;
&lt;br /&gt;
==Windows installation==&lt;br /&gt;
Installation of the MTA:SA DM server on Windows is easy as pie.&lt;br /&gt;
*Go to the [http://mtasa.com/deathmatch.html download page] and scroll down to the &amp;quot;Dedicated servers&amp;quot; section&lt;br /&gt;
*Click the Windows download link.&lt;br /&gt;
*Once the installer is downloaded, open it.&lt;br /&gt;
*Select a folder where you want to install the server.&lt;br /&gt;
*Click Install.&lt;br /&gt;
*Done!&lt;br /&gt;
&lt;br /&gt;
''For a full explanation of acl.xml (access control list) read: [[Access_Control_List|Access Control List]]''&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuring your server==&lt;br /&gt;
The Multi Theft Auto dedicated server is initially configurable through it's console window, from within the game, and from a webbrowser. In order to make use of the two last options, it is necessary to add at least one administrator user to your configuration file.&lt;br /&gt;
&lt;br /&gt;
===General configuration===&lt;br /&gt;
All general configuration options can be found in the 'mods/deathmatch/'''mtaserver.conf'''' file and can be opened by any regular text editor.&lt;br /&gt;
&lt;br /&gt;
This file is fairly straightforward; every variable has a description of what to do with it and how to change it.&lt;br /&gt;
&lt;br /&gt;
===Port forwarding===&lt;br /&gt;
If you run your server on your own private computer, and you have an router between the internet and your computer. You need to forward 3 ports.&lt;br /&gt;
&lt;br /&gt;
First of all open the file 'mods/deathmatch/'''mtaserver.conf'''' and search for the next lines:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverport&amp;gt;22004&amp;lt;/serverport&amp;gt; &lt;br /&gt;
&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ports are needed to setup the server right. We explain later how to set them, but first if you want your server to list in the server browser there is an other port we need, and that is the ase port. &lt;br /&gt;
(quick example for how to turn ase on or of):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt; &amp;lt;!-- 0 = off, 1 = on --&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we going to forward the ports in router, which is not needed if you already have all ports open, or if you don't have a router with a firewall. If so, skip this part.&lt;br /&gt;
&lt;br /&gt;
If you don't know how port forwarding works in your router, go to: http://portforward.com/, find your router there, and follow the instructions there.&lt;br /&gt;
&lt;br /&gt;
In almost every router you can set the port type: UDP or TCP. The following list will explain which port type is needed for what:&lt;br /&gt;
&lt;br /&gt;
Main server port: UDP&lt;br /&gt;
HTTP Port: TCP&lt;br /&gt;
ASE Port: UDP (this is needed if you want your server to appear in the server list)&lt;br /&gt;
&lt;br /&gt;
The ASE port is simply to get:&lt;br /&gt;
ASE port = Main Server port + 123&lt;br /&gt;
So, if you have the main server port set to 22003, then the ASE port will be 22126.&lt;br /&gt;
&lt;br /&gt;
Good luck!&lt;br /&gt;
&lt;br /&gt;
===Adding administrators===&lt;br /&gt;
It is strongly recommended to add at least one administrator to your server in order to make use of the built-in webserver to easily maintain and configure your server. This administrator will then also be able to log-in from within the game and control the server.&lt;br /&gt;
&lt;br /&gt;
To add an administrator to your server, follow these steps:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure your server is stopped; if your server is still running, all changes you make will be overwritten&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file 'mods/deathmatch/'accounts.xml'''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add a new account into the file by using the XML-syntax below, we use the username &amp;quot;BennyLava&amp;quot; with password &amp;quot;123password&amp;quot; for illustration purposes&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;accounts&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;account name=&amp;quot;BennyLava&amp;quot; password=&amp;quot;123password&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/accounts&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save and close the file&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file 'mods/deathmatch/'acl.xml'''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the account to the ''Admin'' group by using the XML-syntax below&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ACL&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;Admin&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;object name=&amp;quot;user.BennyLava&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/group&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/ACL&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can actually add your user to any group you want. Each group is linked to an ACL ([[Access Control List]]). Each ACL contains a series of specific allowed or denied rights. These groups exist so different users can be assigned different rights. The ''Admin'' group points to the ''Admin'' ACL, which is empty (thus allowing all possible commands). The ''Everyone'' group points to the ''Default'' ACL that puts a series of restrictions on the available commands (to disallow regular players from using admin commands).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You're done! You can add as many administrators or users as you want this way, take a look at some of the other groups and ACLs for example. The ACL is also accessible through the [[Access_Control_List|Lua scripting engine]].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to take a look at the web interface, we will explain how to do this below.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
'''Note''': There are also ways to add accounts and edit rights for the server while it's running. &amp;quot;addaccount &amp;lt;user&amp;gt; &amp;lt;password&amp;gt;&amp;quot; is an internal command to add accounts, but you will have to use the web interface to add these accounts to specific groups/ACLs!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the web interface===&lt;br /&gt;
The dedicated server comes with a few Lua [[resources]] that provide a nice little web interface to your server. This can be used to easily maintain your server, as it allows you to add users, start/stop resources, and more.&lt;br /&gt;
&lt;br /&gt;
The web interface resources are enabled by default and are served through the built-in HTTP web server. To make sure the built-in HTTP web server runs on a port you like (22005 by default), follow these steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure your server is stopped&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file '''mods/deathmatch/mtaserver.conf''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Verify that the HTTP server is enabled:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Change the HTTP server port to your liking:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save and close the configuration file&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start your server&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you happened to have changed the start-up resources in your configuration file, make sure the following resources are started:&lt;br /&gt;
&lt;br /&gt;
# resourcebrowser&lt;br /&gt;
# resourcemanager&lt;br /&gt;
# webadmin&lt;br /&gt;
# webmap&lt;br /&gt;
&lt;br /&gt;
These are automatically started in the default configuration file, in case you just installed your server.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a web browser (Internet Explorer 6 or 7 are NOT supported: use [http://www.mozilla.com/firefox Mozilla Firefox], [http://www.google.com/chrome Google Chrome], [http://www.apple.com/safari/download Apple Safari], [http://www.opera.com Opera] or others) and navigate to the HTTP server URL: '''http://server:port/'''. For example, If you are running a local server on HTTP port 22005, use '''http://127.0.0.1:22005/'''.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter the username and password of the administrator you added in the previous section.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
You should now be able to maintain your server from the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Configuring an external web server ===&lt;br /&gt;
The built-in web server is also used to serve files that are required by resources running on your server to any player that is connected to your server. For example, if you are running a game script with a scripted graphical user interface, or custom models, these need to be transferred to every connected player in order to function properly. This is done by either the built-in web server, or an external web server (that is usually a bit faster) but needs to be set up separately.&lt;br /&gt;
&lt;br /&gt;
For performance or consistency reasons during the game, you could choose to make use of such an external web server if you have one set up. The external web server needs to be accessible for the public, so any client will be able to download the necessary client-side files in order to join and play on your server.&lt;br /&gt;
&lt;br /&gt;
To enable downloading off an external web server, you should configure the ''httpdownload'' and ''httpdownloadurl'' tags in your server configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;httpdownload&amp;gt;1&amp;lt;/httpdownload&amp;gt;	&lt;br /&gt;
&amp;lt;httpdownloadurl&amp;gt;http://www.myserver.tld/directory/here&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since all the default resources provided with the dedicated server are zipped, and are normally automatically extracted by the built-in web server, you now have to provide a way for the clients to download the unextracted files to their computers. The unextracted files are always available in the '''&amp;lt;SERVER&amp;gt;/mods/deathmatch/resourcecache''' directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Launch the dedicated server once and exit again. This will extract the zip files into the '''&amp;lt;SERVER&amp;gt;/mods/deathmatch/resourcecache''' directory.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Go into the directory above and copy the resources to your external web server's public directory, this can be done in several ways:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you don't care about your '''server-side files being publically available''': create a symbolic link (Linux), a junction (Windows) or just plain copy the contents of the '''resourcecache''' directory to your public web server directory.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you don't want your server files to be publically available through your web server: go into the '''resourcecache''' directory and manually copy the folders over to your public web server directory, removing any server-side files (they are '''not''' necessary for the client-side downloading) you do not want to be hosting on your web server.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
A quick way of securing your server-side files is currently not available. We will investigate into developing a tool that automatically copies only the necessary client-side files for all resources on your server.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note 1''': Please try to avoid any special characters (e.g. ~, !) in your download URLs.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note 2''': Please do not use a trailing slash in your download URL (e.g. ''hxxp://www.myserver.tld/directory'' rather than ''hxxp://www.myserver.tld/directory/'')&lt;br /&gt;
&lt;br /&gt;
==Starting your server==&lt;br /&gt;
Begin by making sure that you have finished all configuration of your server, starting your server is the last stage so everything must be ready!&lt;br /&gt;
&lt;br /&gt;
To start your server double click on MTA Server.exe, make sure you allow it through any firewalls and forward ports where nessessary.&lt;br /&gt;
&lt;br /&gt;
==Installing/Updating resources on your server==&lt;br /&gt;
Resources can come in two formats, either a ZIP format or just a normal folder with the script files inside it. The MTA:SA DM server supports both these methods.&lt;br /&gt;
&lt;br /&gt;
# Move or copy the new resource to your &amp;lt;SERVER&amp;gt;\mods\deathmatch\resources folder.&lt;br /&gt;
# In the server window type in the command &amp;quot;refresh&amp;quot; (without the quotes), this will re-scan the resources folder and update the live resources where necessary.&lt;br /&gt;
&lt;br /&gt;
==Uninstalling resources==&lt;br /&gt;
Resources can easily be removed from your server if you no longer want them.&lt;br /&gt;
&lt;br /&gt;
# Delete the ZIP file or the folder of the resource you wish to uninstall&lt;br /&gt;
# In the server window type in the command &amp;quot;refresh&amp;quot; (without the quotes), this will re-scan the resources folder and update the live resources where necessary.&lt;br /&gt;
&lt;br /&gt;
==Administrating your server==&lt;br /&gt;
You can start resources by typing the command &amp;quot;start resourcename&amp;quot; in the server console, or stop ones with &amp;quot;stop resourcename&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
It's also possible to execute these and other admin commands from the ingame console (which you can bring up with the ` key or F8); for this to work, you first need to log in with the command &amp;quot;login username password&amp;quot;. Additionally, you can press the p key to bring up the admin panel: this is a graphical interface which allows you to easily kick or ban misbehaving players, among others.&lt;br /&gt;
&lt;br /&gt;
For further commands, type &amp;quot;help&amp;quot; in a console.&lt;br /&gt;
&lt;br /&gt;
==Starting a map/gamemode==&lt;br /&gt;
See the commands section of the documentation for [[Resource:Map manager|mapmanager]] for more information.&lt;br /&gt;
&lt;br /&gt;
==Useful Notes==&lt;br /&gt;
&lt;br /&gt;
# You may also update the resources while ingame as long as you have the correct access levels by typing &amp;quot;refresh&amp;quot; in the clients console or &amp;quot;/refresh&amp;quot; in the chat window. This may cause a second of lag if you have many resources.&lt;br /&gt;
# In the above instructions, &amp;lt;SERVER&amp;gt; is the path to your server's main directory. In most cases this is C:\Program Files\MTA San Andreas\server&lt;br /&gt;
# You can choose a different config file for the server to use by passing it in the command line after a --config argument, e.g. mtaserver.exe --config anotherconfig.cfg.&lt;br /&gt;
# Do not be alarmed by the warning regarding the parsing of the settings.xml file. This happens because your server installation is still clean and unused.&lt;br /&gt;
&lt;br /&gt;
====Need further help?====&lt;br /&gt;
Why not pop over to our [http://forum.mtasa.com/ Forums] or join us on [irc://irc.multitheftauto.com/mta IRC] (irc.multitheftauto.com #mta - [http://www.mirc.com MIRC])&lt;br /&gt;
&lt;br /&gt;
[[de:MTA DM Server Anleitung]]&lt;br /&gt;
[[it:Manuale del Server]]&lt;br /&gt;
[[nl:Deathmatch Server Manual]]&lt;br /&gt;
[[ru:Deathmatch Server Manual]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:DxFonts&amp;diff=20957</id>
		<title>Template:DxFonts</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:DxFonts&amp;diff=20957"/>
		<updated>2009-08-03T11:45:45Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;** '''&amp;quot;default&amp;quot;:'''  Tahoma&lt;br /&gt;
** '''&amp;quot;default-bold&amp;quot;:''' Tahoma Bold&lt;br /&gt;
** '''&amp;quot;clear&amp;quot;:''' Verdana&lt;br /&gt;
** '''&amp;quot;arial&amp;quot;:''' Arial&lt;br /&gt;
** '''&amp;quot;pricedown&amp;quot;:''' Pricedown (GTA's theme text)&lt;br /&gt;
&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
** '''&amp;quot;bankgothic&amp;quot;:''' Bank Gothic Medium&lt;br /&gt;
** '''&amp;quot;diploma&amp;quot;:''' Diploma Regular&lt;br /&gt;
** '''&amp;quot;beckett&amp;quot;:''' Beckett Regular&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Standard_GUI_Font_Names&amp;diff=20956</id>
		<title>Standard GUI Font Names</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Standard_GUI_Font_Names&amp;diff=20956"/>
		<updated>2009-08-03T11:43:32Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the available CEGUI fonts that are used in Multi Theft Auto and can be accessed with the GUI scripting functions [[guiGetFont]] and [[guiSetFont]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery heights=&amp;quot;48&amp;quot; widths=&amp;quot;236&amp;quot; perrow=&amp;quot;3&amp;quot; caption=&amp;quot;Available font properties and previews&amp;quot;&amp;gt;&lt;br /&gt;
Image:mta-font_default-normal.gif|&amp;lt;div style=&amp;quot;font-weight: bold&amp;quot;&amp;gt;default-normal&amp;lt;/div&amp;gt;Tahoma regular, 9px&lt;br /&gt;
Image:mta-font_default-small.gif|&amp;lt;div style=&amp;quot;font-weight: bold&amp;quot;&amp;gt;default-small&amp;lt;/div&amp;gt;Tahoma regular, 7px&lt;br /&gt;
Image:mta-font_default-bold-small.gif|&amp;lt;div style=&amp;quot;font-weight: bold&amp;quot;&amp;gt;default-bold-small&amp;lt;/div&amp;gt;Tahoma bold, 8px&lt;br /&gt;
Image:mta-font_clear-normal.gif|&amp;lt;div style=&amp;quot;font-weight: bold&amp;quot;&amp;gt;clear-normal&amp;lt;/div&amp;gt;Verdana regular, 9px&lt;br /&gt;
Image:mta-font_sa-header.gif|&amp;lt;div style=&amp;quot;font-weight: bold&amp;quot;&amp;gt;sa-header&amp;lt;/div&amp;gt;Diploma regular, 26px auto-scaled&lt;br /&gt;
Image:mta-font_sa-gothic.gif|&amp;lt;div style=&amp;quot;font-weight: bold&amp;quot;&amp;gt;sa-gothic&amp;lt;/div&amp;gt;Beckett regular, 47px auto-scaled&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[ru:GUI Fonts]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementHealth&amp;diff=20949</id>
		<title>GetElementHealth</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementHealth&amp;diff=20949"/>
		<updated>2009-08-02T19:16:38Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the current health for the specified [[element]]. This can be a [[player]], a [[ped]], or 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;
float getElementHealth ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The [[player]] or [[vehicle]] whose health you want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a float indicating the element's health, or ''false'' if invalid arguments were 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;Clientside example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the health of the player who enters the command 'showhealth', and their vehicle's health.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showLocalHealth()&lt;br /&gt;
	-- get the player's health and output it&lt;br /&gt;
	local playerHealth = getElementHealth ( getLocalPlayer() )&lt;br /&gt;
	outputChatBox ( &amp;quot;Your health: &amp;quot; .. playerHealth )&lt;br /&gt;
&lt;br /&gt;
	-- get the player's vehicle: if he is in one, output its health as well&lt;br /&gt;
	local playerVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )&lt;br /&gt;
	if playerVehicle then&lt;br /&gt;
		local vehicleHealth = getElementHealth ( playerVehicle )&lt;br /&gt;
		outputChatBox ( &amp;quot;Your vehicle's health: &amp;quot; .. vehicleHealth )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;showhealth&amp;quot;, showLocalHealth )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=20835</id>
		<title>SetElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=20835"/>
		<updated>2009-07-24T00:47:08Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Needs_Checking|Can an element only be visible to one element (and its children) at a time? If so, do we need clearElementVisibleTo? If not, surely we need to remove the root element before using this function?|[[User:EAi|EAi]]&lt;br /&gt;
}}&lt;br /&gt;
{{Needs_Checking| I tried to make a blip visible to 1 player but it doesn't work unless I use getRootElement() [[User:Norby89|Norby89]] 10:20, 3 August 2007 (CDT)&lt;br /&gt;
&lt;br /&gt;
I tried to hide a marker from 1 player but I have to make the marker especially visible to this player before (tested on DP2)&lt;br /&gt;
[[User:mvol|mvol]] 21:51, 20 January 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
This issue is reported as issue #3158. [[User:EAi|eAi]] 21:25, 20 January 2008 (CST)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function can change an [[element]]'s [[visibility]]. This does not work with all entities - [[vehicle]]s, [[player]]s and [[object]]s are exempt. This is because these objects are required for accurate sync (they're physical objects). This function is particularily useful for changing the visibility of markers, radar blips and radar areas.&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 setElementVisibleTo ( element theElement, element visibleTo, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you want to control the visibility of.&lt;br /&gt;
*'''visibleTo:''' The element you wish the element to be visible or invisible to. Any child elements that are players will also be able to see the element. See [[visibility]].&lt;br /&gt;
*'''visible:''' Whether you are making it visible or invisible to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element's visibility was changed successfully, ''false'' otherwise, for example if you are trying to change the visibility of a vehicle, player or object.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a marker and makes it only visibile to the player called 'someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromNick ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	-- First off make the marker invisible to the whole dimension&lt;br /&gt;
	setElementVisibleTo ( myMarker, getRootElement ( ), false )&lt;br /&gt;
	-- Then make the marker visible again, but only to someguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, someguy, true )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following example shows how to hide the marker on 'someguy' from 'anotherguy'&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromNick ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
local anotherguy = getPlayerFromNick ( &amp;quot;anotherguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	-- First off make the marker visible especially to 'anotherguy'&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, true )&lt;br /&gt;
	-- Then hide it&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, false )&lt;br /&gt;
end&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>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=20834</id>
		<title>SetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=20834"/>
		<updated>2009-07-24T00:40:35Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function stores [[element data]] under a certain key, attached to an element. Element data set using this is then synced with all clients or the server. As such you should avoid passing data that is not able to be synced into this function (i.e. xmlnodes, acls, aclgroups etc.) Server-created elements are able to be synced.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&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;
bool setElementData ( element theElement, string key, [bool synchronize], var value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;/section&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under.&lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the server and remote clients.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set succesfully, ''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;false&amp;quot;&amp;gt;&lt;br /&gt;
This example allows for a player to add a custom tag onto their nickname, and also revert it back to normal if they wish&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function addPlayerCustomTag ( thePlayer, command, newTag )&lt;br /&gt;
	--Let's make sure the newTag param has been entered...&lt;br /&gt;
	if ( newTag ) then&lt;br /&gt;
		--Grab their current playername for saving.&lt;br /&gt;
		local sPlayerNickname = getClientName ( thePlayer )&lt;br /&gt;
		--Create their new nickname with their tag&lt;br /&gt;
		local sNewPlayerNickname = newTag .. &amp;quot; &amp;quot; .. sPlayerNickname&lt;br /&gt;
		&lt;br /&gt;
		--Let's first load the element data, see if it's there already&lt;br /&gt;
		--The reason for this is that if a player were to do /addtag twice,&lt;br /&gt;
		--the tag would be prepended a second time&lt;br /&gt;
		local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
		if ( sOldNick == false ) then&lt;br /&gt;
			--Save their orignal nickname in their element data&lt;br /&gt;
			setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, sPlayerNickname )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Set their new nickname globally&lt;br /&gt;
		setClientName ( thePlayer, sNewPlayerNickname )&lt;br /&gt;
		&lt;br /&gt;
		--Tell them it's done&lt;br /&gt;
		outputChatBox ( &amp;quot;Your new nickname has been set, to put it back to its original state you can use /deltag&amp;quot;, thePlayer )&lt;br /&gt;
	else&lt;br /&gt;
		--The newTag param was not entered, give an error message&lt;br /&gt;
		outputChatBox ( &amp;quot;/addtag - Incorrect syntax, Correct: /addtag &amp;lt;newtag&amp;gt;&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;addtag&amp;quot;, addPlayerCustomTag )&lt;br /&gt;
&lt;br /&gt;
function removePlayerCustomTag ( thePlayer, command )&lt;br /&gt;
	--We first need to check that they have already used /addtag, let's do that now&lt;br /&gt;
	local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
	if ( sOldNick ) then&lt;br /&gt;
		--Great, they have a tag added, let's reset them&lt;br /&gt;
		&lt;br /&gt;
		--First we will want to reset the element data back to its default (that being false)&lt;br /&gt;
		setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, false )&lt;br /&gt;
		&lt;br /&gt;
		--Now set the client name back&lt;br /&gt;
		setClientName ( thePlayer, sOldNick )&lt;br /&gt;
		&lt;br /&gt;
		--Notify them&lt;br /&gt;
		outputChatBox ( &amp;quot;Your old nickname has been set&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;deltag&amp;quot;, removePlayerCustomTag )&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>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineReplaceCOL&amp;diff=18790</id>
		<title>EngineReplaceCOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineReplaceCOL&amp;diff=18790"/>
		<updated>2009-03-28T09:28:14Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&amp;lt;!-- Change this to &amp;quot;Client function&amp;quot; or &amp;quot;Server function&amp;quot; appropriately--&amp;gt;&lt;br /&gt;
&amp;lt;!-- Describe in plain english what this function does. Don't go into details, just give an overview --&amp;gt;&lt;br /&gt;
This function replaces the collision file of the given model id to the collision file passed. Use [[engineLoadCOL]] to load the collision file first.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool engineReplaceCOL ( col theCol, int modelID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''theCol:''' The collision file to replace with&lt;br /&gt;
*'''modelID:''' The model ID whose collision file you want to replace&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if the collision was successfully replaced, ''false'' or ''nil'' if the collision could not be replaced for a reason.&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;
Client-Side example for replacing object collision with custom one.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function ReplaceCollision ( )&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; Replacing Collision Data.&amp;quot; )&lt;br /&gt;
col = engineLoadCOL( &amp;quot;myColFile.col&amp;quot; )&lt;br /&gt;
engineReplaceCOL( col, 3356 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEvent ( &amp;quot;collisionReplace&amp;quot;, true )&lt;br /&gt;
addEventHandler ( &amp;quot;collisionReplace&amp;quot;, getRootElement(), ReplaceCollision )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Server-side example function for triggering the replace.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function ReplaceCols ( )&lt;br /&gt;
triggerClientEvent ( &amp;quot;collisionReplace&amp;quot;, getRootElement(), collisionReplace )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;replacecol&amp;quot;, ReplaceCols)&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;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{Engine_functions}}&lt;br /&gt;
&amp;lt;!-- [[Category:Needs_Example]] leave this until the example is completed. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RespawnVehicle&amp;diff=18789</id>
		<title>RespawnVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RespawnVehicle&amp;diff=18789"/>
		<updated>2009-03-28T09:26:53Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function respawns a vehicle according to its set respawn position, set by [[setVehicleRespawnPosition]].  To spawn to a specific location, [[spawnVehicle]] can be used..&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 respawnVehicle ( 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 respawn&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the vehicle respawned successfully, ''false'' if the passed argument does not exist or is not a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example makes an exploded vehicle re-spawn after 5 seconds!&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function respawnExplodedVehicle()&lt;br /&gt;
	setTimer(respawnVehicle, 5000, 1, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onVehicleExplode&amp;quot;, getRootElement(), respawnExplodedVehicle)&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>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsConsoleActive&amp;diff=18788</id>
		<title>IsConsoleActive</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsConsoleActive&amp;diff=18788"/>
		<updated>2009-03-28T09:25:09Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function returns whether the ingame console window is visible or not.&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 isConsoleActive ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the console is visible, ''false'' if not.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example does...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleactiveCommand(arg)&lt;br /&gt;
    local active = &amp;quot;not active.&amp;quot;&lt;br /&gt;
    if (isConsoleActive()) then active = &amp;quot;active.&amp;quot; end&lt;br /&gt;
    outputChatBox(&amp;quot;Your console is &amp;quot; .. active)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;consoleactive&amp;quot;, consoleactiveCommand)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsConsoleActive&amp;diff=18787</id>
		<title>IsConsoleActive</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsConsoleActive&amp;diff=18787"/>
		<updated>2009-03-28T09:24:26Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function returns whether the ingame console window is visible or not.&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 isConsoleActive ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the console is visible, ''false'' if not.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example does...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleactiveCommand(arg)&lt;br /&gt;
    local active = &amp;quot;not active.&amp;quot;&lt;br /&gt;
    if (isConsoleActive()) then active = &amp;quot;active.&amp;quot; end&lt;br /&gt;
    outputChatBox(&amp;quot;Your console is &amp;quot; .. active)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;consoleactive&amp;quot;, consoleactiveCommand)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsConsoleActive&amp;diff=18786</id>
		<title>IsConsoleActive</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsConsoleActive&amp;diff=18786"/>
		<updated>2009-03-28T09:24:14Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function returns whether the ingame console window is visible or not.&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 isConsoleActive ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the console is visible, ''false'' if not.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example does...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleactiveCommand(arg)&lt;br /&gt;
    local active = &amp;quot;not active.&amp;quot;&lt;br /&gt;
    if (isConsoleActive()) then active = &amp;quot;active.&amp;quot;)&lt;br /&gt;
    outputChatBox(&amp;quot;Your console is &amp;quot; .. active)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;consoleactive&amp;quot;, consoleactiveCommand)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Radio_Station_IDs&amp;diff=18719</id>
		<title>Template:Radio Station IDs</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Radio_Station_IDs&amp;diff=18719"/>
		<updated>2009-03-25T18:31:02Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;border:3px solid red;margin-bottom:3px;padding-left:5px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* 0: Radio off&lt;br /&gt;
* 1: Playback FM&lt;br /&gt;
* 2: K-Rose&lt;br /&gt;
* 3: K-DST&lt;br /&gt;
* 4: Bounce FM&lt;br /&gt;
* 5: SF-UR&lt;br /&gt;
* 6: Radio Los Santos&lt;br /&gt;
* 7: Radio X&lt;br /&gt;
* 8: CSR 103.9&lt;br /&gt;
* 9: K-Jah West&lt;br /&gt;
* 10: Master Sounds 98.3&lt;br /&gt;
* 11: WCTR&lt;br /&gt;
* 12: User Track Player&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerRadioSwitch&amp;diff=18718</id>
		<title>OnClientPlayerRadioSwitch</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerRadioSwitch&amp;diff=18718"/>
		<updated>2009-03-25T18:30:28Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}}&lt;br /&gt;
This event is triggered whenever a players radio station is changed&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int stationID&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''stationID''': An [[int]]eger representing the station the player switched to.&lt;br /&gt;
Station ID's:&lt;br /&gt;
{{SoundID}}&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the Radio station will not change.&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Todo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client player events===&lt;br /&gt;
{{Client_player_events}}&lt;br /&gt;
===Client Audio functions===&lt;br /&gt;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlNodeGetAttribute&amp;diff=18701</id>
		<title>XmlNodeGetAttribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlNodeGetAttribute&amp;diff=18701"/>
		<updated>2009-03-24T20:59:52Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to return an attribute of a node in a configuration file.&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 xmlNodeGetAttribute ( xmlnode node, string name )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''node:''' The node from which you wish to return the attribute&lt;br /&gt;
*'''name:''' The name of the attribute.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the attribute in string form.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Suppose we have a gametype where only one type of car is used, and this type should not depend on the map but rather be set in an external configuration file and be used in all maps. Here's an example where the configuration file is an XML document:&lt;br /&gt;
&lt;br /&gt;
settings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;car model=&amp;quot;528&amp;quot; posX=&amp;quot;123.4&amp;quot; posY=&amp;quot;456.7&amp;quot; posZ=&amp;quot;12.3&amp;quot; rot=&amp;quot;90.0&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lua code&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = getResourceConfig(&amp;quot;myVehicles.xml&amp;quot;)      -- load XML file and get its root element&lt;br /&gt;
local carmodel = xmlNodeGetAttribute(xml, &amp;quot;model&amp;quot;)    -- get attribute of root element&lt;br /&gt;
local carX = xmlNodeGetAttribute(xml, &amp;quot;posX&amp;quot;)&lt;br /&gt;
local carY = xmlNodeGetAttribute(xml, &amp;quot;posY&amp;quot;)&lt;br /&gt;
local carZ = xmlNodeGetAttribute(xml, &amp;quot;posZ&amp;quot;)&lt;br /&gt;
local carA = xmlNodeGetAttribute(xml, &amp;quot;rot&amp;quot;)&lt;br /&gt;
createVehicle(carmodel, carX, carY, carZ, 0.0, 0.0, carA)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;/div&gt;</summary>
		<author><name>1337MaVe</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ShowPlayerHudComponent&amp;diff=18628</id>
		<title>ShowPlayerHudComponent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ShowPlayerHudComponent&amp;diff=18628"/>
		<updated>2009-03-07T16:16:02Z</updated>

		<summary type="html">&lt;p&gt;1337MaVe: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will show or hide a part of the player's HUD. &lt;br /&gt;
&lt;br /&gt;
{{Needs Checking|component 'clock' does not hide the clock}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool showPlayerHudComponent ( player thePlayer, string component, bool show )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' description&lt;br /&gt;
*'''component:''' The component you wish to show or hide. Valid values are:&lt;br /&gt;
:*'''ammo:''' The display showing how much ammo the player has in their weapon&lt;br /&gt;
:*'''area_name:''' The text that appears containing the name of the area a player has entered&lt;br /&gt;
:*'''armour:''' The display showing the player's armor&lt;br /&gt;
:*'''breath:''' The display showing the player's breath&lt;br /&gt;
:*'''clock:''' The display showing the in-game time&lt;br /&gt;
:*'''health:''' The display showing the player's health&lt;br /&gt;
:*'''money:''' The display showing how much money the player has&lt;br /&gt;
:*'''radar:''' The bottom-left corner miniradar&lt;br /&gt;
:*'''vehicle_name:''' The text that appears containing the player's vehicle name when the player enters a vehicle&lt;br /&gt;
:*'''weapon:''' The display showing the player's weapon&lt;br /&gt;
*'''show:''' Specify if the component should be shown (''true'') or hidden (''false'')&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 showPlayerHudComponent ( string component, bool show )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''component:''' The component you wish to show or hide. Valid values are:&lt;br /&gt;
:*'''ammo:''' The display showing how much ammo the player has in their weapon&lt;br /&gt;
:*'''area_name:''' The text that appears containing the name of the area a player has entered&lt;br /&gt;
:*'''armour:''' The display showing the player's armor&lt;br /&gt;
:*'''breath:''' The display showing the player's breath&lt;br /&gt;
:*'''clock:''' The display showing the in-game time&lt;br /&gt;
:*'''health:''' The display showing the player's health&lt;br /&gt;
:*'''money:''' The display showing how much money the player has&lt;br /&gt;
:*'''radar:''' The bottom-left corner miniradar&lt;br /&gt;
:*'''vehicle_name:''' The text that appears containing the player's vehicle name when the player enters a vehicle&lt;br /&gt;
:*'''weapon:''' The display showing the player's weapon&lt;br /&gt;
*'''show:''' Specify if the component should be shown (''true'') or hidden (''false'')&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the component was shown or hidden succesfully, ''false'' if an invalid argument was specified.&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 hides the ammo and weapon displays for players when they join.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function hudChanger ()&lt;br /&gt;
    showPlayerHudComponent ( source, &amp;quot;ammo&amp;quot;, false )    -- Hide the ammo displays for the newly joined player&lt;br /&gt;
    showPlayerHudComponent ( source, &amp;quot;weapon&amp;quot;, false )  -- Hide the weapon displays for the newly joined player&lt;br /&gt;
end&lt;br /&gt;
-- Make our hudChanger function called when the player joins&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), hudChanger )&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>1337MaVe</name></author>
	</entry>
</feed>