<?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=Haxardous</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=Haxardous"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Haxardous"/>
	<updated>2026-04-13T09:08:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Admin&amp;diff=79102</id>
		<title>Resource:Admin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Admin&amp;diff=79102"/>
		<updated>2024-04-20T23:03:27Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
A quick tutorial on how to get admin rights and install admin resource.&lt;br /&gt;
&lt;br /&gt;
To add an account in '''MTA {{padleft:|3|{{Current Version|full}}}}''' use the following command in the server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addaccount &amp;lt;username&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Server should not be running when you are editing the acl file below}}&lt;br /&gt;
&lt;br /&gt;
Then you open the '''acl.xml''' file located in the same folder and add yourself as an object to the Admin group by using the 'user.*' syntax, where * would be your account name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;    &amp;lt;!-- The Admin group can do anything --&amp;gt; &lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.lil_Toady&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now open your '''mtaserver.conf''' file and scroll to the bottom, make sure the admin resource is added to the ones that start with the server (note: protected=&amp;quot;1&amp;quot; means that it can not be stopped).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;conf&amp;quot;&amp;gt;    &amp;lt;resource src=&amp;quot;admin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&amp;gt;  &amp;lt;!-- This is --&amp;gt;&lt;br /&gt;
    &amp;lt;resource src=&amp;quot;helpmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;resource src=&amp;quot;mapcycler&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;resource src=&amp;quot;mapmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that you're done with server files, you can finally start it. Connect to the server itself and login with your account details: use 'login [username] &amp;lt;password&amp;gt;'. If it tells you to press 'p' you have done everything right, congratulations! If not, do this from the very beginning.&lt;br /&gt;
&lt;br /&gt;
==Resource commands==&lt;br /&gt;
Here are the commands from this resource. You need specific privileges to use most of them.&lt;br /&gt;
&lt;br /&gt;
====admin====&lt;br /&gt;
Opens/Closes admin panel GUI.&lt;br /&gt;
*'''Permission needed:''' general.adminpanel&lt;br /&gt;
*'''Syntax:''' admin&lt;br /&gt;
&lt;br /&gt;
====ban====&lt;br /&gt;
Bans the specified player and disconnects him from the server.&lt;br /&gt;
*'''Permission needed:''' command.ban&lt;br /&gt;
*'''Syntax:''' ban &amp;lt;playerName&amp;gt; &amp;lt;[reason]&amp;gt; &amp;lt;[period]&amp;gt; &amp;lt;[serial]&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to ban.&lt;br /&gt;
**reason: Optional. The reason to ban the player. This will be shown to everyone on chatbox and also to the banned player.&lt;br /&gt;
**period: Optional. The seconds to keep the player banned. After this period, the player will be automatically unbanned. If not specified, this is 0 by default and the player will be banned permanently.&lt;br /&gt;
**serial: Optional. This can be any value. If specified, the player will be banned by serial. Otherwise the player will be banned by IP.&lt;br /&gt;
&lt;br /&gt;
====blendweather====&lt;br /&gt;
Changes gradually the weather to the specified.&lt;br /&gt;
*'''Permission needed:''' command.blendweather&lt;br /&gt;
*'''Syntax:''' blendweather &amp;lt;weatherID&amp;gt;&lt;br /&gt;
**weatherID: The weather ID to gradually change to.&lt;br /&gt;
&lt;br /&gt;
====blowvehicle====&lt;br /&gt;
Blows up the specified player's vehicle, killing its occupants and causing damage to nearest players and vehicles.&lt;br /&gt;
*'''Permission needed:''' command.blowvehicle&lt;br /&gt;
*'''Syntax:''' blowvehicle &amp;lt;playerName&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to blow up the vehicle of.&lt;br /&gt;
&lt;br /&gt;
====createteam====&lt;br /&gt;
Creates a new team that shows on TAB Score Table.&lt;br /&gt;
*'''Permission needed:''' command.createteam&lt;br /&gt;
*'''Syntax:''' createteam &amp;lt;teamName&amp;gt; &amp;lt;[red]&amp;gt; &amp;lt;[green]&amp;gt; &amp;lt;[blue]&amp;gt;&lt;br /&gt;
**teamName: The name of the team you wish to create.&lt;br /&gt;
**red: Optional. An integer representing the red color value. If not specified, it is 255 by default.&lt;br /&gt;
**green: Optional. An integer representing the green color value. If not specified, it is 255 by default.&lt;br /&gt;
**blue: Optional. An integer representing the blue color value. If not specified, it is 255 by default.&lt;br /&gt;
&lt;br /&gt;
====destroyteam====&lt;br /&gt;
Deletes the specified team.&lt;br /&gt;
*'''Permission needed:''' command.destroyteam&lt;br /&gt;
*'''Syntax:''' destroyteam &amp;lt;teamName&amp;gt;&lt;br /&gt;
**teamName: The name of the team you wish to delete.&lt;br /&gt;
&lt;br /&gt;
====destroyvehicle====&lt;br /&gt;
Deletes the vehicle from the specified player. The player must be inside a vehicle.&lt;br /&gt;
*'''Permission needed:''' command.destroyvehicle&lt;br /&gt;
*'''Syntax:''' destroyvehicle &amp;lt;playerName&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to delete the vehicle of.&lt;br /&gt;
&lt;br /&gt;
====freeze====&lt;br /&gt;
Freezes/unfreezes the specified player. If the player is inside a vehicle, the vehicle is frozen instead of the player. Also, if the player or the player's vehicle is already frozen, this command will unfrozen it.&lt;br /&gt;
*'''Permission needed:''' command.freeze&lt;br /&gt;
*'''Syntax:''' freeze &amp;lt;playerName&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to freeze/unfreeze.&lt;br /&gt;
&lt;br /&gt;
====givevehicle====&lt;br /&gt;
Creates a vehicle with the specified ID at the player position and teleports the player into the driver' seat. If the player is already in a vehicle, this command will change the vehicle model instead.&lt;br /&gt;
*'''Permission needed:''' command.givevehicle&lt;br /&gt;
*'''Syntax:''' givevehicle &amp;lt;playerName&amp;gt; &amp;lt;vehicleID&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to give a vehicle.&lt;br /&gt;
**vehicleID: The model ID of the vehicle you wish to give to the player.&lt;br /&gt;
&lt;br /&gt;
====giveweapon====&lt;br /&gt;
Gives a weapon with the specified ID to the specified player. If the player already has the specified weapon, the ammo is increased by the amount specified.&lt;br /&gt;
*'''Permission needed:''' command.giveweapon&lt;br /&gt;
*'''Syntax:''' giveweapon &amp;lt;playerName&amp;gt; &amp;lt;weaponID&amp;gt; &amp;lt;[ammo]&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to give a weapon.&lt;br /&gt;
**vehicleID: The weapon ID of the weapon you wish to give to the player.&lt;br /&gt;
**ammo: Optional. The ammo you wish to give with the weapon. If not specified, it is 30 by default.&lt;br /&gt;
&lt;br /&gt;
====jetpack====&lt;br /&gt;
Gives/removes a jetpack to the specified player.&lt;br /&gt;
*'''Permission needed:''' command.jetpack&lt;br /&gt;
*'''Syntax:''' jetpack &amp;lt;playerName&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to give/remove a jetpack.&lt;br /&gt;
&lt;br /&gt;
====kick====&lt;br /&gt;
Kicks the specified player from the server.&lt;br /&gt;
*'''Permission needed:''' command.kick&lt;br /&gt;
*'''Syntax:''' kick &amp;lt;playerName&amp;gt; &amp;lt;[reason]&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to kick from the server.&lt;br /&gt;
**reason: Optional. The reason to kick the player. This will be shown to the kicked player after the kick.&lt;br /&gt;
&lt;br /&gt;
====mute====&lt;br /&gt;
Mutes the specified player by the specified period or until the player disconnects with the specified reason. If the player is already muted, this command will unmute the player.&lt;br /&gt;
*'''Permission needed:''' command.mute&lt;br /&gt;
*'''Syntax:''' mute &amp;lt;playerName&amp;gt; &amp;lt;[reason]&amp;gt; &amp;lt;[period]&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to mute.&lt;br /&gt;
**reason: Optional. The reason to mute the player. This will be shown to everyone on chatbox.&lt;br /&gt;
**period: Optional. The seconds the player will stay muted. After this period, the player will be automatically unmuted. If not specified, the player will be muted until disconnects or manually unmuted by someone.&lt;br /&gt;
&lt;br /&gt;
====register====&lt;br /&gt;
Adds a new account with the username and password.&lt;br /&gt;
*'''No permission needed.'''&lt;br /&gt;
*'''Syntax:''' register &amp;lt;[username]&amp;gt; &amp;lt;password&amp;gt;&lt;br /&gt;
**username: Optional. The name of the account you wish to add, if not specified, it is the player's name.&lt;br /&gt;
**password: This is the password used to access the account. Minimum length is 4 characters and maximum length is 30 characters.&lt;br /&gt;
&lt;br /&gt;
====setarmour====&lt;br /&gt;
Sets the specified player's armour health.&lt;br /&gt;
*'''Permission needed:''' command.setarmour&lt;br /&gt;
*'''Syntax:''' setarmour &amp;lt;playerName&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to set armour.&lt;br /&gt;
**value: The new armour's health. Accepts values from 0 to 100.&lt;br /&gt;
&lt;br /&gt;
====setcolor====&lt;br /&gt;
Sets the specified player's vehicle colors.&lt;br /&gt;
*'''Permission needed:''' command.setcolor&lt;br /&gt;
*'''Syntax:''' setcolor &amp;lt;playerName&amp;gt; &amp;lt;[color1]&amp;gt; &amp;lt;[color2]&amp;gt; &amp;lt;[color3]&amp;gt; &amp;lt;[color4]&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to set vehicle's colors. The player must be in a vehicle.&lt;br /&gt;
**color1: Optional. An hexadecimal code of the vehicle's color 1. If not specified, it is #000000 by default.&lt;br /&gt;
**color2: Optional. An hexadecimal code of the vehicle's color 2. If not specified, it is #000000 by default.&lt;br /&gt;
**color3: Optional. An hexadecimal code of the vehicle's color 3. If not specified, it is #000000 by default. ''Note: Only three GTA SA vehicles are using this color: Camper, Cement Truck, Squalo.''&lt;br /&gt;
**color4: Optional. An hexadecimal code of the vehicle's color 4. If not specified, it is #000000 by default. ''Note: Actually there's no vehicles on GTA SA using this color.''&lt;br /&gt;
{{warning|This command needs corrections. Nowadays, all colors are mandatory.}}&lt;br /&gt;
&lt;br /&gt;
====setdimension====&lt;br /&gt;
Sets the specified player's dimension.&lt;br /&gt;
*'''Permission needed:''' command.setdimension&lt;br /&gt;
*'''Syntax:''' setdimension &amp;lt;playerName&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to set dimension.&lt;br /&gt;
**value: The new dimension. Accepts values from 0 to 65535.&lt;br /&gt;
&lt;br /&gt;
====setgame====&lt;br /&gt;
Sets the server's game type. This will be visible in the server browser.&lt;br /&gt;
*'''Permission needed:''' command.setgame&lt;br /&gt;
*'''Syntax:''' setgame &amp;lt;gameType&amp;gt;&lt;br /&gt;
**gameType: The name of the game type.&lt;br /&gt;
&lt;br /&gt;
====setgamespeed====&lt;br /&gt;
Sets the server's game speed.&lt;br /&gt;
*'''Permission needed:''' command.setgamespeed&lt;br /&gt;
*'''Syntax:''' setgamespeed &amp;lt;gameSpeed&amp;gt;&lt;br /&gt;
**gameSpeed: The speed of the game. Normal speed is 1. Accepts values from 0 to 10. ''Note: Actually only values from 0.001 to 4 make difference.''&lt;br /&gt;
&lt;br /&gt;
====setgravity====&lt;br /&gt;
Sets the server's game gravity.&lt;br /&gt;
*'''Permission needed:''' command.setgravity&lt;br /&gt;
*'''Syntax:''' setgravity &amp;lt;gravity&amp;gt;&lt;br /&gt;
**gravity: The gravity of the game. Normal gravity is 0.008. ''Note: Higher gravity also increase fall damage.''&lt;br /&gt;
&lt;br /&gt;
====sethealth====&lt;br /&gt;
Sets the specified player's health.&lt;br /&gt;
*'''Permission needed:''' command.sethealth&lt;br /&gt;
*'''Syntax:''' sethealth &amp;lt;playerName&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to set health.&lt;br /&gt;
**value: The new health. Accepts values from 0 to 200. ''Note: To use health higher than 100, the player must set health stats. Otherwise maximum health is 100.''&lt;br /&gt;
&lt;br /&gt;
====setinterior====&lt;br /&gt;
Sets the specified player's interior. Only interiors from interiors.xml can be used.&lt;br /&gt;
*'''Permission needed:''' command.setinterior&lt;br /&gt;
*'''Syntax:''' setinterior &amp;lt;playerName&amp;gt; &amp;lt;interiorName&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to change interior.&lt;br /&gt;
**interiorName: The interior name. The names are at the &amp;quot;id&amp;quot; attribute. ''Note: Interior names are in capital letters.''&lt;br /&gt;
&lt;br /&gt;
====setmap====&lt;br /&gt;
Sets the server's map name. This will be visible in the server browser.&lt;br /&gt;
*'''Permission needed:''' command.setmap&lt;br /&gt;
*'''Syntax:''' setmap &amp;lt;mapName&amp;gt;&lt;br /&gt;
**mapName: The name of the map.&lt;br /&gt;
&lt;br /&gt;
====setpaintjob====&lt;br /&gt;
Sets the specified player's vehicle paintjob.&lt;br /&gt;
*'''Permission needed:''' command.setpaintjob&lt;br /&gt;
*'''Syntax:''' setpaintjob &amp;lt;playerName&amp;gt; &amp;lt;paintjobID&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to set vehicle's paintjob. The player must be in a vehicle.&lt;br /&gt;
**paintjobID: The paintjob ID. Accepts values from 0 to 3. Using 3 will remove the paintjob.&lt;br /&gt;
&lt;br /&gt;
====setpassword====&lt;br /&gt;
Sets the server's password. Players will need to provide the server password to join the server.&lt;br /&gt;
*'''Permission needed:''' command.setpassword&lt;br /&gt;
*'''Syntax:''' setpassword &amp;lt;password&amp;gt;&lt;br /&gt;
**password: The password of the server. If not specified, it will remove the password.&lt;br /&gt;
&lt;br /&gt;
====setskin====&lt;br /&gt;
Sets the specified player' skin.&lt;br /&gt;
*'''Permission needed:''' command.setskin&lt;br /&gt;
*'''Syntax:''' setskin &amp;lt;playerName&amp;gt; &amp;lt;skinID&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to change skin.&lt;br /&gt;
**skinID: The new skin ID. Accepts values from 0 to 312. ''Note: The following IDs are not working: 3 4 5 6 8 42 65 74 86 119 149 208 273 289.''&lt;br /&gt;
&lt;br /&gt;
====setstat====&lt;br /&gt;
Sets the specified player' stat.&lt;br /&gt;
*'''Permission needed:''' command.setstat&lt;br /&gt;
*'''Syntax:''' setstat &amp;lt;playerName&amp;gt; &amp;lt;statID&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to change the stat.&lt;br /&gt;
**statID: The stat ID. Accepts values from 0 to 230 (with exceptions). ''Note: See all stat IDs [[SetPedStat|here]].''&lt;br /&gt;
**value: The new value to the stat. Accepts values from 0 to 1000.&lt;br /&gt;
&lt;br /&gt;
====setteam====&lt;br /&gt;
Sets the specified player' team.&lt;br /&gt;
*'''Permission needed:''' command.setteam&lt;br /&gt;
*'''Syntax:''' setteam &amp;lt;playerName&amp;gt; &amp;lt;teamName&amp;gt;&lt;br /&gt;
**playerName: The name of the player you wish to set the team.&lt;br /&gt;
**teamName: The team name.&lt;br /&gt;
&lt;br /&gt;
====settime====&lt;br /&gt;
Sets the server time.&lt;br /&gt;
*'''Permission needed:''' command.settime&lt;br /&gt;
*'''Syntax:''' settime &amp;lt;hour&amp;gt; &amp;lt;minute&amp;gt;&lt;br /&gt;
**hour: The clock hour. Accepts 0-23.&lt;br /&gt;
**minute: The clock minute. Accepts 0-59.&lt;br /&gt;
&lt;br /&gt;
====setweather====&lt;br /&gt;
Sets the server weather.&lt;br /&gt;
*'''Permission needed:''' command.setweather&lt;br /&gt;
*'''Syntax:''' setweather &amp;lt;weatherID&amp;gt;&lt;br /&gt;
**weatherID: The weatherID. Accepts from 0 to 255. ''Note: Standard weathers are from 0 to 19. Other weathers are used for effects only.''&lt;br /&gt;
&lt;br /&gt;
====setwelcome====&lt;br /&gt;
Sets the server welcome message.&lt;br /&gt;
*'''Permission needed:''' command.setwelcome&lt;br /&gt;
*'''Syntax:''' setwelcome &amp;lt;message&amp;gt;&lt;br /&gt;
**message: The welcome message. ''Note: You can't use spaces with this command because there's only one parameter.''&lt;br /&gt;
&lt;br /&gt;
====shout====&lt;br /&gt;
Sends a message at the specified player' screen. Useful for warn the player.&lt;br /&gt;
*'''Permission needed:''' command.shout&lt;br /&gt;
*'''Syntax:''' shout &amp;lt;playerName&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
**playerName: The name of the player who you wish to shout at.&lt;br /&gt;
**message: The shout message. ''Note: You can't use spaces with this command because there's only one parameter.''&lt;br /&gt;
&lt;br /&gt;
====slap====&lt;br /&gt;
Slaps the specified player with the specified damage. Useful for punish the player. The player is also pulled up.&lt;br /&gt;
*'''Permission needed:''' command.slap&lt;br /&gt;
*'''Syntax:''' slap &amp;lt;playerName&amp;gt; &amp;lt;damage&amp;gt;&lt;br /&gt;
**playerName: The name of the player who you wish to slap.&lt;br /&gt;
**damage: An integer representing the slap damage. If you use 0, the player will just be pulled up.&lt;br /&gt;
&lt;br /&gt;
====unregister====&lt;br /&gt;
Removes an account with the specified username. This will also delete the account data.&lt;br /&gt;
*'''Permission needed:''' function.removeAccount&lt;br /&gt;
*'''Syntax:''' unregister &amp;lt;username&amp;gt;&lt;br /&gt;
**username: The name of the account you wish to delete. The account can't be on other ACL Groups than &amp;quot;Everyone&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====repair====&lt;br /&gt;
Repairs the specified player's vehicle.&lt;br /&gt;
*'''Permission needed:''' command.repair&lt;br /&gt;
*'''Syntax:''' repair &amp;lt;playerName&amp;gt;&lt;br /&gt;
**playerName: The name of the player who you wish to repair the vehicle.&lt;br /&gt;
&lt;br /&gt;
[[hu:Resource:Admin]]&lt;br /&gt;
[[it:Resource:Admin]]&lt;br /&gt;
[[ru:Resource:Admin]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtLevel&amp;diff=78520</id>
		<title>SetVehicleDirtLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtLevel&amp;diff=78520"/>
		<updated>2023-11-02T21:36:25Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Disabled|This function doesn't work actually. See the bugtracker for updates and more information.}}&lt;br /&gt;
This function sets the dirt level on a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleDirtLevel ( vehicle theVehicle, int dirtLevel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle that you want to set the dirt level from&lt;br /&gt;
*'''dirtLevel:''' (0.0 = fully clean, 15.0 = maximum dirt visible.)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the dirt level was set on the vehicle, ''false'' if the dirt level was not set or if invalid arguments are specified.&lt;br /&gt;
&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Performancebrowser&amp;diff=74603</id>
		<title>Resource:Performancebrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Performancebrowser&amp;diff=74603"/>
		<updated>2022-05-13T18:20:24Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Category - Server info */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
A performance browser is used to monitor the performance of resources on the server. Specifically, it shows how much CPU time and memory each resource is consuming. It is helpful in finding out which resources are slow, and which ones are leaking memory.&lt;br /&gt;
&lt;br /&gt;
=Web access=&lt;br /&gt;
To allow access to the performance browser web interface, add an ACL which includes rights to ''''resource.performancebrowser.http'''' and ''''resource.ajax.http''''. The server default ACL now comes with a '''&amp;quot;DevGroup&amp;quot;''' and '''&amp;quot;DevACL&amp;quot;''' specifically for this purpose. If your servers ACL does not have them, here is the acl.xml extract:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;group name=&amp;quot;DevGroup&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;acl name=&amp;quot;DevACL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/group&amp;gt;&lt;br /&gt;
   &amp;lt;acl name=&amp;quot;DevACL&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;resource.performancebrowser.http&amp;quot; access=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/right&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;resource.ajax.http&amp;quot; access=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/right&amp;gt;&lt;br /&gt;
   &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then all you have to do is add users to the '''&amp;quot;DevGroup&amp;quot;''' and use this URL in a browser: '''&amp;lt;nowiki&amp;gt;http://SERVER_IP:HTTP_PORT/performancebrowser/&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
On localhost it would look something like this: '''&amp;lt;nowiki&amp;gt;http://localhost:22005/performancebrowser/&amp;lt;/nowiki&amp;gt;'''. So, turns out the '''default HTTP port is 22005.'''&lt;br /&gt;
&lt;br /&gt;
=In game access=&lt;br /&gt;
There is also an in-game version of the performance browser called ''''ipb'''' which is now part of the official server resources. If you don't have it, it can be found in the latest resources zip: http://mirror.mtasa.com/mtasa/resources/&lt;br /&gt;
&lt;br /&gt;
To access the IPB, log in to an account with access to admin permissions then use the command '''/ipb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Category - Event Packet usage=&lt;br /&gt;
Select '''Event Packet usage''' from the '''Category''' drop down to view details about [[triggerClientEvent]] and outgoing [[setElementData]] packet usage.&lt;br /&gt;
&lt;br /&gt;
=====The main columns are:=====&lt;br /&gt;
* '''Type'''        - How the packets are created. This can be one or more of:&lt;br /&gt;
** ''ElementData'' - Caused by server side [[setElementData]]&lt;br /&gt;
** ''ElementData(Relay)'' - Caused by client side [[setElementData]]&lt;br /&gt;
** ''Event '' - Caused by server side [[triggerClientEvent]]&lt;br /&gt;
* '''Name'''         - The name used in the script&lt;br /&gt;
* '''pkt/sec'''        - The number of messages per second generated.&lt;br /&gt;
=====The '5 sec' columns are:=====&lt;br /&gt;
* '''pkts'''       - The number of messages generated in the last 5 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Server info=&lt;br /&gt;
Select '''Server info''' from the '''Category''' drop-down to view summary info for the server.&lt;br /&gt;
&lt;br /&gt;
===Logic/Sync/Raknet/DB thread CPU %===&lt;br /&gt;
Shows the % of total available CPU used by various server threads:&lt;br /&gt;
* '''Logic thread''' - is the one that does the Lua scripts, etc.&lt;br /&gt;
* '''Sync thread''' - makes sure the sync looks nice and smooth, even when the logic thread is maxed out.&lt;br /&gt;
* '''Raknet thread''' - handles the sending and receiving network packets to/from the connected clients.&lt;br /&gt;
* '''DB thread''' - is for database stuff.&lt;br /&gt;
The total % available for MTA depends on the number of CPU cores available. If MTA has access to 4 CPU cores, then the max CPU available is 400%, (although each individual thread cannot go above 100%). If a '''Sys:''' amount is shown, this is an additional % used by the system (O/S) for doing its job.&lt;br /&gt;
*Example:&lt;br /&gt;
**Logic thread CPU: %30 (Sys:4%)&lt;br /&gt;
**Sync thread CPU: %20&lt;br /&gt;
**Raknet thread CPU: %42 (Sys:14%)&lt;br /&gt;
**DB thread CPU: %0&lt;br /&gt;
*Total CPU % consumed is 30+4 + 20 + 42+14 = 110%, and if that is on a 4 core machine, then divide by 4 to get overall usage. 110/4 = 27.5%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Category - Lua timings=&lt;br /&gt;
&lt;br /&gt;
Select '''Lua timings''' from the '''Category''' drop down to view timing information for each resource:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, there are three blocks of columns, each one representing a different sample period. In the picture below, block A represents samples taken in the last 5 seconds, block B represents samples taken in the last 60 seconds, and block C represents samples taken in the last 300 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time-abc.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns in each block are:&lt;br /&gt;
* '''name'''        - Name of the resource&lt;br /&gt;
* '''cpu'''         - Amount of CPU time taken (in percent)&lt;br /&gt;
* '''time'''        - Amount of CPU time taken (in seconds)&lt;br /&gt;
* '''calls'''       - The number of times the function was called&lt;br /&gt;
* '''avg'''         - The average time spent in the function&lt;br /&gt;
* '''max'''         - The maximum time spent in the function&lt;br /&gt;
&lt;br /&gt;
''Note: To keep the display as clear as possible, anything that has taken less than 0.01% of CPU time is not be displayed.''&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''d''' option to display the timings for specific events and functions in the resource. If a function name cannot be determined, it will display the @ sign followed by the file name and line number the function starts. You can then locate that function by looking in the source file.&lt;br /&gt;
&lt;br /&gt;
Use the '''5''', '''60''', '''300''' and '''3600''' options to select what sample periods to show. For example, the option string '''5,60,300,3600''' will show all 4 sample periods. (If no sample periods are chosen, the default of '''5,60,300''' is used.)&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time-d-admin.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use the '''Filter''' setting to view a smaller range of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lua memory=&lt;br /&gt;
&lt;br /&gt;
Select '''Lua memory''' from the '''Category''' drop down to view memory consumption of each Lua resource:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-mem.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns are:&lt;br /&gt;
* '''name'''        - Name of the resource&lt;br /&gt;
* '''change'''      - The change in memory use since the last refresh&lt;br /&gt;
* '''current'''     - The amount of memory the resource is using now&lt;br /&gt;
* '''max'''         - The most memory the resource has ever used&lt;br /&gt;
* '''XMLFiles'''    - The number of open XML files&lt;br /&gt;
* '''refs'''        - The number of callback functions&lt;br /&gt;
* '''Timers'''      - The number of active Timers&lt;br /&gt;
* '''Elements'''    - The number of Elements&lt;br /&gt;
* '''TextDisplays''' - The number of Text Displays&lt;br /&gt;
* '''TextItems'''   - The number of Text Items&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''a''' option to show more accurate memory usage. ''Note: This calls the Lua garbage collector before each refresh, which could slightly reduce server performance.''&lt;br /&gt;
&lt;br /&gt;
Use the '''Filter''' setting to view a smaller range of resources:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-mem-race.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lib memory=&lt;br /&gt;
&lt;br /&gt;
Select '''Lib memory''' from the '''Category''' drop down to view memory consumption of the appropriate library (.dll or .so)&amp;lt;br&amp;gt;&lt;br /&gt;
''Note: This information is only available if the library has been compiled with WITH_ALLOC_TRACKING set to 1''&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lib-mem.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns are:&lt;br /&gt;
* '''name'''        - Name of the library &lt;br /&gt;
* '''change'''      - The change in memory use since the last refresh&lt;br /&gt;
* '''current'''     - The amount of memory the library  is using now&lt;br /&gt;
* '''max'''         - The most memory the library  has ever used&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''i''' option to show more information:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lib-mem-i.png]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Resource:Performancebrowser]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Performancebrowser&amp;diff=74602</id>
		<title>Resource:Performancebrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Performancebrowser&amp;diff=74602"/>
		<updated>2022-05-13T18:19:19Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
A performance browser is used to monitor the performance of resources on the server. Specifically, it shows how much CPU time and memory each resource is consuming. It is helpful in finding out which resources are slow, and which ones are leaking memory.&lt;br /&gt;
&lt;br /&gt;
=Web access=&lt;br /&gt;
To allow access to the performance browser web interface, add an ACL which includes rights to ''''resource.performancebrowser.http'''' and ''''resource.ajax.http''''. The server default ACL now comes with a '''&amp;quot;DevGroup&amp;quot;''' and '''&amp;quot;DevACL&amp;quot;''' specifically for this purpose. If your servers ACL does not have them, here is the acl.xml extract:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;group name=&amp;quot;DevGroup&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;acl name=&amp;quot;DevACL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/group&amp;gt;&lt;br /&gt;
   &amp;lt;acl name=&amp;quot;DevACL&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;resource.performancebrowser.http&amp;quot; access=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/right&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;resource.ajax.http&amp;quot; access=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/right&amp;gt;&lt;br /&gt;
   &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then all you have to do is add users to the '''&amp;quot;DevGroup&amp;quot;''' and use this URL in a browser: '''&amp;lt;nowiki&amp;gt;http://SERVER_IP:HTTP_PORT/performancebrowser/&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
On localhost it would look something like this: '''&amp;lt;nowiki&amp;gt;http://localhost:22005/performancebrowser/&amp;lt;/nowiki&amp;gt;'''. So, turns out the '''default HTTP port is 22005.'''&lt;br /&gt;
&lt;br /&gt;
=In game access=&lt;br /&gt;
There is also an in-game version of the performance browser called ''''ipb'''' which is now part of the official server resources. If you don't have it, it can be found in the latest resources zip: http://mirror.mtasa.com/mtasa/resources/&lt;br /&gt;
&lt;br /&gt;
To access the IPB, log in to an account with access to admin permissions then use the command '''/ipb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Category - Event Packet usage=&lt;br /&gt;
Select '''Event Packet usage''' from the '''Category''' drop down to view details about [[triggerClientEvent]] and outgoing [[setElementData]] packet usage.&lt;br /&gt;
&lt;br /&gt;
=====The main columns are:=====&lt;br /&gt;
* '''Type'''        - How the packets are created. This can be one or more of:&lt;br /&gt;
** ''ElementData'' - Caused by server side [[setElementData]]&lt;br /&gt;
** ''ElementData(Relay)'' - Caused by client side [[setElementData]]&lt;br /&gt;
** ''Event '' - Caused by server side [[triggerClientEvent]]&lt;br /&gt;
* '''Name'''         - The name used in the script&lt;br /&gt;
* '''pkt/sec'''        - The number of messages per second generated.&lt;br /&gt;
=====The '5 sec' columns are:=====&lt;br /&gt;
* '''pkts'''       - The number of messages generated in the last 5 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Server info=&lt;br /&gt;
Select '''Server info''' from the '''Category''' drop down to view summary info for the server.&lt;br /&gt;
&lt;br /&gt;
===Logic/Sync/Raknet/DB thread CPU %===&lt;br /&gt;
Shows the % of total available CPU used by various server threads:&lt;br /&gt;
* '''Logic thread''' - is the one that does the Lua scripts etc.&lt;br /&gt;
* '''Sync thread''' - makes sure the sync looks nice and smooth, even when the logic thread is maxed out.&lt;br /&gt;
* '''Raknet thread''' - handles the sending and receiving of networks packets to/from the connected clients.&lt;br /&gt;
* '''DB thread''' - is for database stuff.&lt;br /&gt;
The total % available for MTA depends on the number of CPU cores available. If MTA has access to 4 CPU cores, then the max CPU available in total is 400%, (although each individual thread cannot go above 100%). If a '''Sys:''' amount is shown, this is additional % used by the system (O/S) for doing it's job.&lt;br /&gt;
*Example:&lt;br /&gt;
**Logic thread CPU: %30 (Sys:4%)&lt;br /&gt;
**Sync thread CPU: %20&lt;br /&gt;
**Raknet thread CPU: %42 (Sys:14%)&lt;br /&gt;
**DB thread CPU: %0&lt;br /&gt;
*Total CPU % consumed is 30+4 + 20 + 42+14 = 110%, and if that is on a 4 core machine, then divide by 4 to get overall usage. 110/4 = 27.5%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lua timings=&lt;br /&gt;
&lt;br /&gt;
Select '''Lua timings''' from the '''Category''' drop down to view timing information for each resource:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, there are three blocks of columns, each one representing a different sample period. In the picture below, block A represents samples taken in the last 5 seconds, block B represents samples taken in the last 60 seconds, and block C represents samples taken in the last 300 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time-abc.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns in each block are:&lt;br /&gt;
* '''name'''        - Name of the resource&lt;br /&gt;
* '''cpu'''         - Amount of CPU time taken (in percent)&lt;br /&gt;
* '''time'''        - Amount of CPU time taken (in seconds)&lt;br /&gt;
* '''calls'''       - The number of times the function was called&lt;br /&gt;
* '''avg'''         - The average time spent in the function&lt;br /&gt;
* '''max'''         - The maximum time spent in the function&lt;br /&gt;
&lt;br /&gt;
''Note: To keep the display as clear as possible, anything that has taken less than 0.01% of CPU time is not be displayed.''&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''d''' option to display the timings for specific events and functions in the resource. If a function name cannot be determined, it will display the @ sign followed by the file name and line number the function starts. You can then locate that function by looking in the source file.&lt;br /&gt;
&lt;br /&gt;
Use the '''5''', '''60''', '''300''' and '''3600''' options to select what sample periods to show. For example, the option string '''5,60,300,3600''' will show all 4 sample periods. (If no sample periods are chosen, the default of '''5,60,300''' is used.)&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time-d-admin.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use the '''Filter''' setting to view a smaller range of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lua memory=&lt;br /&gt;
&lt;br /&gt;
Select '''Lua memory''' from the '''Category''' drop down to view memory consumption of each Lua resource:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-mem.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns are:&lt;br /&gt;
* '''name'''        - Name of the resource&lt;br /&gt;
* '''change'''      - The change in memory use since the last refresh&lt;br /&gt;
* '''current'''     - The amount of memory the resource is using now&lt;br /&gt;
* '''max'''         - The most memory the resource has ever used&lt;br /&gt;
* '''XMLFiles'''    - The number of open XML files&lt;br /&gt;
* '''refs'''        - The number of callback functions&lt;br /&gt;
* '''Timers'''      - The number of active Timers&lt;br /&gt;
* '''Elements'''    - The number of Elements&lt;br /&gt;
* '''TextDisplays''' - The number of Text Displays&lt;br /&gt;
* '''TextItems'''   - The number of Text Items&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''a''' option to show more accurate memory usage. ''Note: This calls the Lua garbage collector before each refresh, which could slightly reduce server performance.''&lt;br /&gt;
&lt;br /&gt;
Use the '''Filter''' setting to view a smaller range of resources:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-mem-race.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lib memory=&lt;br /&gt;
&lt;br /&gt;
Select '''Lib memory''' from the '''Category''' drop down to view memory consumption of the appropriate library (.dll or .so)&amp;lt;br&amp;gt;&lt;br /&gt;
''Note: This information is only available if the library has been compiled with WITH_ALLOC_TRACKING set to 1''&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lib-mem.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns are:&lt;br /&gt;
* '''name'''        - Name of the library &lt;br /&gt;
* '''change'''      - The change in memory use since the last refresh&lt;br /&gt;
* '''current'''     - The amount of memory the library  is using now&lt;br /&gt;
* '''max'''         - The most memory the library  has ever used&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''i''' option to show more information:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lib-mem-i.png]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Resource:Performancebrowser]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Performancebrowser&amp;diff=74601</id>
		<title>Resource:Performancebrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Performancebrowser&amp;diff=74601"/>
		<updated>2022-05-13T18:18:38Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* In game access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
Performance browser is used to monitor the performance of resources on the server. Specifically, it shows how much CPU time and memory each resource is consuming. It is useful for finding out which resources are slow, and which ones are leaking memory.&lt;br /&gt;
&lt;br /&gt;
=Web access=&lt;br /&gt;
To allow access to the performance browser web interface, add an ACL which includes rights to ''''resource.performancebrowser.http'''' and ''''resource.ajax.http''''. The server default ACL now comes with a '''&amp;quot;DevGroup&amp;quot;''' and '''&amp;quot;DevACL&amp;quot;''' specifically for this purpose. If your servers ACL does not have them, here is the acl.xml extract:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;group name=&amp;quot;DevGroup&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;acl name=&amp;quot;DevACL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/group&amp;gt;&lt;br /&gt;
   &amp;lt;acl name=&amp;quot;DevACL&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;resource.performancebrowser.http&amp;quot; access=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/right&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;resource.ajax.http&amp;quot; access=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/right&amp;gt;&lt;br /&gt;
   &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then all you have to do is add users to the '''&amp;quot;DevGroup&amp;quot;''' and use this URL in a browser: '''&amp;lt;nowiki&amp;gt;http://SERVER_IP:HTTP_PORT/performancebrowser/&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
On localhost it would look something like this: '''&amp;lt;nowiki&amp;gt;http://localhost:22005/performancebrowser/&amp;lt;/nowiki&amp;gt;'''. So, turns out the '''default HTTP port is 22005.'''&lt;br /&gt;
&lt;br /&gt;
=In game access=&lt;br /&gt;
There is also an in-game version of the performance browser called ''''ipb'''' which is now part of the official server resources. If you don't have it, it can be found in the latest resources zip: http://mirror.mtasa.com/mtasa/resources/&lt;br /&gt;
&lt;br /&gt;
To access the IPB, log in to an account with access to admin permissions then use the command '''/ipb'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Category - Event Packet usage=&lt;br /&gt;
Select '''Event Packet usage''' from the '''Category''' drop down to view details about [[triggerClientEvent]] and outgoing [[setElementData]] packet usage.&lt;br /&gt;
&lt;br /&gt;
=====The main columns are:=====&lt;br /&gt;
* '''Type'''        - How the packets are created. This can be one or more of:&lt;br /&gt;
** ''ElementData'' - Caused by server side [[setElementData]]&lt;br /&gt;
** ''ElementData(Relay)'' - Caused by client side [[setElementData]]&lt;br /&gt;
** ''Event '' - Caused by server side [[triggerClientEvent]]&lt;br /&gt;
* '''Name'''         - The name used in the script&lt;br /&gt;
* '''pkt/sec'''        - The number of messages per second generated.&lt;br /&gt;
=====The '5 sec' columns are:=====&lt;br /&gt;
* '''pkts'''       - The number of messages generated in the last 5 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Server info=&lt;br /&gt;
Select '''Server info''' from the '''Category''' drop down to view summary info for the server.&lt;br /&gt;
&lt;br /&gt;
===Logic/Sync/Raknet/DB thread CPU %===&lt;br /&gt;
Shows the % of total available CPU used by various server threads:&lt;br /&gt;
* '''Logic thread''' - is the one that does the Lua scripts etc.&lt;br /&gt;
* '''Sync thread''' - makes sure the sync looks nice and smooth, even when the logic thread is maxed out.&lt;br /&gt;
* '''Raknet thread''' - handles the sending and receiving of networks packets to/from the connected clients.&lt;br /&gt;
* '''DB thread''' - is for database stuff.&lt;br /&gt;
The total % available for MTA depends on the number of CPU cores available. If MTA has access to 4 CPU cores, then the max CPU available in total is 400%, (although each individual thread cannot go above 100%). If a '''Sys:''' amount is shown, this is additional % used by the system (O/S) for doing it's job.&lt;br /&gt;
*Example:&lt;br /&gt;
**Logic thread CPU: %30 (Sys:4%)&lt;br /&gt;
**Sync thread CPU: %20&lt;br /&gt;
**Raknet thread CPU: %42 (Sys:14%)&lt;br /&gt;
**DB thread CPU: %0&lt;br /&gt;
*Total CPU % consumed is 30+4 + 20 + 42+14 = 110%, and if that is on a 4 core machine, then divide by 4 to get overall usage. 110/4 = 27.5%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lua timings=&lt;br /&gt;
&lt;br /&gt;
Select '''Lua timings''' from the '''Category''' drop down to view timing information for each resource:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, there are three blocks of columns, each one representing a different sample period. In the picture below, block A represents samples taken in the last 5 seconds, block B represents samples taken in the last 60 seconds, and block C represents samples taken in the last 300 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time-abc.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns in each block are:&lt;br /&gt;
* '''name'''        - Name of the resource&lt;br /&gt;
* '''cpu'''         - Amount of CPU time taken (in percent)&lt;br /&gt;
* '''time'''        - Amount of CPU time taken (in seconds)&lt;br /&gt;
* '''calls'''       - The number of times the function was called&lt;br /&gt;
* '''avg'''         - The average time spent in the function&lt;br /&gt;
* '''max'''         - The maximum time spent in the function&lt;br /&gt;
&lt;br /&gt;
''Note: To keep the display as clear as possible, anything that has taken less than 0.01% of CPU time is not be displayed.''&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''d''' option to display the timings for specific events and functions in the resource. If a function name cannot be determined, it will display the @ sign followed by the file name and line number the function starts. You can then locate that function by looking in the source file.&lt;br /&gt;
&lt;br /&gt;
Use the '''5''', '''60''', '''300''' and '''3600''' options to select what sample periods to show. For example, the option string '''5,60,300,3600''' will show all 4 sample periods. (If no sample periods are chosen, the default of '''5,60,300''' is used.)&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-time-d-admin.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use the '''Filter''' setting to view a smaller range of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lua memory=&lt;br /&gt;
&lt;br /&gt;
Select '''Lua memory''' from the '''Category''' drop down to view memory consumption of each Lua resource:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-mem.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns are:&lt;br /&gt;
* '''name'''        - Name of the resource&lt;br /&gt;
* '''change'''      - The change in memory use since the last refresh&lt;br /&gt;
* '''current'''     - The amount of memory the resource is using now&lt;br /&gt;
* '''max'''         - The most memory the resource has ever used&lt;br /&gt;
* '''XMLFiles'''    - The number of open XML files&lt;br /&gt;
* '''refs'''        - The number of callback functions&lt;br /&gt;
* '''Timers'''      - The number of active Timers&lt;br /&gt;
* '''Elements'''    - The number of Elements&lt;br /&gt;
* '''TextDisplays''' - The number of Text Displays&lt;br /&gt;
* '''TextItems'''   - The number of Text Items&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''a''' option to show more accurate memory usage. ''Note: This calls the Lua garbage collector before each refresh, which could slightly reduce server performance.''&lt;br /&gt;
&lt;br /&gt;
Use the '''Filter''' setting to view a smaller range of resources:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lua-mem-race.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;hr/&amp;gt;&lt;br /&gt;
=Category - Lib memory=&lt;br /&gt;
&lt;br /&gt;
Select '''Lib memory''' from the '''Category''' drop down to view memory consumption of the appropriate library (.dll or .so)&amp;lt;br&amp;gt;&lt;br /&gt;
''Note: This information is only available if the library has been compiled with WITH_ALLOC_TRACKING set to 1''&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lib-mem.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The columns are:&lt;br /&gt;
* '''name'''        - Name of the library &lt;br /&gt;
* '''change'''      - The change in memory use since the last refresh&lt;br /&gt;
* '''current'''     - The amount of memory the library  is using now&lt;br /&gt;
* '''max'''         - The most memory the library  has ever used&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
Use the '''i''' option to show more information:&lt;br /&gt;
&lt;br /&gt;
[[File:Perfbrow-lib-mem-i.png]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Resource:Performancebrowser]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69583</id>
		<title>Up-to-date</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69583"/>
		<updated>2021-03-05T14:16:49Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: updated services pack 1 (dead link)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have Multi Theft Auto:San Andreas issues you should always make sure that everything is up-to-date.&lt;br /&gt;
&lt;br /&gt;
== MTA:San Andreas ==&lt;br /&gt;
Multi Theft Auto itself should be up-to-date with the latest version either by updating in game or by downloading the latest version from the [http://www.mtasa.com Multi Theft Auto] website.&lt;br /&gt;
&lt;br /&gt;
== Drivers ==&lt;br /&gt;
It is always wise to install the latest drivers for your hardware, this improves stability and/or performance for both your hardware and software.&lt;br /&gt;
&lt;br /&gt;
=== Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA (Chrome9)&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Chipset ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Audio Drivers ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Creative&lt;br /&gt;
|https://support.creative.com/Products/Products.aspx?catid=1&lt;br /&gt;
|-&lt;br /&gt;
|Realtek&lt;br /&gt;
|https://www.realtek.com/downloads/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your manufacturer is not listed above, you should check the support website from the manufacturer that assembled your system or your motherboard manufacturer. (Common listed below)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|+ Motherboard Manufacturers&lt;br /&gt;
|-&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asrock&lt;br /&gt;
|https://www.asrock.com/support/download.asp&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Biostar&lt;br /&gt;
|https://www.biostar.com.tw/app/en/support/download.php&lt;br /&gt;
|-&lt;br /&gt;
|EVGA&lt;br /&gt;
|https://www.evga.com/support/download/default.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Gigabyte&lt;br /&gt;
|https://www.gigabyte.us/support-downloads/support-downloads.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|https://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|MSI&lt;br /&gt;
|https://msi.com/service/download/&lt;br /&gt;
|-&lt;br /&gt;
|Zotac&lt;br /&gt;
|https://www.zotac.com/index.php?option=com_docman&amp;amp;Itemid=100032&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
Make sure your system is up to date with Windows Update.&lt;br /&gt;
&lt;br /&gt;
== Additional Software ==&lt;br /&gt;
Additional software required for Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 32bits] [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=15336 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 SP1 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=5582&amp;amp;WT 32bits] [https://www.microsoft.com/en-us/download/details.aspx?id=26368 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|DirectX 9.0c Web Installer/Updater&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=35 32bits/64bits]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Known Issues - FAQ]]&lt;br /&gt;
* [[IRC Channel]]&lt;br /&gt;
* [http://bugs.mtasa.com Multi Theft Auto Bugtracker]&lt;br /&gt;
&lt;br /&gt;
[[ru:Up-to-date]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69582</id>
		<title>Up-to-date</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69582"/>
		<updated>2021-03-05T14:14:46Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Audio Drivers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have Multi Theft Auto:San Andreas issues you should always make sure that everything is up-to-date.&lt;br /&gt;
&lt;br /&gt;
== MTA:San Andreas ==&lt;br /&gt;
Multi Theft Auto itself should be up-to-date with the latest version either by updating in game or by downloading the latest version from the [http://www.mtasa.com Multi Theft Auto] website.&lt;br /&gt;
&lt;br /&gt;
== Drivers ==&lt;br /&gt;
It is always wise to install the latest drivers for your hardware, this improves stability and/or performance for both your hardware and software.&lt;br /&gt;
&lt;br /&gt;
=== Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA (Chrome9)&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Chipset ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Audio Drivers ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Creative&lt;br /&gt;
|https://support.creative.com/Products/Products.aspx?catid=1&lt;br /&gt;
|-&lt;br /&gt;
|Realtek&lt;br /&gt;
|https://www.realtek.com/downloads/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your manufacturer is not listed above, you should check the support website from the manufacturer that assembled your system or your motherboard manufacturer. (Common listed below)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|+ Motherboard Manufacturers&lt;br /&gt;
|-&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asrock&lt;br /&gt;
|https://www.asrock.com/support/download.asp&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Biostar&lt;br /&gt;
|https://www.biostar.com.tw/app/en/support/download.php&lt;br /&gt;
|-&lt;br /&gt;
|EVGA&lt;br /&gt;
|https://www.evga.com/support/download/default.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Gigabyte&lt;br /&gt;
|https://www.gigabyte.us/support-downloads/support-downloads.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|https://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|MSI&lt;br /&gt;
|https://msi.com/service/download/&lt;br /&gt;
|-&lt;br /&gt;
|Zotac&lt;br /&gt;
|https://www.zotac.com/index.php?option=com_docman&amp;amp;Itemid=100032&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
Make sure your system is up to date with Windows Update.&lt;br /&gt;
&lt;br /&gt;
== Additional Software ==&lt;br /&gt;
Additional software required for Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 32bits] [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=15336 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 SP1 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=5582&amp;amp;WT 32bits] [http://www.microsoft.com/download/en/details.aspx?id=2092 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|DirectX 9.0c Web Installer/Updater&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=35 32bits/64bits]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Known Issues - FAQ]]&lt;br /&gt;
* [[IRC Channel]]&lt;br /&gt;
* [http://bugs.mtasa.com Multi Theft Auto Bugtracker]&lt;br /&gt;
&lt;br /&gt;
[[ru:Up-to-date]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69581</id>
		<title>Up-to-date</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69581"/>
		<updated>2021-03-05T14:12:41Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Audio Drivers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have Multi Theft Auto:San Andreas issues you should always make sure that everything is up-to-date.&lt;br /&gt;
&lt;br /&gt;
== MTA:San Andreas ==&lt;br /&gt;
Multi Theft Auto itself should be up-to-date with the latest version either by updating in game or by downloading the latest version from the [http://www.mtasa.com Multi Theft Auto] website.&lt;br /&gt;
&lt;br /&gt;
== Drivers ==&lt;br /&gt;
It is always wise to install the latest drivers for your hardware, this improves stability and/or performance for both your hardware and software.&lt;br /&gt;
&lt;br /&gt;
=== Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA (Chrome9)&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Chipset ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Audio Drivers ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Creative&lt;br /&gt;
|http://support.creative.com/Products/Products.aspx?catid=1&lt;br /&gt;
|-&lt;br /&gt;
|Realtek&lt;br /&gt;
|http://www.realtek.com/downloads/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your manufacturer is not listed above, you should check the support website from the manufacturer that assembled your system or your motherboard manufacturer. (Common listed below)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|+ Motherboard Manufacturers&lt;br /&gt;
|-&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asrock&lt;br /&gt;
|http://www.asrock.com/support/download.asp&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Biostar&lt;br /&gt;
|http://www.biostar.com.tw/app/en/support/download.php&lt;br /&gt;
|-&lt;br /&gt;
|EVGA&lt;br /&gt;
|http://www.evga.com/support/download/default.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Gigabyte&lt;br /&gt;
|http://www.gigabyte.us/support-downloads/support-downloads.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|MSI&lt;br /&gt;
|http://msi.com/service/download/&lt;br /&gt;
|-&lt;br /&gt;
|Zotac&lt;br /&gt;
|http://www.zotac.com/index.php?option=com_docman&amp;amp;Itemid=100032&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
Make sure your system is up to date with Windows Update.&lt;br /&gt;
&lt;br /&gt;
== Additional Software ==&lt;br /&gt;
Additional software required for Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 32bits] [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=15336 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 SP1 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=5582&amp;amp;WT 32bits] [http://www.microsoft.com/download/en/details.aspx?id=2092 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|DirectX 9.0c Web Installer/Updater&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=35 32bits/64bits]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Known Issues - FAQ]]&lt;br /&gt;
* [[IRC Channel]]&lt;br /&gt;
* [http://bugs.mtasa.com Multi Theft Auto Bugtracker]&lt;br /&gt;
&lt;br /&gt;
[[ru:Up-to-date]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69580</id>
		<title>Up-to-date</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Up-to-date&amp;diff=69580"/>
		<updated>2021-03-05T14:12:03Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Audio Drivers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have Multi Theft Auto:San Andreas issues you should always make sure that everything is up-to-date.&lt;br /&gt;
&lt;br /&gt;
== MTA:San Andreas ==&lt;br /&gt;
Multi Theft Auto itself should be up-to-date with the latest version either by updating in game or by downloading the latest version from the [http://www.mtasa.com Multi Theft Auto] website.&lt;br /&gt;
&lt;br /&gt;
== Drivers ==&lt;br /&gt;
It is always wise to install the latest drivers for your hardware, this improves stability and/or performance for both your hardware and software.&lt;br /&gt;
&lt;br /&gt;
=== Graphics Drivers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA (Chrome9)&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Chipset ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|AMD / ATI&lt;br /&gt;
|http://support.amd.com/us/Pages/AMDSupportHub.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|nVidia&lt;br /&gt;
|http://www.nvidia.co.uk/Download/index.aspx?lang=en-uk&lt;br /&gt;
|-&lt;br /&gt;
|VIA&lt;br /&gt;
|http://www.viaarena.com/Drivers.aspx&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Audio Drivers ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|https://www.asus.com/support/download-center&lt;br /&gt;
|-&lt;br /&gt;
|Creative&lt;br /&gt;
|http://support.creative.com/Products/Products.aspx?catid=1&lt;br /&gt;
|-&lt;br /&gt;
|Realtek&lt;br /&gt;
|http://www.realtek.com/downloads/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your manufacturer is not listed above, you should check the support website from the manufacturer that assembled your system or your motherboard manufacturer. (Common listed below)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|+ Motherboard Manufacturers&lt;br /&gt;
|-&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Asrock&lt;br /&gt;
|http://www.asrock.com/support/download.asp&lt;br /&gt;
|-&lt;br /&gt;
|Asus&lt;br /&gt;
|http://support.asus.com/ServiceHome.aspx?SLanguage=en&lt;br /&gt;
|-&lt;br /&gt;
|Biostar&lt;br /&gt;
|http://www.biostar.com.tw/app/en/support/download.php&lt;br /&gt;
|-&lt;br /&gt;
|EVGA&lt;br /&gt;
|http://www.evga.com/support/download/default.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Gigabyte&lt;br /&gt;
|http://www.gigabyte.us/support-downloads/support-downloads.aspx&lt;br /&gt;
|-&lt;br /&gt;
|Intel&lt;br /&gt;
|http://downloadcenter.intel.com/default.aspx?lang=eng&lt;br /&gt;
|-&lt;br /&gt;
|MSI&lt;br /&gt;
|http://msi.com/service/download/&lt;br /&gt;
|-&lt;br /&gt;
|Zotac&lt;br /&gt;
|http://www.zotac.com/index.php?option=com_docman&amp;amp;Itemid=100032&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operating System ==&lt;br /&gt;
Make sure your system is up to date with Windows Update.&lt;br /&gt;
&lt;br /&gt;
== Additional Software ==&lt;br /&gt;
Additional software required for Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 32bits] [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=15336 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|Microsoft Visual C++ 2008 SP1 Redistributable&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=5582&amp;amp;WT 32bits] [http://www.microsoft.com/download/en/details.aspx?id=2092 64bits]&lt;br /&gt;
|-&lt;br /&gt;
|DirectX 9.0c Web Installer/Updater&lt;br /&gt;
|[http://www.microsoft.com/download/en/details.aspx?id=35 32bits/64bits]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Known Issues - FAQ]]&lt;br /&gt;
* [[IRC Channel]]&lt;br /&gt;
* [http://bugs.mtasa.com Multi Theft Auto Bugtracker]&lt;br /&gt;
&lt;br /&gt;
[[ru:Up-to-date]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=69578</id>
		<title>Where to buy GTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=69578"/>
		<updated>2021-03-05T14:00:24Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page outlines some of the places Grand Theft Auto San Andreas can be bought and played with MTA:SA (sometimes with an automatic downgrade step).  &lt;br /&gt;
&lt;br /&gt;
'''Compatibility'''&lt;br /&gt;
&lt;br /&gt;
Not all of the GTA versions listed below have been tested, but all should work correctly. If not, try reinstalling MTA. If that doesn't work, follow [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ these instructions]. If that still doesn't work, then please contact us on [https://forum.mtasa.com/forum/83-client/ on the forums], or join the [https://mtasa.com/discord MTA Discord #help-support channel].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 900px; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Retailer&lt;br /&gt;
!Notes&lt;br /&gt;
!Works with MTA:SA?&lt;br /&gt;
|-&lt;br /&gt;
|[http://store.steampowered.com/app/12120/ Steam]&lt;br /&gt;
|Specialized Steam version of the game.&lt;br /&gt;
MTA installer will make this compatible for you (make sure to install the latest version of MTA '''after''' installing the Steam GTA version), but without modifying original game files.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; |[http://www.amazon.com/Grand-Theft-Auto-Andreas-Download/dp/B006YVXGJQ Amazon]&lt;br /&gt;
|For the '''Standard''' edition of the game, if MTA is incompatible, visit [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this topic] and follow the instructions, or try obtaining a GTA SA 1.00 No CD - any HOODLUM release will function correctly.&lt;br /&gt;
|{{Partial|Unconfirmed (Standard)}}&lt;br /&gt;
|-&lt;br /&gt;
| Steam version and disc copies of GTA:SA will work fine.&lt;br /&gt;
| {{Yes| Yes (Steam/Boxed DVD)}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.gamersgate.com/DD-GTASAS-GN/grand-theft-auto-san-andreas GamersGate]&lt;br /&gt;
|rowspan=2|To our knowledge, these vendors are offering Steam versions of the game (make sure to verify), and therefore will function similarly to the first entry in this article (Retailer: Steam).&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.greenmangaming.com/games/grand-theft-auto-san-andreas/ GreenManGaming]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.rockstarwarehouse.com/store/rsg/en_IE/pd/productID.5281755000 Rockstar Games Launcher]&lt;br /&gt;
|It is recommended to get GTA:SA straight from the [https://socialclub.rockstargames.com/rockstar-games-launcher Rockstar Games Launcher application] rather than the webshop page.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.microsoft.com/en-us/p/grand-theft-auto-san-andreas/9wzdncrfj1zn Windows App Store]&lt;br /&gt;
|This is a mobile/Xbox &amp;quot;remastered&amp;quot; version of the game ported to PC. '''Will never work with MTA.'''&lt;br /&gt;
|{{No}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[hu:Where to buy GTASA]]&lt;br /&gt;
[[es:Dónde comprar GTA: SA]]&lt;br /&gt;
[[pl:Where to buy GTASA]]&lt;br /&gt;
[[ru:Where to buy GTASA]]&lt;br /&gt;
[[uk:Where to buy GTASA]]&lt;br /&gt;
[[tr:GTA:SA Nerden Alınır]]&lt;br /&gt;
[[zh-cn:在那里可以购买GTASA]]&lt;br /&gt;
[[ro:Where to buy GTASA]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=69577</id>
		<title>Where to buy GTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=69577"/>
		<updated>2021-03-05T13:59:55Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page outlines some of the places Grand Theft Auto San Andreas can be bought and played with MTA:SA (sometimes with an automatic downgrade step).  &lt;br /&gt;
&lt;br /&gt;
'''Compatibility'''&lt;br /&gt;
&lt;br /&gt;
Not all of the GTA versions listed below have been tested, but all should work correctly. If not, try reinstalling MTA. If that doesn't work, follow [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ these instructions]. If that still doesn't work, then please contact us on [https://forum.mtasa.com/forum/83-client/ on the forums], or join the [https://mtasa.com/discord MTA Discord #help-support channel].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 900px; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Retailer&lt;br /&gt;
!Notes&lt;br /&gt;
!Works with MTA:SA?&lt;br /&gt;
|-&lt;br /&gt;
|[http://store.steampowered.com/app/12120/ Steam]&lt;br /&gt;
|Specialized Steam version of the game.&lt;br /&gt;
MTA installer will make this compatible for you (make sure to install the latest version of MTA '''after''' installing the Steam GTA version), but without modifying original game files.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; |[http://www.amazon.com/Grand-Theft-Auto-Andreas-Download/dp/B006YVXGJQ Amazon]&lt;br /&gt;
|For the '''Standard''' edition of the game, if MTA is incompatible, visit [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this topic] and follow the instructions, or try obtaining a GTA SA 1.00 No CD - any HOODLUM release will function correctly.&lt;br /&gt;
|{{Partial|Unconfirmed (Standard)}}&lt;br /&gt;
|-&lt;br /&gt;
| Steam version and disc copies of GTA:SA will work fine&lt;br /&gt;
| {{Yes| Yes (Steam/Boxed DVD)}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.gamersgate.com/DD-GTASAS-GN/grand-theft-auto-san-andreas GamersGate]&lt;br /&gt;
|rowspan=2|To our knowledge, these vendors are offering Steam versions of the game (make sure to verify), and therefore will function similarly to the first entry in this article (Retailer: Steam).&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.greenmangaming.com/games/grand-theft-auto-san-andreas/ GreenManGaming]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.rockstarwarehouse.com/store/rsg/en_IE/pd/productID.5281755000 Rockstar Games Launcher]&lt;br /&gt;
|It is recommended to get GTA:SA straight from the [https://socialclub.rockstargames.com/rockstar-games-launcher Rockstar Games Launcher application] rather than the webshop page.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.microsoft.com/en-us/p/grand-theft-auto-san-andreas/9wzdncrfj1zn Windows App Store]&lt;br /&gt;
|This is a mobile/Xbox &amp;quot;remastered&amp;quot; version of the game ported to PC. '''Will never work with MTA.'''&lt;br /&gt;
|{{No}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[hu:Where to buy GTASA]]&lt;br /&gt;
[[es:Dónde comprar GTA: SA]]&lt;br /&gt;
[[pl:Where to buy GTASA]]&lt;br /&gt;
[[ru:Where to buy GTASA]]&lt;br /&gt;
[[uk:Where to buy GTASA]]&lt;br /&gt;
[[tr:GTA:SA Nerden Alınır]]&lt;br /&gt;
[[zh-cn:在那里可以购买GTASA]]&lt;br /&gt;
[[ro:Where to buy GTASA]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FetchRemote&amp;diff=67089</id>
		<title>FetchRemote</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FetchRemote&amp;diff=67089"/>
		<updated>2020-07-25T18:34:10Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes.&lt;br /&gt;
&lt;br /&gt;
In the case when the call fails, a string containing &amp;quot;ERROR&amp;quot; followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts.&lt;br /&gt;
&lt;br /&gt;
If you are using fetchRemote to connect to a PHP script, you can use ''file_get_contents(&amp;quot;php://input&amp;quot;)'' to read the '''postData''' sent from this function.&lt;br /&gt;
{{Note|Client side function only works with the server the player is connected to unless the domain has been accepted with [[requestBrowserDomains]]}}&lt;br /&gt;
{{ Warning| function won't trigger inside another fetchRemote function }}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fetchRemote ( string URL, [ string queueName = &amp;quot;default&amp;quot; ], [ int connectionAttempts = 10, int connectTimeout = 10000 ], function callbackFunction, [ string postData = &amp;quot;&amp;quot;,  bool postIsBinary = false ], [ arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''URL:''' A full URL in the format ''&amp;lt;nowiki&amp;gt;http://hostname/path/file.ext&amp;lt;/nowiki&amp;gt;''. A port can be specified with a colon followed by a port number appended to the hostname.&lt;br /&gt;
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:&lt;br /&gt;
**'''''responseData''''' - A string containing the remote response or &amp;quot;ERROR&amp;quot; if there was a problem&lt;br /&gt;
**'''''error''''' - A number containing the error number or zero if there was no error. A list of possible error values are:&lt;br /&gt;
{{Error_codes_for_callRemote_and_fetchRemote}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left:19px;&amp;quot;&amp;gt;&lt;br /&gt;
*'''''arguments...''''' - The arguments that were passed into fetchRemote&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New items|4.0153|1.5.3-9.11270|&lt;br /&gt;
*'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is &amp;quot;default&amp;quot;. Requests in the same queue are processed in order, one at a time.&lt;br /&gt;
}}&lt;br /&gt;
*'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''In the case of a non-responding remote server, each connection attempt will timeout after 10 seconds. Therefore, the default setting of 10 connection attempts means it will be 100 seconds before your script gets a callback about the error. Reducing this value to 2 for example, will decrease that period to 20 seconds''&lt;br /&gt;
*'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out&lt;br /&gt;
*'''postData:''' A string specifying any data you want to send to the remote HTTP server.&lt;br /&gt;
*'''postIsBinary :''' A boolean specifying if the data is text, or binary.&lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the callback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11342|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''URL:''' A full URL in the format ''&amp;lt;nowiki&amp;gt;http://hostname/path/file.ext&amp;lt;/nowiki&amp;gt;''. A port can be specified with a colon followed by a port number appended to the hostname.&lt;br /&gt;
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:&lt;br /&gt;
**'''''responseData''''' - A string containing the remote response&lt;br /&gt;
**'''''responseInfo''''' - A table containing:&lt;br /&gt;
***'''''success''''' - A boolean indicating if the request was successful.&lt;br /&gt;
***'''''statusCode''''' - An integer status/error code&lt;br /&gt;
***'''''headers''''' - A table containing the HTTP response headers&lt;br /&gt;
**'''''arguments...''''' - The arguments that were passed into fetchRemote&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''options:''' A table containing any request options:&lt;br /&gt;
**'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is &amp;quot;default&amp;quot;. Requests in the same queue are processed in order, one at a time.&lt;br /&gt;
**'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''(Defaults to 10)''&lt;br /&gt;
**'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out. ''(Defaults to 10000)''&lt;br /&gt;
**'''postData:''' A string specifying any data you want to send to the remote HTTP server.&lt;br /&gt;
**'''postIsBinary :''' A boolean specifying if the data is text, or binary. ''(Defaults to false)''&lt;br /&gt;
**'''method:''' A string specifying the request method. ''(Defaults to GET or POST)''&lt;br /&gt;
**'''headers:''' A table containing HTTP request headers. ''e.g.{ Pragma&amp;amp;#61;&amp;quot;no-cache&amp;quot; }''&lt;br /&gt;
**'''maxRedirects:''' An integer limiting the number of HTTP redirections to automatically follow. ''(Defaults to 8)''&lt;br /&gt;
**'''username:''' A string specifying the username for protected pages.&lt;br /&gt;
**'''password:''' A string specifying the password for protected pages.&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11413|&lt;br /&gt;
**'''formFields:''' A table containing form items to submit. (for POST method only)  ''e.g.{ name&amp;amp;#61;&amp;quot;bob&amp;quot;, email&amp;amp;#61;&amp;quot;bob@example.com&amp;quot; }''&lt;br /&gt;
}}&lt;br /&gt;
*'''arguments:''' A table containing arguments you may want to pass to the callback.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{New items|5.0154|1.5.7-9.20307|&lt;br /&gt;
Returns a '''''request''''' value which can be used with [[GetRemoteRequestInfo|getRemoteRequestInfo]] or [[AbortRemoteRequest|abortRemoteRequest]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example shows you how you can fetch an image from a web page, and transfer it to a particular client:&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;
&lt;br /&gt;
function startImageDownload( playerToReceive )&lt;br /&gt;
    fetchRemote ( &amp;quot;http://www.example.com/image.jpg&amp;quot;, myCallback, &amp;quot;&amp;quot;, false, playerToReceive )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function myCallback( responseData, error, playerToReceive )&lt;br /&gt;
    if error == 0 then&lt;br /&gt;
        triggerClientEvent( playerToReceive, &amp;quot;onClientGotImage&amp;quot;, resourceRoot, responseData )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
addEvent( &amp;quot;onClientGotImage&amp;quot;, true )&lt;br /&gt;
addEventHandler( &amp;quot;onClientGotImage&amp;quot;, resourceRoot,&lt;br /&gt;
    function( pixels )&lt;br /&gt;
        if myTexture then&lt;br /&gt;
            destroyElement( myTexture )&lt;br /&gt;
        end&lt;br /&gt;
        myTexture = dxCreateTexture( pixels )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myTexture then&lt;br /&gt;
            local w,h = dxGetMaterialSize( myTexture )&lt;br /&gt;
            dxDrawImage( 200, 100, w, h, myTexture )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11413|&lt;br /&gt;
Example sending email via a web service (adopted from examples on https://documentation.mailgun.com/user_manual.html)&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;
sendOptions = {&lt;br /&gt;
    queueName = &amp;quot;My Mailgun queue&amp;quot;,&lt;br /&gt;
    connectionAttempts = 3,&lt;br /&gt;
    connectTimeout = 5000,&lt;br /&gt;
    formFields = {&lt;br /&gt;
        from=&amp;quot;Excited User &amp;lt;excited@samples.mailgun.org&amp;gt;&amp;quot;,&lt;br /&gt;
        to=&amp;quot;devs@mailgun.net&amp;quot;,&lt;br /&gt;
        subject=&amp;quot;Hello&amp;quot;,&lt;br /&gt;
        text=&amp;quot;Testing some Mailgun awesomness!&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    username=&amp;quot;api&amp;quot;,&lt;br /&gt;
    password=&amp;quot;key-3ax6xnjp29jd6fds4gc373sgvjxteol0&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
fetchRemote( &amp;quot;https://api.mailgun.net/v3/samples.mailgun.org/messages&amp;quot;, sendOptions, mailgunCompleteCallback )&lt;br /&gt;
&lt;br /&gt;
function mailgunCompleteCallback(data, info)&lt;br /&gt;
    outputDebugString( &amp;quot;mailgunComplete&amp;quot;&lt;br /&gt;
            .. &amp;quot; success:&amp;quot; .. tostring(info.success)&lt;br /&gt;
            .. &amp;quot; statusCode:&amp;quot; .. tostring(info.statusCode)&lt;br /&gt;
            .. &amp;quot; data:&amp;quot; .. tostring(data)&lt;br /&gt;
            )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changing post content on IPS forum.&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;
local apiKey = &amp;quot;12345678123456781234567812345678&amp;quot; -- key from ips admin panel&lt;br /&gt;
local forumAddress = &amp;quot;https://yourForum.com&amp;quot;&lt;br /&gt;
function setPostContent(postID,content)&lt;br /&gt;
  local sendOptions = {&lt;br /&gt;
    queueName = &amp;quot;updatePost&amp;quot;,&lt;br /&gt;
    connectionAttempts = 1,&lt;br /&gt;
    connectTimeout = 50,&lt;br /&gt;
    formFields = {&lt;br /&gt;
      post = content,&lt;br /&gt;
    },&lt;br /&gt;
  }&lt;br /&gt;
  fetchRemote( forumAddress..&amp;quot;/api/forums/posts/&amp;quot;..postID..&amp;quot;?key=&amp;quot;..apiKey, sendOptions, function()end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setPostContent(1, &amp;quot;this is a first post on this forum&amp;quot;)&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;
==Requirements==&lt;br /&gt;
{{Requirements|1.3.0-9.03739|1.3.2|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04605|Added connectionAttempts argument}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added client side}}&lt;br /&gt;
{{ChangelogItem|1.5.3-9.11270|Added queueName argument}}&lt;br /&gt;
{{ChangelogItem|1.5.4-9.11342|Added alternative syntax}}&lt;br /&gt;
{{ChangelogItem|1.5.4-9.11413|Added formFields}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FetchRemote&amp;diff=67088</id>
		<title>FetchRemote</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FetchRemote&amp;diff=67088"/>
		<updated>2020-07-25T18:23:36Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes.&lt;br /&gt;
&lt;br /&gt;
In the case when the call fails, a string containing &amp;quot;ERROR&amp;quot; followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts.&lt;br /&gt;
&lt;br /&gt;
If you are using fetchRemote to connect to a PHP script, you can use ''file_get_contents(&amp;quot;php://input&amp;quot;)'' to read the '''postData''' sent from this function.&lt;br /&gt;
{{Note|Client side function only works with the server the player is connected to unless the domain has been accepted with [[requestBrowserDomains]]}}&lt;br /&gt;
{{ Warning| function won't trigger inside another fetchRemote function }}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fetchRemote ( string URL, [ string queueName = &amp;quot;default&amp;quot; ], [ int connectionAttempts = 10, int connectTimeout = 10000 ], function callbackFunction, [ string postData = &amp;quot;&amp;quot; ], [ bool postIsBinary = false ], [ arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''URL:''' A full URL in the format ''&amp;lt;nowiki&amp;gt;http://hostname/path/file.ext&amp;lt;/nowiki&amp;gt;''. A port can be specified with a colon followed by a port number appended to the hostname.&lt;br /&gt;
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:&lt;br /&gt;
**'''''responseData''''' - A string containing the remote response or &amp;quot;ERROR&amp;quot; if there was a problem&lt;br /&gt;
**'''''error''''' - A number containing the error number or zero if there was no error. A list of possible error values are:&lt;br /&gt;
{{Error_codes_for_callRemote_and_fetchRemote}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left:19px;&amp;quot;&amp;gt;&lt;br /&gt;
*'''''arguments...''''' - The arguments that were passed into fetchRemote&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New items|4.0153|1.5.3-9.11270|&lt;br /&gt;
*'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is &amp;quot;default&amp;quot;. Requests in the same queue are processed in order, one at a time.&lt;br /&gt;
}}&lt;br /&gt;
*'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''In the case of a non-responding remote server, each connection attempt will timeout after 10 seconds. Therefore, the default setting of 10 connection attempts means it will be 100 seconds before your script gets a callback about the error. Reducing this value to 2 for example, will decrease that period to 20 seconds''&lt;br /&gt;
*'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out&lt;br /&gt;
*'''postData:''' A string specifying any data you want to send to the remote HTTP server.&lt;br /&gt;
*'''postIsBinary :''' A boolean specifying if the data is text, or binary.&lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the callback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11342|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''URL:''' A full URL in the format ''&amp;lt;nowiki&amp;gt;http://hostname/path/file.ext&amp;lt;/nowiki&amp;gt;''. A port can be specified with a colon followed by a port number appended to the hostname.&lt;br /&gt;
*'''callbackFunction:''' This is the function that should receive the data returned from the remote server. The callback argument list should be:&lt;br /&gt;
**'''''responseData''''' - A string containing the remote response&lt;br /&gt;
**'''''responseInfo''''' - A table containing:&lt;br /&gt;
***'''''success''''' - A boolean indicating if the request was successful.&lt;br /&gt;
***'''''statusCode''''' - An integer status/error code&lt;br /&gt;
***'''''headers''''' - A table containing the HTTP response headers&lt;br /&gt;
**'''''arguments...''''' - The arguments that were passed into fetchRemote&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''options:''' A table containing any request options:&lt;br /&gt;
**'''queueName:''' Name of the queue to use. Any name can be used. If not set, the queue name is &amp;quot;default&amp;quot;. Requests in the same queue are processed in order, one at a time.&lt;br /&gt;
**'''connectionAttempts:''' Number of times to retry if the remote host does not respond. ''(Defaults to 10)''&lt;br /&gt;
**'''connectTimeout:''' Number of milliseconds each connection attempt will take before timing out. ''(Defaults to 10000)''&lt;br /&gt;
**'''postData:''' A string specifying any data you want to send to the remote HTTP server.&lt;br /&gt;
**'''postIsBinary :''' A boolean specifying if the data is text, or binary. ''(Defaults to false)''&lt;br /&gt;
**'''method:''' A string specifying the request method. ''(Defaults to GET or POST)''&lt;br /&gt;
**'''headers:''' A table containing HTTP request headers. ''e.g.{ Pragma&amp;amp;#61;&amp;quot;no-cache&amp;quot; }''&lt;br /&gt;
**'''maxRedirects:''' An integer limiting the number of HTTP redirections to automatically follow. ''(Defaults to 8)''&lt;br /&gt;
**'''username:''' A string specifying the username for protected pages.&lt;br /&gt;
**'''password:''' A string specifying the password for protected pages.&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11413|&lt;br /&gt;
**'''formFields:''' A table containing form items to submit. (for POST method only)  ''e.g.{ name&amp;amp;#61;&amp;quot;bob&amp;quot;, email&amp;amp;#61;&amp;quot;bob@example.com&amp;quot; }''&lt;br /&gt;
}}&lt;br /&gt;
*'''arguments:''' A table containing arguments you may want to pass to the callback.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
{{New items|5.0154|1.5.7-9.20307|&lt;br /&gt;
Returns a '''''request''''' value which can be used with [[GetRemoteRequestInfo|getRemoteRequestInfo]] or [[AbortRemoteRequest|abortRemoteRequest]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example shows you how you can fetch an image from a web page, and transfer it to a particular client:&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;
&lt;br /&gt;
function startImageDownload( playerToReceive )&lt;br /&gt;
    fetchRemote ( &amp;quot;http://www.example.com/image.jpg&amp;quot;, myCallback, &amp;quot;&amp;quot;, false, playerToReceive )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function myCallback( responseData, error, playerToReceive )&lt;br /&gt;
    if error == 0 then&lt;br /&gt;
        triggerClientEvent( playerToReceive, &amp;quot;onClientGotImage&amp;quot;, resourceRoot, responseData )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
addEvent( &amp;quot;onClientGotImage&amp;quot;, true )&lt;br /&gt;
addEventHandler( &amp;quot;onClientGotImage&amp;quot;, resourceRoot,&lt;br /&gt;
    function( pixels )&lt;br /&gt;
        if myTexture then&lt;br /&gt;
            destroyElement( myTexture )&lt;br /&gt;
        end&lt;br /&gt;
        myTexture = dxCreateTexture( pixels )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myTexture then&lt;br /&gt;
            local w,h = dxGetMaterialSize( myTexture )&lt;br /&gt;
            dxDrawImage( 200, 100, w, h, myTexture )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|5.0154|1.5.4-9.11413|&lt;br /&gt;
Example sending email via a web service (adopted from examples on https://documentation.mailgun.com/user_manual.html)&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;
sendOptions = {&lt;br /&gt;
    queueName = &amp;quot;My Mailgun queue&amp;quot;,&lt;br /&gt;
    connectionAttempts = 3,&lt;br /&gt;
    connectTimeout = 5000,&lt;br /&gt;
    formFields = {&lt;br /&gt;
        from=&amp;quot;Excited User &amp;lt;excited@samples.mailgun.org&amp;gt;&amp;quot;,&lt;br /&gt;
        to=&amp;quot;devs@mailgun.net&amp;quot;,&lt;br /&gt;
        subject=&amp;quot;Hello&amp;quot;,&lt;br /&gt;
        text=&amp;quot;Testing some Mailgun awesomness!&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    username=&amp;quot;api&amp;quot;,&lt;br /&gt;
    password=&amp;quot;key-3ax6xnjp29jd6fds4gc373sgvjxteol0&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
fetchRemote( &amp;quot;https://api.mailgun.net/v3/samples.mailgun.org/messages&amp;quot;, sendOptions, mailgunCompleteCallback )&lt;br /&gt;
&lt;br /&gt;
function mailgunCompleteCallback(data, info)&lt;br /&gt;
    outputDebugString( &amp;quot;mailgunComplete&amp;quot;&lt;br /&gt;
            .. &amp;quot; success:&amp;quot; .. tostring(info.success)&lt;br /&gt;
            .. &amp;quot; statusCode:&amp;quot; .. tostring(info.statusCode)&lt;br /&gt;
            .. &amp;quot; data:&amp;quot; .. tostring(data)&lt;br /&gt;
            )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changing post content on IPS forum.&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;
local apiKey = &amp;quot;12345678123456781234567812345678&amp;quot; -- key from ips admin panel&lt;br /&gt;
local forumAddress = &amp;quot;https://yourForum.com&amp;quot;&lt;br /&gt;
function setPostContent(postID,content)&lt;br /&gt;
  local sendOptions = {&lt;br /&gt;
    queueName = &amp;quot;updatePost&amp;quot;,&lt;br /&gt;
    connectionAttempts = 1,&lt;br /&gt;
    connectTimeout = 50,&lt;br /&gt;
    formFields = {&lt;br /&gt;
      post = content,&lt;br /&gt;
    },&lt;br /&gt;
  }&lt;br /&gt;
  fetchRemote( forumAddress..&amp;quot;/api/forums/posts/&amp;quot;..postID..&amp;quot;?key=&amp;quot;..apiKey, sendOptions, function()end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setPostContent(1, &amp;quot;this is a first post on this forum&amp;quot;)&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;
==Requirements==&lt;br /&gt;
{{Requirements|1.3.0-9.03739|1.3.2|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04605|Added connectionAttempts argument}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added client side}}&lt;br /&gt;
{{ChangelogItem|1.5.3-9.11270|Added queueName argument}}&lt;br /&gt;
{{ChangelogItem|1.5.4-9.11342|Added alternative syntax}}&lt;br /&gt;
{{ChangelogItem|1.5.4-9.11413|Added formFields}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SaveMapData&amp;diff=67056</id>
		<title>SaveMapData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SaveMapData&amp;diff=67056"/>
		<updated>2020-07-17T16:26:13Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This converts a set of elements in the element tree into XML. This is a format that can then be loaded as a map file. Each element represents a single XML node.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool saveMapData ( xmlnode node, element baseElement [, bool childrenOnly = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''node''': An existing node that should contain the contents of baseElement&lt;br /&gt;
*'''baseElement''': The first element to output to the XML tree. This element and all its children (and their children, etc) will be output.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''childrenOnly''': Defines if you want to only save children of the specified element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Saving your resource's data to an [https://forum.mtasa.com/topic/126081-map-files map file] (untested)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local file = xmlCreateFile(&amp;quot;saved.map&amp;quot;, &amp;quot;map&amp;quot;)&lt;br /&gt;
if file then&lt;br /&gt;
   saveMapData ( file, getResourceRootElement(getThisResource()) )&lt;br /&gt;
   xmlSaveFile ( file )&lt;br /&gt;
   xmlUnloadFile ( file )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Map functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SaveMapData&amp;diff=67055</id>
		<title>SaveMapData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SaveMapData&amp;diff=67055"/>
		<updated>2020-07-17T16:25:52Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This converts a set of elements in the element tree into XML. This is a format that can then be loaded as a map file. Each element represents a single XML node.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool saveMapData ( xmlnode node, element baseElement [, bool childrenOnly = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''node''': An existing node that should contain the contents of baseElement&lt;br /&gt;
*'''baseElement''': The first element to output to the xml tree. This element and all its children (and their children, etc) will be output.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''childrenOnly''': Defines if you want to only save children of the specified element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Saving your resource's data to an [https://forum.mtasa.com/topic/126081-map-files map file] (untested)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local file = xmlCreateFile(&amp;quot;saved.map&amp;quot;, &amp;quot;map&amp;quot;)&lt;br /&gt;
if file then&lt;br /&gt;
   saveMapData ( file, getResourceRootElement(getThisResource()) )&lt;br /&gt;
   xmlSaveFile ( file )&lt;br /&gt;
   xmlUnloadFile ( file )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Map functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=LoadMapData&amp;diff=67054</id>
		<title>LoadMapData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=LoadMapData&amp;diff=67054"/>
		<updated>2020-07-17T16:24:49Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is intended to load data from a loaded XML file into the element tree. This could be used for loading an external map, or part of another map.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element loadMapData ( xmlnode node, element parent )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''node:''' The node that you wish to load into the [[element tree]].&lt;br /&gt;
*'''parent:''' The node you wish to be the parent of the new map data.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[element]] object that corresponds to the root of the new data added, i.e. an element that represents the ''node'' xmlnode passed to the function. Returns ''false'' if the arguments are invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example is a function that you could use to load an arbitary [https://forum.mtasa.com/topic/126081-map-files map file] into the [[element tree]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function loadMapFile ( filename )&lt;br /&gt;
	node = getResourceConfig ( filename )&lt;br /&gt;
	-- Check if the file was loaded ok&lt;br /&gt;
	if ( node ) then&lt;br /&gt;
		-- Load the loaded xml file into the element tree&lt;br /&gt;
		loadMapData ( node, getRootElement() )&lt;br /&gt;
		-- Unload the xml file again&lt;br /&gt;
		xmlUnloadFile ( node )&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;
{{Map_functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI&amp;diff=67015</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=67015"/>
		<updated>2020-07-04T12:21:32Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &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, buttons, edit boxes, checkboxes... 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]] ''(If you have used the [[Scripting Introduction|Introduction to Scripting]], you will need to remove or comment the [[spawnPlayer]] line in the &amp;quot;joinHandler&amp;quot; function in your code, as we will be replacing it with a GUI alternative in this tutorial)''. 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. &lt;br /&gt;
&lt;br /&gt;
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;. &lt;br /&gt;
&lt;br /&gt;
In this file we will write a function that draws the window. To create a window we will use [[guiCreateWindow]]:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createLoginWindow()&lt;br /&gt;
	-- define the X and Y positions of the window&lt;br /&gt;
	local X = 0.375&lt;br /&gt;
	local Y = 0.375&lt;br /&gt;
	-- define the width and height of the window&lt;br /&gt;
	local Width = 0.25&lt;br /&gt;
	local Height = 0.25&lt;br /&gt;
	-- create the window and save its element value into the variable 'wdwLogin'&lt;br /&gt;
	-- click on the function's name to read its documentation&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;
&lt;br /&gt;
===Relative and Absolute===&lt;br /&gt;
Note that the final argument passed to guiCreateWindow in the above example is ''true''. This indicates that the coordinates and dimensions of the window are '''relative''', meaning they are a ''percentage'' of the total screen size. This means that if the far left side of the screen is 0, and the far right is 1, an X position of 0.5 would represent the center point of the screen. Similarly, if the top of the screen is 0 and the bottom is 1, a Y position of 0.2 would be 20% of the way down the screen. The same principles apply to both Width and Height as well (with a Width value of 0.5 meaning the window will be half as wide as the screen).&lt;br /&gt;
&lt;br /&gt;
The alternative to using relative values is using '''absolute''' (by passing ''false'' instead of true to guiCreateWindow). Absolute values are calculated as the total number of pixels from the top-left corner of the parent (if no GUI element parent is specified, the parent is the screen itself). If we assume a screen resolution of 1920x1200, the far left side of the screen being 0 pixels and the far-right being 1920 pixels, an X position of 960 will represent the center point of the screen. Similarly, if the top of the screen is 0 pixels and the bottom is 1200, a Y position of 20 would be 20 pixels down from the top of the screen. The same principles apply to both Width and Height as well (with a Width value of 50 meaning the window will be 50 pixels wide). ''You can use [[guiGetScreenSize]] and a little maths to calculate certain absolute positions.''&lt;br /&gt;
&lt;br /&gt;
The differences between using relative and absolute values are quite simple; GUI created using absolute values will always remain exactly the same pixel size and position, while GUI created using relative values will always be a percentage of its parent's size.&lt;br /&gt;
&lt;br /&gt;
Absolute is generally easier to maintain when editing code by hand, however, your choice of type depends on the situation you are using it for.&lt;br /&gt;
&lt;br /&gt;
For the purposes of this introduction, we will be using relative values.&lt;br /&gt;
&lt;br /&gt;
===Adding the components===&lt;br /&gt;
Next, we'll add the text labels (saying &amp;quot;username:&amp;quot; and &amp;quot;password:&amp;quot;), edit boxes (for entering your data), and a button to log in.&lt;br /&gt;
&lt;br /&gt;
To create buttons we use [[guiCreateButton]] and to create edit boxes use [[guiCreateEdit]]:&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'createLoginWindow' function. This is not a new function and is meant to replace what you already have.''' &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;
	-- define new X and Y positions for the first label&lt;br /&gt;
	X = 0.0825&lt;br /&gt;
	Y = 0.2&lt;br /&gt;
	-- define new Width and Height values for the first label&lt;br /&gt;
	Width = 0.25&lt;br /&gt;
	Height = 0.25&lt;br /&gt;
	-- create the first label, note the final argument passed is 'wdwLogin' meaning the window&lt;br /&gt;
	-- we created above is the parent of this label (so all the position and size values are now relative to the position of that window)&lt;br /&gt;
	guiCreateLabel(X, Y, Width, Height, &amp;quot;Username&amp;quot;, true, wdwLogin)&lt;br /&gt;
	-- alter the Y value, so the second label is slightly below the first&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;
&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;
	-- set the maximum character length for the username and password fields to 50&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;
	-- make the window invisible&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;
&lt;br /&gt;
This is very useful because not only does it mean that all the components are attached to the window and will move with it, but also that any changes done to the parent window will be applied down the tree to these child components. For example, we can now hide all of the GUI we just created by simply hiding the window:&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 now complete, 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 the 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;
-- attach the event handler to the root element of the resource&lt;br /&gt;
-- this means it will only trigger when its own resource is started&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(), &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;
&lt;br /&gt;
As this is a login window, we now need to show the window when the player joins the game. &lt;br /&gt;
This can be done using the same event, &amp;quot;[[onClientResourceStart]]&amp;quot;, so we can modify the above code to include showing the window:&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'onClientResourceStart' handler. This is not a new event handler and is meant to replace what you already have.''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(), &lt;br /&gt;
	function ()&lt;br /&gt;
		-- create the log in window and its components&lt;br /&gt;
		createLoginWindow()&lt;br /&gt;
&lt;br /&gt;
		-- output a brief welcome message to the player&lt;br /&gt;
                outputChatBox(&amp;quot;Welcome to My MTA:SA Server, please log in.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
		-- if the GUI was successfully created, then show the GUI to the player&lt;br /&gt;
	        if (wdwLogin ~= nil) then&lt;br /&gt;
			guiSetVisible(wdwLogin, true)&lt;br /&gt;
		else&lt;br /&gt;
			-- if the GUI hasn't been properly created, tell the player&lt;br /&gt;
			outputChatBox(&amp;quot;An unexpected error has occurred and the login GUI has not been created.&amp;quot;)&lt;br /&gt;
	        end &lt;br /&gt;
&lt;br /&gt;
		-- enable the player's cursor (so they can select and click on the components)&lt;br /&gt;
	        showCursor(true)&lt;br /&gt;
		-- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening&lt;br /&gt;
	        guiSetInputEnabled(true)&lt;br /&gt;
	end&lt;br /&gt;
)	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we have a simple security check before making the window visible, so in the unlikely event that the window has not been created, meaning wdwLogin is not a valid element, we don't get an error and just inform the player what has happened. &lt;br /&gt;
In the next step, we will create the button functionality for the login button.&lt;br /&gt;
&lt;br /&gt;
==Scripting the button==&lt;br /&gt;
Now that we have created our GUI and shown it to the player, we need to make it work. &lt;br /&gt;
&lt;br /&gt;
===Detecting the click===&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. This allows us to easily detect any clicks on the GUI elements we want to use.&lt;br /&gt;
For example, we can attach the event to the btnLogin button to catch any clicks on it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- attach the event onClientGUIClick to btnLogin and set it to trigger the 'clientSubmitLogin' function&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, btnLogin, clientSubmitLogin, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note the final argument passed is &amp;quot;false&amp;quot;. This indicates that the event will only trigger directly on btnLogin, not if the event has propagated up or down the tree. Setting this to &amp;quot;true&amp;quot; while attaching to GUI elements will mean that clicking on any element in the same branch will trigger this event.'''&lt;br /&gt;
&lt;br /&gt;
This line of code can now be added inside the createLoginWindow function. It is a common mistake to try and attach events to non-existent GUI elements, so make sure you always attach your events '''after''' the GUI element (in this case, the button) has been created:&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'createLoginWindow' function.''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createLoginWindow()&lt;br /&gt;
	-- create all our GUI elements&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
	-- now add our onClientGUIClick event to the button we just created&lt;br /&gt;
	addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, btnLogin, clientSubmitLogin, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Managing the click===&lt;br /&gt;
Now that we can detect when the player clicks on the button, we need to write code to manage what happens when they do.&lt;br /&gt;
In our [[onClientGUIClick]] event handle, we told it to call the function clientSubmitLogin whenever btnLogin is clicked.&lt;br /&gt;
Therefore, we can now use the function clientSubmitLogin to control what happens when the button is clicked:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function and define the 'button' and 'state' parameters&lt;br /&gt;
-- (these are passed automatically by onClientGUIClick)&lt;br /&gt;
function clientSubmitLogin(button,state)&lt;br /&gt;
	-- if our login button was clicked with the left mouse button, and the state of the mouse button is up&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		-- move the input focus back onto the game (allowing players to move around, open the chatbox, etc)&lt;br /&gt;
		guiSetInputEnabled(false)&lt;br /&gt;
		-- hide the window and all the components&lt;br /&gt;
		guiSetVisible(wdwLogin, false)&lt;br /&gt;
		-- hide the mouse cursor&lt;br /&gt;
		showCursor(false)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, when the button is clicked, the window will be hidden and all controls will be returned to the player. Next, we will tell the server to allow the player to spawn.&lt;br /&gt;
&lt;br /&gt;
===Triggering the server===&lt;br /&gt;
Triggering the server can be done using [[triggerServerEvent]]. This allows you to trigger a specified event on the server from the client. The same can be done in reverse using [[triggerClientEvent]].&lt;br /&gt;
Here, we use the [[triggerServerEvent]] function to call our own custom event on the server, named &amp;quot;submitLogin&amp;quot;, which will then control the spawning of the player serverside.&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'clientSubmitLogin' function. This is not a new function and is meant to replace what you already have.''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function clientSubmitLogin(button,state)&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		-- get the text entered in the 'username' field&lt;br /&gt;
		local username = guiGetText(edtUser)&lt;br /&gt;
		-- get the text entered in the 'password' field&lt;br /&gt;
		local password = guiGetText(edtPass)&lt;br /&gt;
&lt;br /&gt;
		-- if the username and password both exist&lt;br /&gt;
		if username and password then&lt;br /&gt;
			-- trigger the server event 'submitLogin' and pass the username and password to it&lt;br /&gt;
			triggerServerEvent(&amp;quot;submitLogin&amp;quot;, getRootElement(), username, password)&lt;br /&gt;
&lt;br /&gt;
			-- hide the gui, hide the cursor and return control to the player&lt;br /&gt;
			guiSetInputEnabled(false)&lt;br /&gt;
			guiSetVisible(wdwLogin, false)&lt;br /&gt;
			showCursor(false)&lt;br /&gt;
		else&lt;br /&gt;
			-- otherwise, output a message to the player, do not trigger the server&lt;br /&gt;
			-- and do not hide the gui&lt;br /&gt;
			outputChatBox(&amp;quot;Please enter a username and password.&amp;quot;)&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;
===Creating the serverside event===&lt;br /&gt;
At this point we now have all the code needed on the client-side, so open up your serverside 'script.lua' file (from the [[Scripting Introduction|Introduction to Scripting]]) or another suitable serverside file to work with.&lt;br /&gt;
&lt;br /&gt;
On the server-side, recall that we are spawning the player as soon as they log in.&lt;br /&gt;
So, first of all, we will need to define the custom event that we used before on the client. This can be done using [[addEvent]] and [[addEventHandler]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our loginHandler function, with a username and password parameters (passed from the client GUI)&lt;br /&gt;
function loginHandler(username,password)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- define our custom event, and allow it to be triggered from the client ('true')&lt;br /&gt;
addEvent(&amp;quot;submitLogin&amp;quot;,true)&lt;br /&gt;
-- add an event handler so that when submitLogin is triggered, the function loginHandler is called&lt;br /&gt;
addEventHandler(&amp;quot;submitLogin&amp;quot;,root,loginHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Logging in===&lt;br /&gt;
Now we have a function that is called through the custom event 'submitLogin', we can start to work on logging in and spawning the player, using our 'loginHandler' function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function loginHandler(username,password)&lt;br /&gt;
	-- check that the username and password are correct&lt;br /&gt;
	if username == &amp;quot;user&amp;quot; and password == &amp;quot;apple&amp;quot; then&lt;br /&gt;
		-- the player has successfully logged in, so spawn them&lt;br /&gt;
		if (client) then&lt;br /&gt;
			spawnPlayer(client, 1959.55, -1714.46, 10)&lt;br /&gt;
			fadeCamera(client, true)&lt;br /&gt;
                        setCameraTarget(client, client)&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome to My Server.&amp;quot;, client)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- if the username or password are not correct, output a message to the player&lt;br /&gt;
		outputChatBox(&amp;quot;Invalid username and password. Please re-connect and try again.&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;,root,loginHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''For the purposes of this tutorial, a very basic username and password system is shown. For a more comprehensive alternative, you can use the Account System or a MySQL database.'''&lt;br /&gt;
&lt;br /&gt;
Also note the use of 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;
&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;
&lt;br /&gt;
At this point, we now have a basic login window that checks the player's username and password when the login button is clicked. If they are correct, the player is automatically spawned.&lt;br /&gt;
&lt;br /&gt;
For further help with GUI, see the [[:Category:GUI_Tutorials|GUI tutorials]].&lt;br /&gt;
&lt;br /&gt;
[[Category:GUI_Tutorials]]&lt;br /&gt;
[[hu:Introduction to Scripting the GUI]]&lt;br /&gt;
[[it:Introduzione_allo_scripting_della_GUI]]&lt;br /&gt;
[[ru:Introduction to Scripting the GUI]]&lt;br /&gt;
[[es:Introducción a la Programación de GUI]]&lt;br /&gt;
[[zh-cn:脚本编写介绍 - 带有图形界面]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=67014</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=67014"/>
		<updated>2020-07-04T12:19:39Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files, plus a &amp;quot;meta&amp;quot; file that describes to the server how the resource should be loaded and what files it does contain. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once.&lt;br /&gt;
&lt;br /&gt;
Everything that has to do with scripting happens in resources, what a resource does defines if it is a gamemode, a map, or anything else. MTA comes with resources that you can optionally use in your gamemodes, such as map limits to keep playings within a playing area or death-pickups to create weapon pickups.&lt;br /&gt;
{{tip|Your first step to begin Lua scripting should be using a Lua editor. This makes scripting much easier. We recommend [https://code.visualstudio.com/ Visual Studio Code], [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] or [https://www.sublimetext.com/ Sublime Text]}}&lt;br /&gt;
&lt;br /&gt;
==Creating a working script==&lt;br /&gt;
We will first learn how to make a basic script that lets the player walk around in the city, step by step.&lt;br /&gt;
===Where are all the scripts?===&lt;br /&gt;
Let's take a look at the script's file structure. Go to your MTA Server folder, and follow the path below:&lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/&lt;br /&gt;
&lt;br /&gt;
You will see a lot of .zip files, which are the packaged sample scripts shipped with MTA. Each file is a &amp;quot;resource&amp;quot;, and they will all be unzipped and loaded by the server when it starts. To create your own resource, simply make a folder with your preferred name. We'll use &amp;quot;myserver&amp;quot; for this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now you should be under this directory: &lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/myserver/&lt;br /&gt;
&lt;br /&gt;
===Identifying your resource===&lt;br /&gt;
In order to let the server know what's in the resource, a ''meta.xml'' file must be created to list the resource's content. It must be located in the resource's root directory, which is the &amp;quot;myserver&amp;quot; folder in our case. So create a text file and name it &amp;quot;meta.xml&amp;quot;, and open it with notepad.&lt;br /&gt;
&lt;br /&gt;
Enter the following codes in the ''meta.xml'' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
     &amp;lt;info author=&amp;quot;YourName&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;My Server&amp;quot; description=&amp;quot;My first MTA server&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;script src=&amp;quot;script.lua&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the ''&amp;lt;info /&amp;gt;'' tag, there's a &amp;quot;type&amp;quot; field which indicates that the resource is a ''gamemode'' instead of a regular include or a ''map'', which will be explained later. A gamemode is what you need to make a stand-alone server. &lt;br /&gt;
&lt;br /&gt;
The ''&amp;lt;script /&amp;gt;'' tag indicates the script files contained in the resource, which we will create next.&lt;br /&gt;
===Creating a simple script===&lt;br /&gt;
Note that in the ''&amp;lt;script /&amp;gt;'' tag above, the .lua file is not under another directory. Therefore we'll create the file in the same folder as meta.xml. Now you can copy and paste the following code into script.lua:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&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;
The script will spawn you at the coordinate (x, y, z) specified above when you join the game. Note that the ''fadeCamera'' function must be used or the screen will be black. Also, in releases after DP2, you need to set the camera target (otherwise all the players will see is the blue sky).&lt;br /&gt;
&lt;br /&gt;
The '''source''' variable indicates who triggered the event. Since a player has joined when the code is triggered, you use this variable to look which has joined. So it'll spawn that player instead of everyone or a random person.&lt;br /&gt;
&lt;br /&gt;
If we have a closer look on [[addEventHandler]], you can see 3 things: 'onPlayerJoin', which indicates when it's triggered. getRootElement(), which shows by what/who it can be triggered. (getRootElement() is everything/everyone) And joinHandler, which indicates the function that has to be triggered after the event is triggered. Other details will be explained later in another example, now let's just run the server and try it out!&lt;br /&gt;
&lt;br /&gt;
===Running the script===&lt;br /&gt;
To get the server started, simply run the executable under the server/ directory. A list of server stats will be shown first; note the port number, which you'll need when joining the game. Then the server loads all the resources under the mods/deathmatch/resources/ directory, and then &amp;quot;ready to accept connections!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Before you connect to the server, you must run the gamemode. Type &amp;quot;start myserver&amp;quot; and press Enter. The server will start the gamemode you just created, and will also show any errors and warnings from this point on. Now you can start the MTA client, and &amp;quot;Quick Connect&amp;quot; using the IP address of your server and the port number you saw earlier. If all goes well, after a few seconds your character will be walking on the streets of Los Santos.&lt;br /&gt;
&lt;br /&gt;
Next, we'll add a command to your script that players can use to spawn a vehicle beside their position. You may skip it and check out more advanced scripting with the [[Map manager|Map Manager]], which continues this tutorial. Another branch from this tutorial is [[Introduction to Scripting GUI]], you may follow it to see how the Graphical User Interface in MTA is drawn and scripted.&lt;br /&gt;
&lt;br /&gt;
==Creating a simple command==&lt;br /&gt;
Let's go back to the content of the ''script.lua'' file. As mentioned above, we want to provide a command to create a vehicle beside your current position in the game. Firstly we need to create a function we want to call and a command handler that creates the command the player will be able to enter in the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
   -- create a vehicle and stuff&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- create a command handler&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Note: Function names are clickable in code examples on the wiki and linked to the functions' documentation.''&lt;br /&gt;
&lt;br /&gt;
====About command handlers====&lt;br /&gt;
The first argument of [[addCommandHandler]] is the name of the command the player will be able to enter, the second argument is the function this will call, in this case ''createVehicleForPlayer''.&lt;br /&gt;
&lt;br /&gt;
If you have already experienced in scripting, you will know that you call a function like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(argument1, argument2, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(thePlayer, commandName, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed &amp;quot;/greet&amp;quot;, this argument will contain &amp;quot;greet&amp;quot;. Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.&lt;br /&gt;
&lt;br /&gt;
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similar manner, internally.&lt;br /&gt;
&lt;br /&gt;
For example someone types &amp;quot;createvehicle 468&amp;quot; in-game in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createVehicleForPlayer(thePlayer,&amp;quot;createvehicle&amp;quot;,&amp;quot;468&amp;quot;) -- thePlayer is the player element of the player who entered the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As we can see, it provides several parameters: the player who called the command, the command he entered, and whatever text he had after that, in this case, &amp;quot;468&amp;quot; as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).&lt;br /&gt;
&lt;br /&gt;
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''&lt;br /&gt;
&lt;br /&gt;
====Writing the function====&lt;br /&gt;
In order to fill the function we created, we need to think about what we have to do:&lt;br /&gt;
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)&lt;br /&gt;
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)&lt;br /&gt;
* Spawn the vehicle&lt;br /&gt;
* Check if it has been spawned successfully, or output a message&lt;br /&gt;
&lt;br /&gt;
In order to achieve our goals, we have to use several functions. To find the function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First, we need a function to get the player's position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns, and usually an example. The syntax shows us what arguments we can or have to submit.&lt;br /&gt;
&lt;br /&gt;
For [[getElementPosition]], the syntax is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getElementPosition ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three ''float'' in front of the function name is the return type. In this case, it means the function returns three floating-point numbers. (x, y, and z) Within the parentheses, you can see what arguments you have to submit. In this case, only the element whose position you want to get, which is the player in our example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	-- get the position and put it in the x,y,z variables&lt;br /&gt;
	-- (local means, the variables only exist in the current scope, in this case, the function)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.&lt;br /&gt;
&lt;br /&gt;
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command (&amp;quot;createvehicle 468&amp;quot;) and can access in the function as ''vehicleModel'' variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.&lt;br /&gt;
&lt;br /&gt;
Now we have our complete script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
	-- check if the return value was ''false''&lt;br /&gt;
	if (createdVehicle == false) then&lt;br /&gt;
		-- if so, output a message to the chatbox, but only to this player.&lt;br /&gt;
		outputChatBox(&amp;quot;Failed to create vehicle.&amp;quot;,thePlayer)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].&lt;br /&gt;
&lt;br /&gt;
==What you need to know==&lt;br /&gt;
You already read some things about resources, command handlers, and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things while linking to related pages if possible.&lt;br /&gt;
===Clientside and Serverside scripts===&lt;br /&gt;
You may have already noticed these or similar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still, others are better off to be serverside or just don't work clientside.&lt;br /&gt;
&lt;br /&gt;
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script, for example, you would create an ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The ''type'' attribute defaults to 'server', so you only need to specify it for client-side scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].&lt;br /&gt;
&lt;br /&gt;
===More complex resources===&lt;br /&gt;
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:&lt;br /&gt;
&lt;br /&gt;
====First example - A utility script====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/admin_commands&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/commands.lua&lt;br /&gt;
	/client.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;admin commands&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;commands.lua&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server&lt;br /&gt;
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily&lt;br /&gt;
&lt;br /&gt;
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also won't interfere with the gameplay, unless an admin decides to take some action of course.&lt;br /&gt;
&lt;br /&gt;
====Second example - A gamemode====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/counterstrike&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/counterstrike.lua&lt;br /&gt;
	/buymenu.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike remake&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;counterstrike.lua&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;buymenu.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''counterstrike.lua'' contains similar to the following features:&lt;br /&gt;
** Let players choose their team and spawn them&lt;br /&gt;
** Provide them with weapons, targets, and instructions (maybe read from a Map, see below)&lt;br /&gt;
** Define the game's rules, e.g. when does the round end, what happens when a player dies&lt;br /&gt;
** .. and maybe some more&lt;br /&gt;
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons&lt;br /&gt;
&lt;br /&gt;
This example can be called a gamemode, since it not only interferes with the gameplay but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.&lt;br /&gt;
&lt;br /&gt;
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example of a map is stated in the next example.&lt;br /&gt;
&lt;br /&gt;
====Third example - A Map====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/cs-airport&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/airport.map&lt;br /&gt;
	/airport.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike airport map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;counterstrike&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;airport.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;airport.lua&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''airport.map'' in an XML file that provides information about the map to the gamemode, these may include:&lt;br /&gt;
** Where the players should spawn, with what weapons, what teams there are&lt;br /&gt;
** What the targets are&lt;br /&gt;
** Weather, World Time, Timelimit&lt;br /&gt;
** Provide vehicles&lt;br /&gt;
* The ''airport.lua'' might contain map-specific features, that may include:&lt;br /&gt;
** Opening some door/make something explode when something specific happens&lt;br /&gt;
** Create or move some custom objects, or manipulate objects that are created through the .map file&lt;br /&gt;
** .. anything else map-specific you can think of&lt;br /&gt;
&lt;br /&gt;
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case, the gamemode from the above example.&lt;br /&gt;
What may come as a surprise is that there is also a script in the Map resource. Of course, this is not necessarily needed in a map but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.&lt;br /&gt;
&lt;br /&gt;
The ''airport.map'' file might look similiar to this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mode=&amp;quot;deathmatch&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;terrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2332.23&amp;quot; posY=&amp;quot;-12232.33&amp;quot; posZ=&amp;quot;4.42223&amp;quot; skins=&amp;quot;23-40&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/terrorists&amp;gt;&lt;br /&gt;
	&amp;lt;counterterrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2334.23443&amp;quot; posY=&amp;quot;-12300.233&amp;quot; posZ=&amp;quot;10.2344&amp;quot; skins=&amp;quot;40-50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/counterterrorists&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;bomb posX=&amp;quot;23342.23&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;602&amp;quot; /&amp;gt;	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;603&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a gamemode is started with a map, the map resources are automatically started by the map-manager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
[[Event|Events]] are the way MTA tells scripts about things that happen. For example, when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].&lt;br /&gt;
&lt;br /&gt;
This example will output a message with the name of the player who died:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDied(totalAmmo, killer, killerWeapon, bodypart)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; died!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;,getRootElement(),playerDied)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea of how ''source'' is used.&lt;br /&gt;
&lt;br /&gt;
==Where to go from here==&lt;br /&gt;
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials, and References that allow a deeper look into the topics you desire to learn about.&lt;br /&gt;
{{note|From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts. We also recommend you to use the [[predefined variables list]] to help you with certain tasks and make scripting easier and faster.}}&lt;br /&gt;
'''See also:'''&lt;br /&gt;
* [[OOP_Introduction|OOP Scripting Introduction]]&lt;br /&gt;
* [[Advanced Topics]]&lt;br /&gt;
* [[Script_security|Script security]]&lt;br /&gt;
* [[Scripting Introduction Urdu]]&lt;br /&gt;
[[hu:Bevezetés a scriptelésbe]]&lt;br /&gt;
[[es:Introducción a la Programación]]&lt;br /&gt;
[[it:Introduzione allo scripting]]&lt;br /&gt;
[[nl:Scripting_introductie]]&lt;br /&gt;
[[pt-br:Introdução ao Scripting]]&lt;br /&gt;
[[ru:Scripting Introduction]]&lt;br /&gt;
[[ar:مقدمه_في_البرمجه]]&lt;br /&gt;
[[zh-cn:脚本编写介绍]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Client_on_Linux_Manual&amp;diff=65974</id>
		<title>Client on Linux Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Client_on_Linux_Manual&amp;diff=65974"/>
		<updated>2020-04-23T00:11:06Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs Checking|MTA: SA 1.5 and greater versions seem to have problems when launching under Wine.}}&lt;br /&gt;
{{Warning|This page is for Linux players '''ONLY''', for Windows go [[Client Manual|here]].|true}}&lt;br /&gt;
==Before you start==&lt;br /&gt;
&lt;br /&gt;
First of all, please ensure your computer fits the requirements needed.&lt;br /&gt;
Read the [[Client_Manual|Client Manual]] page for further informations, or join us on [https://mtasa.com/discord Discord].&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
The hardware requirements for Multi Theft Auto: San Andreas are the same as on Windows.&lt;br /&gt;
For software requirements, you need:&lt;br /&gt;
* Wine (get it on your package manager (synaptic, apt, pacman, yum, etc.); follow instructions [https://www.winehq.org/download/ubuntu here] if you're using Ubuntu&lt;br /&gt;
(as of MTA 1.4.1 Ubuntu's default Wine package seems to be incompatible with Visual C++, which is required to install MTA)&lt;br /&gt;
* Windows fonts installed:&lt;br /&gt;
** tahoma.ttf&lt;br /&gt;
** tahomabd.ttf&lt;br /&gt;
** verdana.ttf&lt;br /&gt;
Get them on the Internet, e.g. [http://fontonic.com/ fontonic.com]&lt;br /&gt;
&lt;br /&gt;
Or get the zip archive with the 3 fonts {{WineFonts}}.&lt;br /&gt;
&lt;br /&gt;
Install them in: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;~/.wine/dosdevices/c:/windows/Fonts/&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
(~/ points to your user home folder on Linux, .wine is the default wineprefix)&lt;br /&gt;
&lt;br /&gt;
==Installing the game==&lt;br /&gt;
Download the MTA installer from [http://www.mtasa.com mtasa.com], ensure you can launch it (chmod +x) then install it when you want.&lt;br /&gt;
&lt;br /&gt;
==Running the game==&lt;br /&gt;
Once installed, double-clicking on the Multi Theft Auto.exe should work. If not, try in a terminal the following command: &amp;quot;wine Multi Theft Auto.exe&amp;quot; in the directory you installed Multi Theft Auto to.&lt;br /&gt;
If it doesn't work, check the contents of the file c:/Program_Files/Multi Theft Auto/MTA/CEGUI.log, which may contain useful information.&lt;br /&gt;
&lt;br /&gt;
==Known issues==&lt;br /&gt;
===Specific issues===&lt;br /&gt;
* Impossible connection through the server browser [Fixed in the [http://bugs.mtasa.com/view.php?id=5084 5084 bug] ]&lt;br /&gt;
&lt;br /&gt;
* MTA won't start on Ubuntu 12.04 LTS [Temporary fix is available [http://forum.mtasa.com/viewtopic.php?p=434011#p434011 here] ]&lt;br /&gt;
&lt;br /&gt;
===Other issues===&lt;br /&gt;
* MTA isn't starting (even with fonts installed)&lt;br /&gt;
#Try to start MTA:SA in a virtual desktop&lt;br /&gt;
#:Go to WineConfig, choose the tab &amp;quot;Graphics&amp;quot; and select &amp;quot;Emulate a virtual desktop&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
#Try to delete your gta_sa.set file&lt;br /&gt;
#:which is located in the &amp;quot;GTA San Andreas User Files&amp;quot; folder, which can be found in your home directory.&amp;lt;br&amp;gt;'''(Remember to create a copy, if you're playing San Andreas in singleplayer)'''&lt;br /&gt;
#Try to delete your MTA config file&lt;br /&gt;
#:which is: &amp;quot;MTA San Andreas 1.3/MTA/coreconfig.xml&amp;quot;&amp;lt;br&amp;gt;'''(Also remember to create a copy, if you don't want to lose your edited MTA configuration)'''&lt;br /&gt;
&lt;br /&gt;
* Crash when connecting&lt;br /&gt;
*:Sometimes the audio-server makes problems (could be related to PulseAudio), in this case, you've to go to WineConfig and choose the tab Audio, then deselect &amp;quot;ALSA&amp;quot; and select &amp;quot;EsoundD&amp;quot;. Save the settings and restart MTA.&lt;br /&gt;
* Crash in basswma.dll module while streaming audio&lt;br /&gt;
*:Install Windows Media Player 10&lt;br /&gt;
*:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
winetricks wmp10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Special Detections (SD)&lt;br /&gt;
*:If you are using a 64 wine version you may have problems with [http://wiki.multitheftauto.com/wiki/Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E Special Detections]. If the server you are trying to connect keeps showing something like [http://i.imgur.com/33T8a82.jpg this], then you should make a [http://wiki.archlinux.org/index.php/Wine#Using_WINEARCH 32 bit wine prefix] (or bottle).&lt;br /&gt;
*:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;export WINEARCH=win32 WINEPREFIX=~/.winegta&lt;br /&gt;
winecfg&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change Windows version on the bottom to Windows 7 and press OK. Now you have a 32-bit wine prefix on ~/.winegta.&lt;br /&gt;
Install GTA:SA and them MTA.&lt;br /&gt;
After this, MTA and GTA have been installed within ~/.winegta prefix which is a 32-bit wine environment.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://nightly.mtasa.com/ nightly.mtasa.com] - For nightly builds.&lt;br /&gt;
* https://bugs.mtasa.com/view.php?id=8895 - a bug report containing useful info for running MTA in Wine&lt;br /&gt;
[[Category:Support]]&lt;br /&gt;
[[ru:Client on Linux Manual]]&lt;br /&gt;
[[hu:Client on Linux Manual]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Branches&amp;diff=65898</id>
		<title>Branches</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Branches&amp;diff=65898"/>
		<updated>2020-04-19T19:54:08Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Weapon Creation ==&lt;br /&gt;
Weapon creation is a branch for creating weapon elements which can fire bullets and do not require ped/players assigned to them.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|'''Status'''&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Merged - 1.3.1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch'''&lt;br /&gt;
|[https://github.com/multitheftauto/mtasa-blue/tree/weapon-creation Weapon-Creation]&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch version'''&lt;br /&gt;
|1.4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
{{Client_weapon_creation_functions}}&lt;br /&gt;
&lt;br /&gt;
=== General Notes ===&lt;br /&gt;
Created entities are for all intent and purpose objects so any object function will work on them like attachElements, setElementAlpha and such.&lt;br /&gt;
&lt;br /&gt;
=== Media ===&lt;br /&gt;
* http://youtu.be/LN1nZZnzlms&lt;br /&gt;
&lt;br /&gt;
== Custom Animations ==&lt;br /&gt;
Custom Animations is a branch for loading animations from .ifp files&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|'''Status'''&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Abandoned&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch'''&lt;br /&gt;
|[https://github.com/multitheftauto/mtasa-blue/tree/Custom-Animations Custom-Animations]&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch version'''&lt;br /&gt;
|1.4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
* [[engineLoadIFP]]&lt;br /&gt;
* [[engineUnloadIFP]]&lt;br /&gt;
&lt;br /&gt;
=== Media ===&lt;br /&gt;
* http://youtu.be/D9YfVPiJniU&lt;br /&gt;
&lt;br /&gt;
=== General Notes ===&lt;br /&gt;
See [[User:Cazomino05]] for bugs.&lt;br /&gt;
&lt;br /&gt;
== Custom Weapon Stats ==&lt;br /&gt;
Custom Weapon Stats is a branch to allow people to edit one of each weapon &amp;quot;properties&amp;quot; for each skill level&lt;br /&gt;
so, for example, an M4 at the Pro level can have 1000 damage and an M4 at a standard level can have 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|'''Status'''&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Merged - 1.3.1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch'''&lt;br /&gt;
|[https://github.com/multitheftauto/mtasa-blue/tree/Custom-Weapon-Stats Custom-Weapon-Stats]&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch version'''&lt;br /&gt;
|1.4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
* [[getWeaponProperty]]&lt;br /&gt;
* [[setWeaponProperty]]&lt;br /&gt;
&lt;br /&gt;
=== Media ===&lt;br /&gt;
* http://youtu.be/M1dQWpDFq98&lt;br /&gt;
* http://youtu.be/xfdEvpcuk7s&lt;br /&gt;
* http://youtu.be/eDU06fZiU9M&lt;br /&gt;
&lt;br /&gt;
=== General Notes ===&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Analog Control States ==&lt;br /&gt;
The Analog Control States is a branch that is designed to allow proper setting and management of controls and therefore allows for the setting of controls to be between the range of 0 and 1 rather than true/false&lt;br /&gt;
&lt;br /&gt;
This only works for certain properties such as left/right&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|'''Status'''&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Merged - 1.3.1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch'''&lt;br /&gt;
|[https://github.com/multitheftauto/mtasa-blue/tree/Analog-Control-States Analog-Control-States]&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch version'''&lt;br /&gt;
|1.4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
* [[setAnalogControlState]]&lt;br /&gt;
* [[getAnalogControlState]]&lt;br /&gt;
&lt;br /&gt;
=== Media ===&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== General Notes ===&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Custom-Vehicle-Sirens ==&lt;br /&gt;
Custom Vehicle Sirens allows adding sirens to any individual vehicle in the game for instance to add an undercover sultan.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|'''Status'''&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Merged - 1.3.1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch'''&lt;br /&gt;
|[https://github.com/multitheftauto/mtasa-blue/tree/Custom-Vehicle-Sirens Custom-Vehicle-Sirens]&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch version'''&lt;br /&gt;
|1.4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
* [[SetVehicleSirens]]&lt;br /&gt;
* [[GetVehicleSirens]]&lt;br /&gt;
* [[RemoveVehicleSirens]]&lt;br /&gt;
* [[GetVehicleSirenParams]]&lt;br /&gt;
* [[AddVehicleSirens]]&lt;br /&gt;
&lt;br /&gt;
=== Media ===&lt;br /&gt;
* http://youtu.be/zjJdLCtKccA&lt;br /&gt;
* http://youtu.be/ZJDrVf3qSm0&lt;br /&gt;
* http://youtu.be/1J0_v85FioA&lt;br /&gt;
* http://youtu.be/X3zE6hZOx4c&lt;br /&gt;
&lt;br /&gt;
=== General Notes ===&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Custom-Train-Tracks ==&lt;br /&gt;
See the main page for this branch ([[Custom Train Tracks]]) for more information.&lt;br /&gt;
{{:Custom_Train_Tracks}}&lt;br /&gt;
&lt;br /&gt;
== Awesomium ==&lt;br /&gt;
Possibility to create in-game browser.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|'''Status'''&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Merged - 1.5&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch'''&lt;br /&gt;
|[https://github.com/multitheftauto/mtasa-blue/tree/awesomium Awesomium]&lt;br /&gt;
|-&lt;br /&gt;
|'''Branch version'''&lt;br /&gt;
|1.5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
See [[User:Jusonex]].&lt;br /&gt;
&lt;br /&gt;
=== Media ===&lt;br /&gt;
* http://youtu.be/9w2qU6mZDh8&lt;br /&gt;
* http://youtu.be/qvqc1ScZSbM&lt;br /&gt;
* http://youtu.be/cyUw1F6uBig&lt;br /&gt;
&lt;br /&gt;
=== General notes ===&lt;br /&gt;
See [[User:Jusonex]].&lt;br /&gt;
&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Building_MTASA_Server_on_GNU_Linux&amp;diff=65897</id>
		<title>Building MTASA Server on GNU Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Building_MTASA_Server_on_GNU_Linux&amp;diff=65897"/>
		<updated>2020-04-19T19:53:00Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs Checking|Confirm steps work.}}&lt;br /&gt;
&lt;br /&gt;
== Installing and Running MTASA server on Linux ==&lt;br /&gt;
{{Note|This article is only for developers who changed the server code if you are looking for the precompiled server (for normal server owners). Go to: [http://linux.mtasa.com/ linux.mtasa.com] and see [[Installing and Running MTASA Server on GNU_Linux]]}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Compiling on a 64 bit Linux ==&lt;br /&gt;
Additional steps for compiling a MTA server on 64 bit Linux:&lt;br /&gt;
===Install 32 bit libs for your 64 bit distro===&lt;br /&gt;
For 64 bit Debian, this is achieved with:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ia32-libs&lt;br /&gt;
&lt;br /&gt;
===64 bit Troubleshooting===&lt;br /&gt;
* If you get a problem with such as &amp;quot;libreadline.so.5: cannot open shared object file: No such file or directory.&amp;quot;, it can be solved on 64 bit Debian Squeeze  by doing this:&lt;br /&gt;
&lt;br /&gt;
 apt-get install lib32readline5&lt;br /&gt;
&lt;br /&gt;
* If you get a problem with such as &amp;quot;libncursesw.so.5 cannot open shared object file: No such file or directory&amp;quot;, it can be solved on 64 bit Debian Squeeze by doing this:&lt;br /&gt;
&lt;br /&gt;
 apt-get install lib32ncursesw5&lt;br /&gt;
&lt;br /&gt;
* Further 64 bit solutions can be found [http://forum.mtasa.com/viewtopic.php?f=106&amp;amp;t=35328#p367282 on the forums]&lt;br /&gt;
&lt;br /&gt;
* If you are using Cent OS and you get something like /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by xmll.so) this can be resolved by doing downloading the archive [[http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/9/Fedora/i386/os/Packages/libstdc++-4.3.0-8.i386.rpm here]] and unpacking it with the following command:&lt;br /&gt;
&lt;br /&gt;
 rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i --make-directories&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Preparing your system ==&lt;br /&gt;
&lt;br /&gt;
In order to build the Multi Theft Auto dedicated server, you will have to set up your system with the correct libraries and tools. How these are installed depends on your distribution.&lt;br /&gt;
&lt;br /&gt;
Our network module (net.dll or net.so) is distributed as a precompiled binary library. The file for GNU/Linux can be found inside the lastest Linux nightly from [http://nightly.mtasa.com/ here]. Use the net.so from {{Current Version|master}} if you are compiling from the trunk, or the net.so from {{Current Version|full}} if you are compiling the {{Current Version|full}} branch. Be sure the read the top of ''Server/version.h'' as it contains directions on how to compile the different build types.&lt;br /&gt;
&lt;br /&gt;
=== Debian Linux ===&lt;br /&gt;
&lt;br /&gt;
Includes derivative distributions such as Ubuntu.&lt;br /&gt;
&lt;br /&gt;
You will need the necessary build tools, headers and libraries, which are distributed through the following Debian packages (e.g. Debian Lenny):&lt;br /&gt;
&lt;br /&gt;
* '''build-essential:''' contains the necessary tools, headers and libraries to build applications&lt;br /&gt;
* '''automake:''' contains the automake tools&lt;br /&gt;
* '''libtool:''' contains the libtool software required to build libraries&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''libcurl3-dev:''' contains the cURL library (version 3 without SSL support)&lt;br /&gt;
* '''libpcre3-dev:''' contains the PCRE library (version 3)&lt;br /&gt;
* '''libsqlite3-dev:''' contains the SQLite library (version 3)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* '''libreadline-gplv2-dev:''' contains the readline library (version 5)&lt;br /&gt;
* '''libncurses5-dev:''' contains software for controlling writing to the console screen&lt;br /&gt;
* '''libncursesw5-dev:''' contains support for wide characters&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''libsparsehash-dev:''' contains support for Google's hash-map '''(So you don't have to compile sparehash!)'''&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* '''default-libmysqlclient-dev:''' contains the MySQL library&lt;br /&gt;
* '''git:''' contains the git client used to check out our code repository&lt;br /&gt;
To install these packages through apt, use the apt-get install &amp;lt;package list&amp;gt; command as in the following example (execute as root):&lt;br /&gt;
&lt;br /&gt;
 apt-get install build-essential automake libtool&lt;br /&gt;
 apt-get install libreadline-gplv2-dev libncurses5-dev libncursesw5-dev&lt;br /&gt;
 apt-get install default-libmysqlclient-dev git &lt;br /&gt;
&lt;br /&gt;
Note: On Debian 8 systems please use this: '''apt-get install build-essential automake libtool libreadline-gplv2-dev libncurses5-dev libncursesw5-dev libmysqlclient-dev git'''&lt;br /&gt;
=== Gentoo Linux ===&lt;br /&gt;
You will need the necessary build tools, headers, and libraries. Because Gentoo’s portage system is designed to compile any packages on your own system, the necessary build tools will have already been installed. This only leaves you to install the necessary libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''sqlite:''' contains the SQLite library&lt;br /&gt;
* '''curl:''' contains the cURL library; to compile with SSL support, apply the net-misc/curl SSL USE flag&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* '''git:''' contains the git client used to check out our code repository&lt;br /&gt;
To compile and install these packages through emerging, use the emerge -v &amp;lt;package list&amp;gt; command. The -v option shows additional * * information and can be omitted. (If you want to use any USE flags, prepend emerge with USE=&amp;quot;use flags here&amp;quot;. You can also use the -pv option to verify that you’re using the correct flags.) Refer to the [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;amp;chap=1 Gentoo Handbook] or manual for more information on emerge.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 emerge -v git sqlite&lt;br /&gt;
 USE=“net-misc/curl ssl” emerge -v curl&lt;br /&gt;
&lt;br /&gt;
=== Fedora ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will need these packages to be able to successfully compile a MTA server on Fedora: &lt;br /&gt;
* '''glibc-devel:'''&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''curl-devel:''' contains the cURL library&lt;br /&gt;
* '''pcre-devel:''' contains the PCRE library&lt;br /&gt;
* '''sqlite3-devel:''' contains the SQLite library&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* '''readline-devel:''' contains the readline library&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* '''lua-devel:''' contains the Lua libraries&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* '''git:''' contains the git client to check out the source code&lt;br /&gt;
To install these packages through yum, use the yum install &amp;lt;package list&amp;gt; command as in the following example (execute as root):&lt;br /&gt;
&lt;br /&gt;
 yum install glibc-devel readline-devel git&lt;br /&gt;
&lt;br /&gt;
== General instructions for {{Current Version|master}} ==&lt;br /&gt;
&lt;br /&gt;
'''Downloading the source.'''&lt;br /&gt;
&lt;br /&gt;
First, you need to download the source. Either clone as shown below or [https://github.com/multitheftauto/mtasa-blue/archive/master.zip download a zip snapshot]&lt;br /&gt;
&lt;br /&gt;
 git clone &amp;lt;nowiki&amp;gt;https&amp;lt;/nowiki&amp;gt;://github.com/multitheftauto/mtasa-blue.git mtasa-blue&lt;br /&gt;
 cd mtasa-blue&lt;br /&gt;
&lt;br /&gt;
Then compile it thus:&lt;br /&gt;
&lt;br /&gt;
 ./linux-build.sh&lt;br /&gt;
&lt;br /&gt;
Then copy the configuration files, network module and resources into '''Bin/server''' by running this command:&lt;br /&gt;
&lt;br /&gt;
 ./linux-install-data.sh&lt;br /&gt;
&lt;br /&gt;
And the resources and stuff should be downloaded and stuff. As well as the net_d.dll file.&lt;br /&gt;
&lt;br /&gt;
=== '''Troubleshooting''' ===&lt;br /&gt;
&lt;br /&gt;
If you’re getting any unexpected errors while compiling, please check our [http://bugs.mtasa.com/ Bug tracker] or our [irc://irc.multitheftauto.com/ IRC channel]&lt;br /&gt;
&lt;br /&gt;
[[ru:Building MTASA Server on GNU Linux]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65896</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65896"/>
		<updated>2020-04-19T19:52:26Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
Please read the instructions carefully and do not skip parts of it, if you have no experience.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Compiling the Multi Theft Auto client is only supported on Windows 10.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the following software and SDKs installed:&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio 2019 ===&lt;br /&gt;
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]&lt;br /&gt;
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2019]''' - make sure you get the Community Edition, that one is free.&lt;br /&gt;
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these two items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''C++ MFC for latest v142 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
&lt;br /&gt;
If you don't enable MFC, you will get the following error: &amp;lt;code&amp;gt;cannot open include file 'afxres.h'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you've made a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.&lt;br /&gt;
&lt;br /&gt;
=== Microsoft DirectX SDK ===&lt;br /&gt;
[[File:DirectX_SDK.jpg|right|150px|link=https://www.microsoft.com/en-us/download/details.aspx?id=23549]]&lt;br /&gt;
'''Download'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.microsoft.com/en-us/download/details.aspx?id=23549 Microsoft DirectX SDK (August 2009)]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.h'''&amp;lt;br&amp;gt;&lt;br /&gt;
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.&lt;br /&gt;
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. &lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.lib'''&amp;lt;br&amp;gt;&lt;br /&gt;
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field&lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''S1023 Error'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://support.microsoft.com/en-us/kb/2728613 &amp;quot;S1023&amp;quot; error when you install the DirectX SDK (June 2010)]&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]&lt;br /&gt;
&lt;br /&gt;
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].&lt;br /&gt;
&lt;br /&gt;
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).&lt;br /&gt;
&lt;br /&gt;
== Getting the latest source code ==&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository.&amp;lt;br&amp;gt;&lt;br /&gt;
We recommend cloning the repository in your Git client because you can pull any updates from there easily.&lt;br /&gt;
&lt;br /&gt;
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]&lt;br /&gt;
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]&lt;br /&gt;
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== Compiling the code ==&lt;br /&gt;
# Execute the script '''win-create-projects.bat'''&lt;br /&gt;
# Open the solution file '''MTASA.sln''' in the '''Build''' directory&lt;br /&gt;
# If you are asked to upgrade the project, click '''Cancel'''&lt;br /&gt;
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)&lt;br /&gt;
# Execute the script '''win-install-data.bat'''&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
== Running the client ==&lt;br /&gt;
&lt;br /&gt;
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Running the dedicated server ==&lt;br /&gt;
&lt;br /&gt;
If you already have run step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can go to ''Starting the server''.&lt;br /&gt;
&lt;br /&gt;
=== Installing the latest resources ===&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.&lt;br /&gt;
&lt;br /&gt;
=== Starting the server ===&lt;br /&gt;
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compiling the code'' and follow the steps for a ''Debug'' build.&amp;lt;br&amp;gt;&lt;br /&gt;
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Local_Windows_Debugger.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== How to enable breakpoints ===&lt;br /&gt;
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise, your&lt;br /&gt;
breakpoints will not work for anything besides the MTA Launcher project.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Attach_to_Process.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Extending timeout duration ===&lt;br /&gt;
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory.  &lt;br /&gt;
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.&lt;br /&gt;
&lt;br /&gt;
=== ReAttach for Visual Studio ===&lt;br /&gt;
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ReAttach_to_GTASA.PNG]]&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on the coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
= Errors =&lt;br /&gt;
== CL38 error. [netc_d.dll not found] ==&lt;br /&gt;
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.&lt;br /&gt;
&lt;br /&gt;
== After cloning the repository, it doesn't compile the project ==&lt;br /&gt;
Solution: Execute '''win-create-projects.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[hu:Compiling MTASA]]&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=65895</id>
		<title>Access Control List</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=65895"/>
		<updated>2020-04-19T19:50:15Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA includes a complete Access Control List (ACL) that allows you to secure and limit access to the server, its functions, and resources in any number of ways.&lt;br /&gt;
&lt;br /&gt;
The key concept of MTA's ACL (and ACLs in general) is that you're giving a specific object a set of rights. In MTA's case objects is one of two things - resources or users. There are numerous ''rights'' available in MTA - these mainly focus on server-side scripting functions. &lt;br /&gt;
&lt;br /&gt;
What this essentially means is that the ACL allows you to choose exactly what functions a resource or user can perform. This can obviously be invaluable - for example preventing all your server's players from being able to ban each other, or preventing your new untested resources from doing the same. &lt;br /&gt;
&lt;br /&gt;
Of course, ''with great power comes great responsibility'' and it is very easily possible to completely break resources - for example, disabling [[spawnPlayer]] for all resources would be a Bad Thing. Of course, there are situations when you might want to do this - if you want to force all your resources to use a spawn manager resource for example, but even this is somewhat draconian.&lt;br /&gt;
&lt;br /&gt;
==Understanding the ACL==&lt;br /&gt;
There are two major components to the ACL: groups and ACL lists. They appear as '''&amp;lt;group name=&amp;quot;&amp;quot;&amp;gt;''' nodes and '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. Their purpose is to:&amp;lt;br \&amp;gt;&lt;br /&gt;
'''1.''' Grant users permission to control the server and use resource commands. Examples:''&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing only admins to use the giveweapon function of freeroam&lt;br /&gt;
*Allowing all users to start a resource&lt;br /&gt;
'''2.''' Grant resources permission to use script functions and functions of other resources. Examples:&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing a resource to use the restartResource function&lt;br /&gt;
*Allowing a resource to use the call function to use exported functions from another script&lt;br /&gt;
&lt;br /&gt;
===Default Groups===&lt;br /&gt;
MTA has provided some default groups with increasing permissions. These groups are:&lt;br /&gt;
*'''Everyone'''&lt;br /&gt;
*'''Moderator'''&lt;br /&gt;
*'''SuperModerator'''&lt;br /&gt;
*'''Admin'''&lt;br /&gt;
*'''Console''' - This controls permissions of people who are using the console through '''&amp;lt;object name=&amp;quot;user.Console&amp;quot; /&amp;gt;'''&lt;br /&gt;
*'''RPC''' - Remote Procedure Call. Specifically grants access to [[callRemote]] only and disables commands of default resources. Check the function for details.&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To explain further, I will use the Everyone group as an example. By default it looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;    &amp;lt;group name=&amp;quot;Everyone&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.*&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.*&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
You will first notice the acl name inside the group. It defines what permissions the group has. Users and resources in this group will have the permissions specified on the &amp;quot;Default&amp;quot; acl name list. ''Note: You will notice this group is special, in that it includes every user and resource by using a '''wildcard (*)''' where the user or resource name would be.''&lt;br /&gt;
&lt;br /&gt;
Now, scroll further down the ACL and you will see the '''&amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;''' listing. Note I have trimmed this list dramatically due to its length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;    &amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.start&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stop&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stopall&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.executeCommandHandler&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.restartResource&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_players&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_resources&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.shout&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.spectate&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
*'''Function''' entries are MTA scripting functions. For example, if a resource needed to use restartResource and was only in the 'Everyone' group (with the 'Default' list), it would be denied access to restartResource and fail to work correctly.&lt;br /&gt;
*'''Commands''' are created when a resource uses [[addCommandHandler]]. An example would be typing '''/createvehicle [vehicle]''' in the chatbox for the freeroam resource. This controls whether users in the group using this ACL can use the command. ''Note: commands have no effect on resources within the group. Commands are only related to users.''&lt;br /&gt;
**''General is a custom right name group created by the admin resource but it works on the same principles. The script works with them by using [[hasObjectPermissionTo]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice some groups such as admin have multiple '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. An example is the admin group:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.webadmin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.Random&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives all the permissions defined in each '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' node in order of listing. So for example, the admin group makes sure all the permissions are given to admins by using all the lists. If there are any conflicts, the lowest entry wins. For example, pretend these 2 acls were in a group in the following order:&lt;br /&gt;
&lt;br /&gt;
'''1.''' '''&amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''2.''' '''&amp;lt;acl name=&amp;quot;Admin&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''3.''' For all users and resources in group admin: &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource Groups and ACLs ===&lt;br /&gt;
You will notice there are some other groups that came with MTA. These were defined by resources that came with MTA. If a resource wants to designate specific ACL rights not provided by the default MTA groups, it can create its own ACL name and a group to use it. I will show AMX's entry as an example. AMX is designed to emulate SA-MP scripts and it needs a certain set of permissions that don't fit the default groups well. It is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;AMX&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.amx&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.kick&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.mute&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Grant resources access to other resources ===&lt;br /&gt;
To allow resource access to any other resource, you have to allow it explicitly in your ACL file. The rule &amp;lt;code&amp;gt;general.ModifyOtherObjects&amp;lt;/code&amp;gt; grants full access to any resource on the server.&lt;br /&gt;
See the example in the last section of what it should look like.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0156|1.5.5|14166|&lt;br /&gt;
If you don't want to grant a resource complete access to every resource on the server, then you can append the modifiable resource's name preceded by a dot (.) to the &amp;lt;code&amp;gt;general.ModifyOtherObjects&amp;lt;/code&amp;gt; rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;Custom&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.resourceName&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.admin&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.runcode&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.mapmanager&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ACL definitions above will grant any resource with the ACL '''Custom''' access to the resources ''resourceName'', ''admin'', ''runcode'' and ''mapmanager''.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Modifying the ACL==&lt;br /&gt;
There are three ways you can modify the ACL - how you do it depends on who you are.&lt;br /&gt;
&lt;br /&gt;
===HTTP Interface===&lt;br /&gt;
You can use the [[Resource/webadmin|webadmin]] HTTP interface to modify the ACL in your web browser. This is by far the easiest way to do so. Just make sure the ''webadmin'' resource is started on your server and visit ''&amp;lt;nowiki&amp;gt;http://ServerIP:HttpPort/&amp;lt;/nowiki&amp;gt;''. You can then use the two sections - ACLs and Groups. ACLs allow you to create your Access Control Lists - lists of rights. Groups allow you to group together collections of users and assign ACLs to them. For example, the ACLs section allows you to specify that the Admin ACL has access to the ''start'' console command. You can go to the Groups section and create an Admin ''group'' that has access to your Admin ''acl''. You can then add users to your Admin ''group''.&lt;br /&gt;
&lt;br /&gt;
===XML file===&lt;br /&gt;
You can modify the ACL.xml file manually. This has a fairly straightforward syntax, but it can get a bit confusing at times. If you do it while the server is running, don't forget to call the scripting function [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;) so the new ACL is loaded, or otherwise stop your server before modifying. This also prevents your changes from being accidentally overwritten by the server.&lt;br /&gt;
&lt;br /&gt;
===Scripting functions===&lt;br /&gt;
You can use a large number of ACL scripting functions to modify the ACL on the fly. Of course, you can (and really should!) limit access to the ACL functions with the ACL. Note that the '''admin resource''' that comes with MTA can be used to manage the ACL from the resources tab. You must be set up as admin to use the admin panel. [http://wiki.multitheftauto.com/wiki/Admin Click here for admin setup instructions].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:ACL]]&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Access Control List]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Writing_Gamemodes&amp;diff=65894</id>
		<title>Writing Gamemodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Writing_Gamemodes&amp;diff=65894"/>
		<updated>2020-04-19T19:49:46Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide tries to outline the process of how to write a proper gamemode. If you just started with scripting for MTA, you may want to check the other scripting tutorials at the [[Main Page]] first.&lt;br /&gt;
==Introduction==&lt;br /&gt;
A gamemode is a resource that, once started, controls all of the gameplay. This may include telling the players what to do, spawning players, creating teams, defining what the players have to do to win or to get points and much more. Examples are Race and Deathmatch. &lt;br /&gt;
&lt;br /&gt;
==What does &amp;quot;proper gamemode&amp;quot; mean?==&lt;br /&gt;
To put it simply, a proper gamemode is one that makes full use of MTA's .map file system. This means that the gamemode code does not have any map-specific data hardcoded in it, like the positions of players or cars. Instead, the gamemode should be able to load .map files which define these data. This way the gamemode can have multiple maps; also, people can create .map files for the gamemode with MTA's map editor, which is much more convenient than writing code.&lt;br /&gt;
&lt;br /&gt;
An obvious example of a &amp;quot;proper gamemode&amp;quot; is MTA:Race. It allows user-made maps with lots of possibilities within the .map file. To alter spawnpoints, objects, etc., the user doesn't need to edit the gamemode itself.&lt;br /&gt;
&lt;br /&gt;
===Map Files===&lt;br /&gt;
Map files are basically XML documents with a .map extension. They define an environment to play one or more specific gamemodes in. They are however not supposed to change the rules of the game - those are defined by the gamemode.&lt;br /&gt;
&lt;br /&gt;
Each element in a map corresponds to a node in the .map file. There is standard syntax for common things like spawnpoints, objects, and vehicles; however, for &amp;quot;special&amp;quot;, gamemode specific information, you need to invent your own syntax.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
Let's take a Capture the Flag gamemode as an example. A map for this gamemode needs to mainly define spawnpoints and flag locations, and eventually objects and vehicles. A simplified map file could look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint1&amp;quot; posX=&amp;quot;1959.5487060547&amp;quot; posY=&amp;quot;-1714.4613037109&amp;quot; posZ=&amp;quot;877.25219726563&amp;quot; rot=&amp;quot;63.350006103516&amp;quot; model=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;pickup id=&amp;quot;Armor 1&amp;quot; posX=&amp;quot;1911.083984375&amp;quot; posY=&amp;quot;-1658.8798828125&amp;quot; posZ=&amp;quot;885.40216064453&amp;quot; type=&amp;quot;armor&amp;quot; health=&amp;quot;50&amp;quot; respawn=&amp;quot;60000&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;flag posX=&amp;quot;1959.5487060547&amp;quot; posY=&amp;quot;-1714.4613037109&amp;quot; posZ=&amp;quot;877.25219726563&amp;quot; team=&amp;quot;blue&amp;quot; /&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here you can see two MTA elements - a spawnpoint and a pickup. More importantly, this .map has a custom &amp;quot;flag&amp;quot; node that defines the position and color of the flag. The spawnpoint and pickup can be handled by existing external resources, custom elements have to be processed by the gamemode.&lt;br /&gt;
&lt;br /&gt;
To summarize - we want mass mapper input as we saw in MTA:Race. Users should NOT have to touch the gamemode script itself at all.&lt;br /&gt;
&lt;br /&gt;
====Example of getting the .map information====&lt;br /&gt;
As mentioned above, your gamemode needs de retrieve custom elements that are defined in a map file and process them. This is quite easy as demonstrated below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- retrieve a table with all flag elements&lt;br /&gt;
local flagElements = getElementsByType ( &amp;quot;flag&amp;quot; )&lt;br /&gt;
-- loop through them&lt;br /&gt;
for key, value in pairs(flagElements) do&lt;br /&gt;
	-- get our info&lt;br /&gt;
	local posX = getElementData ( value, &amp;quot;posX&amp;quot; )&lt;br /&gt;
	local posY = getElementData ( value, &amp;quot;posY&amp;quot; )&lt;br /&gt;
	local posZ = getElementData ( value, &amp;quot;posZ&amp;quot; )&lt;br /&gt;
	local team = getElementData ( value, &amp;quot;team&amp;quot; )&lt;br /&gt;
	-- create an object according to the flag position&lt;br /&gt;
	createObject ( 1337, posX, posY, posZ )&lt;br /&gt;
	-- output the team that we created a base for&lt;br /&gt;
	outputChatBox ( &amp;quot;Base for team &amp;quot; .. team .. &amp;quot; created&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The [[getElementsByType]] function retrieves a table of all the elements of a certain type (the type corresponds to the node name in the .map file). This works for both custom types and built-in MTA types (like &amp;quot;vehicle&amp;quot; or &amp;quot;player&amp;quot;).&lt;br /&gt;
[[getElementData]] can be used to retrieve the xml attributes set in the .map file.&lt;br /&gt;
In this simple example, an object is created at the flag's location and a message is outputted in the chatbox. In reality, you will of course need to do more during map loading, like in this case setting up collision shapes to detect players taking the flag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Map manager==&lt;br /&gt;
Having read the section above it should be clear that a gamemode should always consist of two parts:&lt;br /&gt;
* The gamemode resource that always stays the same&lt;br /&gt;
* Many different maps resources that give the gamemode map-specific information&lt;br /&gt;
&lt;br /&gt;
Now instead of writing a map-loader for every single gamemode, the [[Map manager]] provides functions to load gamemodes and maps. Simply put, when you enter the correct command (for example 'gamemode ctf ctf-italy') it will start both resources 'ctf' and 'ctf-italy' while triggering an event ([[onGamemodeMapStart]]) to tell the 'ctf' resource that a map was loaded. The 'ctf' resource can then access the information 'ctf-italy' contains and start spawning players etc.&lt;br /&gt;
&lt;br /&gt;
===How to use the mapmanager===&lt;br /&gt;
To use the mapmanager service, your gamemode resource has to be tagged as such first. More specifically you'll be setting the &amp;quot;type&amp;quot; attribute of its &amp;lt;info&amp;gt; tag to &amp;quot;gamemode&amp;quot; inside meta.xml. Also, you can set the &amp;quot;name&amp;quot; attribute to a friendly name (like &amp;quot;Capture the flag&amp;quot;) that will be shown on ASE instead of the resource name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- meta.xml in &amp;quot;cowcatapult&amp;quot; gamemode --&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info type=&amp;quot;gamemode&amp;quot; name=&amp;quot;Cow catapulting 2.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your gamemode is going to load custom maps, you should add handlers for&lt;br /&gt;
* onGamemodeMapStart&lt;br /&gt;
* onGamemodeMapStop (if any unloading is necessary)&lt;br /&gt;
These are fired when a map for your gamemode is started or stopped, and pass the map resource as a parameter.&lt;br /&gt;
Within the handler function for these events, you can extract all info you need from the resource's map files and configuration files.&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 startCtfMap( startedMap ) -- startedMap contains a reference to the resource of the map&lt;br /&gt;
    local mapRoot = getResourceRootElement( startedMap )        -- get the root node of the started map&lt;br /&gt;
    local flagElements = getElementsByType ( &amp;quot;flag&amp;quot; , mapRoot ) -- get all flags in the map and store them in a table&lt;br /&gt;
    -- go on loading information like in the example above&lt;br /&gt;
    -- spawn players etc.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onGamemodeMapStart&amp;quot;, getRootElement(), startCtfMap)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Making maps compatible===&lt;br /&gt;
Maps are separate resources. This is done so no editing of the gamemode resource is ever necessary in order to create a custom map, and also allows you to pack map-specific scripts/config files with them.&lt;br /&gt;
&lt;br /&gt;
To make a map compatible with your gamemode, open its resource's meta.xml and tag it as well: the &amp;quot;type&amp;quot; attribute must be set to &amp;quot;map&amp;quot;, and the &amp;quot;gamemodes&amp;quot; attribute must be a comma-separated list (no spaces) of gamemode resource names that the map works with.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--map's meta.xml--&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;cowcatapult,assault,tdm&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have everything set up, admins will use these two commands to start/stop gamemodes:&lt;br /&gt;
/gamemode gamemodeName [mapName] (optional parameter allows picking an initial map, defaults to none)&lt;br /&gt;
/changemap mapName [gamemodeName] (optional parameter specifies the gamemode to start the map with, defaults to the current one)&lt;br /&gt;
&lt;br /&gt;
[[Map manager]] exports a few more access functions which you don't have to use, but may be useful.&lt;br /&gt;
&lt;br /&gt;
==What else should you do==&lt;br /&gt;
There are several other resources that gamemodes should use/be compliant with.&lt;br /&gt;
&lt;br /&gt;
===Helpmanager===&lt;br /&gt;
The helpmanager is ought to be the standard interface for players when they need help. If you use the helpmanager to display your gamemode's help, every player that used helpmanager before (e.g. in other gamemodes) will immediately know how to get there. It also displays help for different resources running resources in one window, if necessary.&lt;br /&gt;
&lt;br /&gt;
There are basically two ways to use the helpmanager:&lt;br /&gt;
* Provide a simple text that explains how to use your gamemode&lt;br /&gt;
* Request a GUI element from the helpmanager that will be displayed in its own tab in the helpmanager window and lets you add any GUI elements to it. This is the recommended way for gamemodes that need to display more complex information that needs its own GUI.&lt;br /&gt;
&lt;br /&gt;
Read the [[Resource:Helpmanager|helpmanager help page]] for details on how to do it.&lt;br /&gt;
&lt;br /&gt;
===Scoreboard===&lt;br /&gt;
The scoreboard displays players and teams currently in-game. You add custom columns to it to provide map specific information. For example the column 'points' in the 'ctf' gamemode could represent the player's points gained through kills or captures. As usual, see the [[Resource:Dxscoreboard|scoreboard help page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Map cycler===&lt;br /&gt;
The map cycler controls what gamemodes and maps are played on a server. You can specify for example how many times in a row a map will be played until it switches to the next. To achieve this, you need to tell the map cycler when your gamemode finished (e.g. when a round ends).&lt;br /&gt;
&lt;br /&gt;
[[hu:Writing Gamemodes]]&lt;br /&gt;
[[it:Scrivere una gamemode]]&lt;br /&gt;
[[ru:Writing Gamemodes]]&lt;br /&gt;
[[de:Gamemodes schreiben]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=65893</id>
		<title>Access Control List</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=65893"/>
		<updated>2020-04-19T19:48:33Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA includes a complete Access Control List (ACL) that allows you to secure and limit access to the server, its functions, and resources in any number of ways.&lt;br /&gt;
&lt;br /&gt;
The key concept of MTA's ACL (and ACLs in general) is that you're giving a specific object a set of rights. In MTA's case objects is one of two things - resources or users. There are numerous ''rights'' available in MTA - these mainly focus on server-side scripting functions. &lt;br /&gt;
&lt;br /&gt;
What this essentially means is that the ACL allows you to choose exactly what functions a resource or user can perform. This can obviously be invaluable - for example preventing all your server's players from being able to ban each other, or preventing your new untested resources from doing the same. &lt;br /&gt;
&lt;br /&gt;
Of course, ''with great power comes great responsibility'' and it is very easily possible to completely break resources - for example, disabling [[spawnPlayer]] for all resources would be a Bad Thing. Of course, there are situations when you might want to do this - if you want to force all your resources to use a spawn manager resource for example, but even this is somewhat draconian.&lt;br /&gt;
&lt;br /&gt;
==Understanding the ACL==&lt;br /&gt;
There are two major components to the ACL: groups and ACL lists. They appear as '''&amp;lt;group name=&amp;quot;&amp;quot;&amp;gt;''' nodes and '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. Their purpose is to:&amp;lt;br \&amp;gt;&lt;br /&gt;
'''1.''' Grant users permission to control the server and use resource commands. Examples:''&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing only admins to use the giveweapon function of freeroam&lt;br /&gt;
*Allowing all users to start a resource&lt;br /&gt;
'''2.''' Grant resources permission to use script functions and functions of other resources. Examples:&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing a resource to use the restartResource function&lt;br /&gt;
*Allowing a resource to use the call function to use exported functions from another script&lt;br /&gt;
&lt;br /&gt;
===Default Groups===&lt;br /&gt;
MTA has provided some default groups with increasing permissions. These groups are:&lt;br /&gt;
*'''Everyone'''&lt;br /&gt;
*'''Moderator'''&lt;br /&gt;
*'''SuperModerator'''&lt;br /&gt;
*'''Admin'''&lt;br /&gt;
*'''Console''' - This controls permissions of people who are using the console through '''&amp;lt;object name=&amp;quot;user.Console&amp;quot; /&amp;gt;'''&lt;br /&gt;
*'''RPC''' - Remote Procedure Call. Specifically grants access to [[callRemote]] only and disables commands of default resources. Check the function for details.&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To explain further, I will use the Everyone group as an example. By default it looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;    &amp;lt;group name=&amp;quot;Everyone&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.*&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.*&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
You will first notice the acl name inside the group. It defines what permissions the group has. Users and resources in this group will have the permissions specified on the &amp;quot;Default&amp;quot; acl name list. ''Note: You will notice this group is special, in that it includes every user and resource by using a '''wildcard (*)''' where the user or resource name would be.''&lt;br /&gt;
&lt;br /&gt;
Now, scroll further down the ACL and you will see the '''&amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;''' listing. Note I have trimmed this list dramatically due to its length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;    &amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.start&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stop&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stopall&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.executeCommandHandler&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.restartResource&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_players&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_resources&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.shout&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.spectate&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
*'''Function''' entries are MTA scripting functions. For example, if a resource needed to use restartResource and was only in the 'Everyone' group (with the 'Default' list), it would be denied access to restartResource and fail to work correctly.&lt;br /&gt;
*'''Commands''' are created when a resource uses [[addCommandHandler]]. An example would be typing '''/createvehicle [vehicle]''' in the chatbox for the freeroam resource. This controls whether users in the group using this ACL can use the command. ''Note: commands have no effect on resources within the group. Commands are only related to users.''&lt;br /&gt;
**''General is a custom right name group created by the admin resource but it works on the same principles. The script works with them by using [[hasObjectPermissionTo]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice some groups such as admin have multiple '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. An example is the admin group:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.webadmin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.Random&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives all the permissions defined in each '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' node in order of listing. So for example, the admin group makes sure all the permissions are given to admins by using all the lists. If there are any conflicts, the lowest entry wins. For example, pretend these 2 acls were in a group in the following order:&lt;br /&gt;
&lt;br /&gt;
'''1.''' '''&amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''2.''' '''&amp;lt;acl name=&amp;quot;Admin&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''3.''' For all users and resources in group admin: &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource Groups and ACLs ===&lt;br /&gt;
You will notice there are some other groups that came with MTA. These were defined by resources that came with MTA. If a resource wants to designate specific ACL rights not provided by the default MTA groups, it can create its own ACL name and a group to use it. I will show AMX's entry as an example. AMX is designed to emulate SA-MP scripts and it needs a certain set of permissions that don't fit the default groups well. It is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;AMX&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.amx&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.kick&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.mute&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Grant resources access to other resources ===&lt;br /&gt;
To allow resource access to any other resource, you have to allow it explicitly in your ACL file. The rule &amp;lt;code&amp;gt;general.ModifyOtherObjects&amp;lt;/code&amp;gt; grants full access to any resource on the server.&lt;br /&gt;
See the example in the last section of what it should look like.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0156|1.5.5|14166|&lt;br /&gt;
If you don't want to grant a resource complete access to every resource on the server, then you can append the modifiable resource's name preceded by a dot (.) to the &amp;lt;code&amp;gt;general.ModifyOtherObjects&amp;lt;/code&amp;gt; rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;Custom&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.resourceName&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.admin&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.runcode&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects.mapmanager&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ACL definitions above will grant any resource with the ACL '''Custom''' access to the resources ''resourceName'', ''admin'', ''runcode'' and ''mapmanager''.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Modifying the ACL==&lt;br /&gt;
There are three ways you can modify the ACL - how you do it depends on who you are.&lt;br /&gt;
&lt;br /&gt;
===HTTP Interface===&lt;br /&gt;
You can use the [[Resource/webadmin|webadmin]] HTTP interface to modify the ACL in your web browser. This is by far the easiest way to do so. Just make sure the ''webadmin'' resource is started on your server and visit ''&amp;lt;nowiki&amp;gt;http://ServerIP:HttpPort/&amp;lt;/nowiki&amp;gt;''. You can then use the two sections - ACLs and Groups. ACLs allow you to create your Access Control Lists - lists of rights. Groups allow you to group together collections of users and assign ACLs to them. For example, the ACLs section allows you to specify that the Admin ACL has access to the ''start'' console command. You can go to the Groups section and create an Admin ''group'' that has access to your Admin ''acl''. You can then add users to your Admin ''group''.&lt;br /&gt;
&lt;br /&gt;
===XML file===&lt;br /&gt;
You can modify the ACL.xml file manually. This has a fairly straightforward syntax, but it can get a bit confusing at times. If you do it while the server is running, don't forget to call the scripting function [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;) so the new ACL is loaded, or otherwise stop your server before modifying. This also prevents your changes from being accidentally overwritten by the server.&lt;br /&gt;
&lt;br /&gt;
===Scripting functions===&lt;br /&gt;
You can use a large number of ACL scripting functions to modify the ACL on the fly. Of course, you can (and really should!) limit access to the ACL functions with the ACL. Note that the '''admin resource''' that comes with MTA can be used to manage the ACL from the resources tab. You must be setup as admin to use the admin panel. [http://wiki.multitheftauto.com/wiki/Admin Click here for admin setup instructions].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:ACL]]&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Access Control List]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource_Web_Access&amp;diff=65892</id>
		<title>Resource Web Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource_Web_Access&amp;diff=65892"/>
		<updated>2020-04-19T19:47:45Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Multi Theft Auto Server provides a web interface that resources can use in a variety of ways. This document's purpose is to explain what these ways are and how to go about using them.&lt;br /&gt;
{{Note|If you are looking for a tutorial on how to use the in-game web browser and create websites using CEF, please visit [[CEF_Tutorial|CEF Tutorial]] instead.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
There are two key parts that make up this system. The first is a standard web server that allows web browsers to request pages and files you have in a resource. The second is a system for allowing web browsers to call functions you have exported from your resource.&lt;br /&gt;
&lt;br /&gt;
==Pages==&lt;br /&gt;
===Specifying a file in the meta===&lt;br /&gt;
You can specify in your resource's meta file that certain files are accessible through the web server. To do this, you add a line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;filename.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can then access this file from your web browser by visiting: http://host:port/resourcename/filename.ext&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, on a locally hosted server using default http port with webmap started: http://127.0.0.1:22005/webmap/map.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary files===&lt;br /&gt;
Despite the misleading name, files specified using the html node can be of any type. If they are binary files (like images, zip files) then you need to specify this in the meta file, by adding ''raw=&amp;quot;true&amp;quot;'' to the ''html'' node. This means that the files are not preprocessed before being sent to the web browser.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;image.gif&amp;quot; raw=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parsed files===&lt;br /&gt;
If a file is not specified in the metafile as &amp;quot;raw&amp;quot;, then it is passed through a pre-processor before it is returned to the client. This pre-processor works much like PHP or ASP but uses Lua. You can embed standard MTA scripts within HTML pages, controlling the output. Almost all standard MTA functions work, plus a number of special [[Template:HTTP functions|HTTP Functions]], such as [[httpWrite]], a function that outputs text to the buffer.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        This resource is called &amp;lt;* httpWrite( getResourceName(getThisResource()) ) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a shorthand (in common with PHP and ASP) for this code, meaning that you can also write the above code as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        This resource is called &amp;lt;* = getResourceName(getThisResource()) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Aside from HTTP functions, embedded Lua has access to the following environment variables that contain information about how the page was requested:&lt;br /&gt;
* table '''requestHeaders''': This is a table containing all the headers that were requested with the page. You can set returned headers using [[httpSetResponseHeader]]. &lt;br /&gt;
* table '''form''': This is a table containing all the form data submitted to the page using HTTP POST combined with any variables passed in the querystring with HTTP GET.&lt;br /&gt;
* table '''cookies''': This is a table of all the cookies. You can modify cookies using [[httpSetResponseCookie]].&lt;br /&gt;
* string '''hostname''': This is a string containing the IP address or hostname that requested the page.&lt;br /&gt;
* string '''url''': This is the URL of the page.&lt;br /&gt;
* account '''user''': This is the account of the current user.&lt;br /&gt;
&lt;br /&gt;
It's important to note that parsed files are run in a separate virtual machine from the rest of your resource's code. As such, if you want to call a function in your resource's main code, you need to export the function and use the [[call]] function from your parsed file.&lt;br /&gt;
&lt;br /&gt;
==Calls==&lt;br /&gt;
You can specify that certain exported functions in your resource are able to be called from the HTTP interface. All the SDKs (listed below) allow you to call these functions from a remote location. &lt;br /&gt;
&lt;br /&gt;
To specify an exported http-accessible function, add the following to your meta.xml file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;export function='functionName' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can code your function just as you would any normal function, returning as many values as you want, including tables and resources and most important elements. You ''cannot'' however return other 'userdata' values such as [[xmlnode|xmlnodes]] or functions.&lt;br /&gt;
&lt;br /&gt;
===Protocol===&lt;br /&gt;
{{Note|You don't need to know this unless you're writing your own HTTP request code. You can just use one of the [[#SDK|SDKs listed below]].}}&lt;br /&gt;
&lt;br /&gt;
Calls are done by requesting ''&amp;lt;nowiki&amp;gt;http://&amp;lt;your IP&amp;gt;:&amp;lt;your port&amp;gt;/&amp;lt;resource_name&amp;gt;/call/&amp;lt;exported_function_name&amp;gt;&amp;lt;/nowiki&amp;gt;'' using HTTP POST. The body of the request should be a JSON array of the arguments for the function.&lt;br /&gt;
&lt;br /&gt;
The request will return a JSON array of the value(s) returned from the function as the HTTP response.&lt;br /&gt;
&lt;br /&gt;
The server supports HTTP Basic authentication and you can configure access via the ACL and the built-in accounts system.&lt;br /&gt;
&lt;br /&gt;
===Calls from the HTTP web interface===&lt;br /&gt;
Using calls is probably easiest from the web interface and can be done almost seamlessly.&lt;br /&gt;
&lt;br /&gt;
First, add this to your meta.xml file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, add the following to the &amp;lt;head&amp;gt; section of the page you want to call from:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, you can create a javascript block on your page and call your functions almost as if they were local. The only difference is that the calls are asynchronous - you should specify a callback function as the last argument for your call. This is called when the function returns.&lt;br /&gt;
&lt;br /&gt;
Here's a simple example.&lt;br /&gt;
&lt;br /&gt;
'''meta.xml'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;script src='code.lua' /&amp;gt;&lt;br /&gt;
   &amp;lt;html src='page.htm' default='true' /&amp;gt;&lt;br /&gt;
   &amp;lt;export function='showChatMessage' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''code.lua'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showChatMessage ( message )&lt;br /&gt;
    outputChatBox ( message )&lt;br /&gt;
    return 5;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''page.htm'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
        &amp;lt;script type='text/javascript'&amp;gt;&lt;br /&gt;
            function say() {&lt;br /&gt;
                var message = document.getElementById('message')&lt;br /&gt;
                showChatMessage ( message.value, &lt;br /&gt;
                    function ( number ) {&lt;br /&gt;
                        // the function has been called and returned something&lt;br /&gt;
                        message.value = &amp;quot;The function returned &amp;quot; + number;&lt;br /&gt;
                    }&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
        &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;input type='text' id='message' /&amp;gt;&amp;lt;input type='button' value='say' onclick='say();' /&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see (fairly complex) examples of how this can be done in the resources ''resourcebrowser'', ''resourcemanager'' and ''webadmin''.&lt;br /&gt;
&lt;br /&gt;
==Securing the web interface==&lt;br /&gt;
The [[ACL]] has a number of rights that can affect what files can be accessed.&lt;br /&gt;
{{Deprecated feature|3.0139|1.3.1|&lt;br /&gt;
* general.http: If disabled, none of the HTTP files can be accessed (except by game clients)&lt;br /&gt;
** '''Important Note''': ''If 'general.http' is enabled, HTTP access to all resources (for that ACL) is enabled by default. To disable HTTP access you have to explicitly block access to resources that contain exported HTTP functions.''&lt;br /&gt;
** '''Important Note''': ''If 'general.http' is enabled on an ACL which has a user with no password (i.e. user.* or user.guest or user.http_guest), it is essential that you explicitly block access to resources that contain exported HTTP functions.''&lt;br /&gt;
* resource.'''ResourceName''': If disabled, none of the files in the resource can be accessed&lt;br /&gt;
* resource.'''ResourceName'''.file.'''FileName''': If disabled, the file named cannot be accessed&lt;br /&gt;
* resource.'''ResourceName'''.function.'''FunctionName''': If disabled, the function cannot be called&lt;br /&gt;
These work as with other ACL rights - you can disable them for normal users and just enable them for Admin users, or any other group of users you wish.&lt;br /&gt;
}}&lt;br /&gt;
{{New_feature|3.0139|1.3.1|&lt;br /&gt;
* '''resource.ResourceName.http''': If enabled, the resource will be accessible from http://server_ip:22005/ResourceName/&lt;br /&gt;
This works as with other ACL rights - You can enable it just for Admin users, or any other group of users you wish.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==SDK==&lt;br /&gt;
There are a number of so-called 'SDKs' available that allow you to interface with the server from other programming languages. With these, you could (in theory) write whole gamemodes. In practice, this is probably a bad idea, but it is useful for statistics and administration. The PHP SDK is the most developed version. Feel free to modify or create your own SDKs - if you do please send us a copy.&lt;br /&gt;
&lt;br /&gt;
* [[JavaSDK|Java SDK]]&lt;br /&gt;
* [[Javascript SDK]]&lt;br /&gt;
* [https://www.npmjs.com/package/mtasa Node.js SDK]&lt;br /&gt;
* [[Perl SDK]]&lt;br /&gt;
* [[PHP SDK]]&lt;br /&gt;
* [[CSharp SDK|C# SDK]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[callRemote]] - Allows game servers to call functions on PHP pages (with the PHP SDK) and on other game servers.&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[hu:Resource Web Access]]&lt;br /&gt;
[[ru:Resource Web Access]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resources&amp;diff=65891</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resources&amp;diff=65891"/>
		<updated>2020-04-19T19:46:43Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files - including script files, plus a ''meta'' file that describes how the resource should be loaded. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once. Its worth remembers though, that unlike programs on an operating system, there is no multi-tasking between resources.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
* '''Resource''' - A zip file or folder containing a meta.xml file and a number of resource items. These are placed in the ''mods/deathmatch/resources'' folder in the server directory.&lt;br /&gt;
* '''Resource item''' - A file contained within a resource, currently this can be a map, script, images, etc.&lt;br /&gt;
&lt;br /&gt;
==The Meta File==&lt;br /&gt;
''See main article [[Meta.xml]] for details''&lt;br /&gt;
&lt;br /&gt;
The Metafile is the core of each the resource. It describes exactly what files in the resource should be used, and how. The following is an example that covers every option there is, your metafiles can have as many or as few of these tags as you require:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info author=&amp;quot;eAi&amp;quot; description=&amp;quot;This is a basic CTF script&amp;quot; version=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;radarblips&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;markermanagement&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;ctf.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;flag.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;ctf_client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;file src=&amp;quot;model.dff&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;quitbutton.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;killed.png&amp;quot;  /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;html src=&amp;quot;test.htm&amp;quot; default=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;html src=&amp;quot;logo.png&amp;quot; raw=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;export function=&amp;quot;multiply&amp;quot; http=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;getPlayerList&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;getElementOwner&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;config src=&amp;quot;vehicle-list.xml&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;config src=&amp;quot;markerconfig.xml&amp;quot; type=&amp;quot;server&amp;quot;  /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;map src=&amp;quot;somestuff.map&amp;quot; dimension=&amp;quot;99&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
While a CTF map may have a meta.xml that looks like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;ctf&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;map src=&amp;quot;myuberl33tctfmap.map&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;info author=&amp;quot;Tom&amp;quot; instructions=&amp;quot;this is uber l33t !!!!!1111111&amp;quot; type=&amp;quot;map&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Script/type, Config/type, and File/type attributes specify if the script/resource should be sent to clients or not, and defaults to &amp;quot;server&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The include tag specifies other resources that should be started before this resource is started.  In other words, if your resource is dependent on another, you can include it so that the other resource is started first.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each resource has its own virtual machine (VM). This contains every script in the resource.  This means that variables are not shared with other resources.  The best way to communicate with other resources is by using the ''export'' tag and exporting a function.  This will enable other resources to fire this function using the [[call]] scripting function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scripts sent to clients are started as soon as all the scripts have been downloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scripts are able to read and write to their own resource folder with functions such as [[xmlCreateFile]] and [[fileCreate]]. They can also read and write to other resources but must have [[Access_Control_List|ACL]] access. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each resource can only be loaded once, the server will ensure this. If a resource is included more than once, the same instance will be used by each resource that includes it.&lt;br /&gt;
&lt;br /&gt;
==File storage==&lt;br /&gt;
Resource files can either be stored in a zip or a directory. This is located in:&lt;br /&gt;
&lt;br /&gt;
server/mods/deathmatch/resources/ (if you've installed your server with the client)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
mods/deathmatch/resources/ (for dedicated server installations)&lt;br /&gt;
&lt;br /&gt;
Each resource can have a zip file, a directory or both. In the case of both existing, the directory has precedence over the zip file, as such files can be placed in the directory to over-ride the files in the zip file. This allows directories to be used for testing and developing of maps/scripts while zip files used by end-users.&lt;br /&gt;
&lt;br /&gt;
==Other things to note==&lt;br /&gt;
*Resource names can't have dots in.&lt;br /&gt;
*If the resource does any file saving, the file names used should not be listed in the meta.xml&lt;br /&gt;
*Files listed in the meta.xml should be considered read-only by your scripts. Do not modify them with xmlSaveFile, FileSave etc.&lt;br /&gt;
*When making a zip file of your resource, do not include save files. If your resource uses to save files, they must be created by your resource when needed.&lt;br /&gt;
*When making a zip file of your resource, only include files that are listed in the meta.xml. Do not include 'example' save files, otherwise, bad things will happen.&lt;br /&gt;
*We recommend avoiding spaces and exotic characters from resource names.&lt;br /&gt;
&lt;br /&gt;
==Script functions==&lt;br /&gt;
The resource system can be manipulated by script. As such, the following Serverside scripting functions are provided:&lt;br /&gt;
{{Resource functions}}&lt;br /&gt;
&lt;br /&gt;
The following events are also provided:&lt;br /&gt;
{{Resource_events}}&lt;br /&gt;
&lt;br /&gt;
[[hu:Resources]]&lt;br /&gt;
[[it:Introduzione alle Risorse]]&lt;br /&gt;
[[pt-br:Recursos]]&lt;br /&gt;
[[ru:Resources]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Debugging&amp;diff=65890</id>
		<title>Debugging</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Debugging&amp;diff=65890"/>
		<updated>2020-04-19T19:45:49Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When scripting you will often come across problems that are not immediately apparent. This page tries to point out some basic strategies to locate the error.&lt;br /&gt;
&lt;br /&gt;
==Debug console==&lt;br /&gt;
MTA features a built-in debug console that shows debug messages output from MTA functions or from scripts. Keeping it mind that you should have administrator access (unless you modify the ACL to change this), you can open the debug console by typing ''debugscript *x*'' in the console, where ''x'' is the debug level:&lt;br /&gt;
* '''0:''' close debug console&lt;br /&gt;
* '''1:''' only errors&lt;br /&gt;
* '''2:''' errors and warnings&lt;br /&gt;
* '''3:''' errors, warnings and info messages&lt;br /&gt;
By typing ''debugscript 3'' all messages are visible. Level 3 and level 2 are recommended for most occasions. You should have ''debugscript'' enabled whenever you are testing your scripts as it will help you easily detect and solve typos and other issues.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
This example code has two errors:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Fedor&amp;quot;)&lt;br /&gt;
        outputChatbox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
When the script this piece of code is in is tried to be loaded, debugscript will output something similiar to this:&lt;br /&gt;
:{{Debug info|Loading script failed: myResource\script.lua:2: 'then' expected near ´outputChatbox'}}&lt;br /&gt;
This means the script could not be parsed because there was a syntax error. It shows the script path relative to the resource directory so you can identify to script where the error originated from. After the filename it shows a colon and a number, this number presents the line number - this is so you can find out where in your script the error is - it is very helpful for large scripts. After that is the error message, which varies depending on the error made. Looking at the error message, we can easily determine that the error originated from the resource '''myResource''' and line two of the script file '''script.lua'''. The error message is very clear, we forgot the &amp;quot;then&amp;quot;! We can easily fix that!&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Fedor&amp;quot;) then&lt;br /&gt;
        outputChatbox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now the script will load fine and won't output any errors until a player with the name 'Fedor' says something in the chat. At that moment, the debug console will output:&lt;br /&gt;
:{{Debug error|myResource\script.lua:2: attempt to call global 'outputChatbox' (a nil value)}}&lt;br /&gt;
This error means that the function '''outputChatbox''' is a nil value, that is - it doesn't exist! This is because the function is actually called [[outputChatBox]], not [[outputChatbox]] - take care of that capital B.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Fedor&amp;quot;) then&lt;br /&gt;
        outputChatBox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, this is just an example and I've only skimmed the surface of error messages. There are plenty of other messages and scenarios, but you should get a general idea.&lt;br /&gt;
&lt;br /&gt;
==Server &amp;amp; client debug logging==&lt;br /&gt;
====Server====&lt;br /&gt;
Navigate to: ''(MTA root folder)&amp;gt;server&amp;gt;mods&amp;gt;deathmatch''&lt;br /&gt;
&lt;br /&gt;
There are two nearly identical files:&lt;br /&gt;
&lt;br /&gt;
*The local.conf is the settings for the &amp;quot;host game&amp;quot; menu item in the main menu of MTA. This is a quick and easy way of starting a temporary server from inside the client. When the client is turned off the server will also turn off.&lt;br /&gt;
&lt;br /&gt;
*The mtaserver.conf is used when &amp;quot;MTA Server.exe&amp;quot; is executed from (MTA root folder)&amp;gt;server. This runs the server in its own console window which does not need the client to exist or to be run. This is can be useful if you're interested in hosting servers for a longer time period or if you want to experiment with a real-world console.&lt;br /&gt;
&lt;br /&gt;
Depending on which way you host, you will want to edit those files. The settings in question are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!-- Specifies the location and name of the debugscript log file. If left blank, the server won't be saving this file. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You want to make sure you have a log name specified. Also, you want to specify what level of errors will be logged. If it is 0 nothing will be logged. The levels were explained at the top of this article. If the logging level was changed to 3, then, in this case, all '''serverside''' script errors log to (MTA root folder)&amp;gt;server&amp;gt;mods&amp;gt;deathmatch&amp;gt;logs&amp;gt;scripts.log&lt;br /&gt;
&lt;br /&gt;
====Client====&lt;br /&gt;
Navigate to: ''(MTA root folder)&amp;gt;MTA&amp;gt;logs&amp;gt;clientscript.log''&lt;br /&gt;
&lt;br /&gt;
This file logs all '''clientside''' script errors. This is set to log by default, no setup required.&lt;br /&gt;
&lt;br /&gt;
==Debug strategies==&lt;br /&gt;
There are several strategies that support finding errors, apart from going through the code. Most of them include outputting debug messages, with have different information depending on the situation.&lt;br /&gt;
&lt;br /&gt;
===Useful functions===&lt;br /&gt;
There are some functions that may come in handy for debugging.&lt;br /&gt;
* [[outputDebugString]] or [[outputChatBox]] for outputting any information (use outputDebugString for technical output)&lt;br /&gt;
* [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()] on a variable to turn the value into a string. Useful if the value is not a number or string.&lt;br /&gt;
* [[inspect]] returns a useful human-readable string notation of any datatype including tables, non-element userdatas such as ACL groups, accounts, etc, and elements.&lt;br /&gt;
* [[iprint]] similar to inspect, except it takes in as many arguments as desired and outputs them into debugscript.&lt;br /&gt;
* [[getElementType]] to check the type of the MTA element.&lt;br /&gt;
* [[isElement]] to check if the MTA element exists.&lt;br /&gt;
&lt;br /&gt;
===Add debugmessages to check ''if'', ''when'' or ''how often'' a section of code is executed===&lt;br /&gt;
A typical example would be verify whether an ''if''-section is executed or not. To do that, just add any message you will recognize later within the ''if''-section.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (variable1 == variable2) then&lt;br /&gt;
    outputDebugString(&amp;quot;variable1 is the same as variable2!&amp;quot;)&lt;br /&gt;
    -- do anything&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another application would be to check when variable values are modified. First search for all occurrences of the variable being edited and add a message just beside it.&lt;br /&gt;
&lt;br /&gt;
===Add debugmessages to check the ''value'' of a variable===&lt;br /&gt;
Let's say you want to create a marker, but it doesn't appear at the position you expect it to be. The first thing you might want to do is check if the [[createMarker]] function is executed. But while doing this, you can also check the values being used in the [[createMarker]] function in one run.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox(&amp;quot;posX is: &amp;quot;..x..&amp;quot; posY is: &amp;quot;..y..&amp;quot; posZ is: &amp;quot;..z)&lt;br /&gt;
createMarker(x,y,z)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This would output all three variables that are used as coordinates for the marker. Assuming you read those from a map file, you can now compare the debug output to the desired values. The [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()] will ensure that the values of the variables can be concatenated (put together) as a string, even if it's a boolean value.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Imagine you created a [[Colshape|collision shape]] somewhere and you want an action to perform after the player stays for ten seconds inside it, you would do this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	-- set a timer to output a message (could as well execute another function)&lt;br /&gt;
	-- store the timer id in a table, using the player as index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;The player stayed 10 seconds in the colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- kill the timer when the player leaves the colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, root, colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
When a player enters the colshape, debugscript outputs the following message:&lt;br /&gt;
:{{Debug error|..[path]: attempt to index global 'colshapeTimer' (a nil value)}}&lt;br /&gt;
This means you tried to index a table that does not exist (because the table is a nil value, it doesn't exist). In the example above, this is done when storing the timer id in the table. We need to add a check if the table exists and if it does not exist we should create it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- set a timer to output a message (could as well execute another function)&lt;br /&gt;
	-- store the timer id in a table, using the player as index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;The player stayed 10 seconds in the colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- kill the timer when the player leaves the colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,root,colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will still receive a warning when a player enters the colshape, waits for the message and leaves it again:&lt;br /&gt;
&lt;br /&gt;
:{{Debug warning|[..]: Bad argument @ 'killTimer' Line: ..}}&lt;br /&gt;
&lt;br /&gt;
Except for that (we will talk about that later) everything seems to work fine. A player enters the colshape, the timer is started, if he stays the message occurs, if he leaves the timer is killed.&lt;br /&gt;
&lt;br /&gt;
===A more inconspicuous error===&lt;br /&gt;
But for some reason, the message gets outputted twice when you stay in the colcircle while in a vehicle. Since it would appear some code is executed twice, we add debug messages to check this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- add a debug message&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;)&lt;br /&gt;
	-- set a timer to output a message (could as well execute another function)&lt;br /&gt;
	-- store the timer id in a table, using the player as index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;The player stayed 10 seconds in the colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- add a debug message&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave&amp;quot;)&lt;br /&gt;
	-- kill the timer when the player leaves the colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we notice that both handler functions get executed twice when we are in a vehicle, but only once when we are on foot. It would appear the vehicle triggers the colshape as well. To confirm this theory, we ensure that the ''player'' variable actually holds a reference to a player element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- add a debug message, with the element type&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit &amp;quot;..getElementType(player))&lt;br /&gt;
	-- set a timer to output a message (could as well execute another function)&lt;br /&gt;
	-- store the timer id in a table, using the player as index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;The player stayed 10 seconds in the colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- add a debug message, with the element type&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- kill the timer when the player leaves the colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The debug messages tell us that one of the ''player'' variables is a player and that the other one is a vehicle element. Since we only want to react when a player enters the colshape, we add an ''if'' that will end the execution of the function if it's '''not''' a player element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- add a check for the element type&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- add a debug message, with the element type&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit &amp;quot;..getElementType(player))&lt;br /&gt;
	-- set a timer to output a message (could as well execute another function)&lt;br /&gt;
	-- store the timer id in a table, using the player as index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;The player stayed 10 seconds in the colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- add a check for the element type&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- add a debug message, with the element type&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- kill the timer when the player leaves the colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the script should work as desired, but it will still output the warning mentioned above. This happens because the timer we try to kill when a player leaves the colshape will not exist anymore when it has reached the 10 seconds (and therefore executed after the 10th second has completed). There are different ways to get rid of that warning (since you know that the timer might not exist anymore and you only want to kill it if it exists). One way would be to check if the timer referenced in the table really exists. To do this, we need to use [[isTimer]], which we will use when we kill the timer:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the complete working code would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- add a check for the element type&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- add a debug message, with the element type&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit &amp;quot;..getElementType(player))&lt;br /&gt;
	-- set a timer to output a message (could as well execute another function)&lt;br /&gt;
	-- store the timer id in a table, using the player as index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;The player stayed 10 seconds in the colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- add a check for the element type&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- add a debug message, with the element type&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- kill the timer when the player leaves the colshape&lt;br /&gt;
	if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
		killTimer(colshapeTimer[player])&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Debugging Performance Issues==&lt;br /&gt;
&lt;br /&gt;
If your server is using up more resources than it should or you just want to make sure your scripts are efficient, you can find the source of the issue by using a great tool that comes with the default resource package called [[Resource:Performancebrowser|performancebrowser]]. You can start it with ''''start performancebrowser''''. If it doesn't exist then you can get the latest resources from the [https://github.com/multitheftauto/mtasa-resources GitHub repository]. This tool provides an incredible amount of information for performance debugging. Memory leaks, element leaks, and CPU intensive scripts are all easily findable via performancebrowser. If you use the ''''d'''' option in Lua timing you can see which functions are using up the CPU.&lt;br /&gt;
&lt;br /&gt;
To access performancebrowser you will need to go to your web browser and enter the address: http://serverIPHere:serverHTTPPortHere/performancebrowser/ Note that the / at the end is required. So for example: http://127.0.0.1:22005/performancebrowser/ You will then need to login with an in-game admin account or any account that has access to ''''resource.performancebrowser.http'''' and ''''resource.ajax.http''''. Most of the information you will need is in the categories Lua timing and Lua memory, look for values that are much higher than other values.&lt;br /&gt;
&lt;br /&gt;
===Examples of scripts that could cause performance problems===&lt;br /&gt;
&lt;br /&gt;
Adding data to a table but never removing it. This would take months/years before it causes a problem though.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local someData = {}&lt;br /&gt;
&lt;br /&gt;
function storeData()&lt;br /&gt;
    someData[source] = true&lt;br /&gt;
    -- There is no handling for when a player quits, this is considered a memory leak&lt;br /&gt;
    -- Using the Lua timing tab you can detect the RAM usage of each resource.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, storeData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Element leaking is possible if you use temporary colshapes for whatever reason and may not destroy them. This would cause bandwidth, CPU and memory performance issues over time.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function useTemporaryCol()&lt;br /&gt;
    local col = createColCircle(some code here)&lt;br /&gt;
    if (normally this should happen) then&lt;br /&gt;
        destroyElement(col)&lt;br /&gt;
    end&lt;br /&gt;
    -- But sometimes it didn't so the script ended but the collision area remained and overtime&lt;br /&gt;
    -- you may end up with hundreds to thousands of pointless collision areas. &lt;br /&gt;
    -- The Lua timing tab allows you to see the number of elements each script has created.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
High CPU usage resulting in the server FPS dropping so much that the server is unplayable. In under 24 hours, this can create havoc on a very busy server. The amount of &amp;quot;refs&amp;quot; in the Lua timing detect this type of build-up, surprisingly the Lua timing tab didn't help in this case but Lua memory did.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, function()&lt;br /&gt;
    -- Code for joiner&lt;br /&gt;
    addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, function()&lt;br /&gt;
        -- Code for when they have quit&lt;br /&gt;
        -- See the problem? It's bound to root which the event handler is being added again and again and again&lt;br /&gt;
    end)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A function uses up a lot of your CPU because whatever it does takes a long time. This is just some function that takes a long time to complete. Without performancebrowser you'd have no idea its the cause but with performancebrowser you can see that a resource is using lots of CPU in the Lua timing tab. If you then enter: ''''d'''' into the options edit box it will even tell you what file name and the first line of the function that is using up so much CPU.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function someDodgyCode()&lt;br /&gt;
    for i=1, 100000 do&lt;br /&gt;
        -- some code&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[hu:Debugging]]&lt;br /&gt;
[[it:Guida al Debug]]&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Debugging]]&lt;br /&gt;
[[zh-cn:脚本调试教程]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=65889</id>
		<title>CEF Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=65889"/>
		<updated>2020-04-19T19:44:00Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives you a brief introduction to CEF.&lt;br /&gt;
&lt;br /&gt;
=What is CEF?=&lt;br /&gt;
CEF stands for '''C'''hromium '''E'''mbedded '''F'''ramework and is a framework for embedding Chromium-based browsers in other applications - in our case MTA. CEF is based on Google's Chromium project so it is also a fast, secure and stable web engine.&lt;br /&gt;
&lt;br /&gt;
You can find more information about CEF on CEF's GoogleCode project page: https://bitbucket.org/chromiumembedded/cef&lt;br /&gt;
&lt;br /&gt;
=The basics=&lt;br /&gt;
Creating a new browser is really simple. Let's open YouTube for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a new remote browser (size is 800*600px) with transparency enabled&lt;br /&gt;
local browser = createBrowser(800, 600, true, true)&lt;br /&gt;
&lt;br /&gt;
-- &amp;quot;Wait&amp;quot; for the browser (this is necessary because CEF runs in a secondary thread and hence requires the 'asynchronous' event mechanism)&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, browser,&lt;br /&gt;
    function()&lt;br /&gt;
        -- We're ready to load the URL now (the source of this event is the browser that has been created)&lt;br /&gt;
        loadBrowserURL(source, &amp;quot;https://youtube.com/&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example does not require any domain requests as YouTube is whitelisted by default. More about domain requests below.&lt;br /&gt;
&lt;br /&gt;
=Domain request system=&lt;br /&gt;
In order to prevent people from abusing the possibilities CEF offers, we decided to introduce a request system.&lt;br /&gt;
This means the domain you want to load has to meet at least one of the following requirements:&lt;br /&gt;
*it is whitelisted globally by the MTA team (you can create a post in [this topic] to suggest a new domain to be whitelisted) - '''**TODO: Add forum URL here**'''&lt;br /&gt;
*the domain was requested via requestBrowserDomains/Browser.requestDomains and accepted by the player '''before'''&lt;br /&gt;
*the domain is on the user's whitelist (MTA settings =&amp;gt; Tab: Browser =&amp;gt; Whitelist)&lt;br /&gt;
&lt;br /&gt;
Apart from these options, a domain might be blacklisted due to malicious content. Such domains cannot be requested.&lt;br /&gt;
&lt;br /&gt;
=Local vs remote mode=&lt;br /&gt;
There are two modes CEF can run in:&lt;br /&gt;
&lt;br /&gt;
Characteristics of local mode:&lt;br /&gt;
*you '''can''' execute Javascript code without any restriction (See: [[executeBrowserJavascript]])&lt;br /&gt;
*you '''can''' only load websites stored in the resource folder&lt;br /&gt;
*you '''cannot''' load remote content&lt;br /&gt;
&lt;br /&gt;
Characteristics of remote mode:&lt;br /&gt;
*you '''cannot''' execute Javascript code&lt;br /&gt;
*you '''can''' only load remote content&lt;br /&gt;
*keep in mind that either loading remote websites or Javascript on remote websites can be disabled in the MTA settings&lt;br /&gt;
&lt;br /&gt;
Changing the mode after the browser was created is not possible due to technical reasons.&lt;br /&gt;
&lt;br /&gt;
=Resource management=&lt;br /&gt;
==How to load local HTML files==&lt;br /&gt;
Loading local HTML files works similar to loading images.&lt;br /&gt;
&lt;br /&gt;
Add your HTML files to your meta.xml through the file tag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myAwesomeUI.html&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to load local resources in local HTML files==&lt;br /&gt;
Imagine you want to load an image or play a video from your MTA resource. This is possible via a custom URI scheme named '''''mtalocal://'''''&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
This examples shows how to play a video. Note that you have to enable OOP.&lt;br /&gt;
====Lua====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a browser (local mode is also required to access local data)&lt;br /&gt;
local webView = Browser(640, 480, true, true)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webView,&lt;br /&gt;
     function()&lt;br /&gt;
    &lt;br /&gt;
          -- Load HTML UI&lt;br /&gt;
          webView:loadURL(&amp;quot;http://mta/local/html/myVideo.html&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
     end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myVideo.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;media/myVideo.webm&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====HTML====&lt;br /&gt;
This is the most interesting part:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;video width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot; controls&amp;gt;&lt;br /&gt;
         &amp;lt;source src=&amp;quot;http://mta/local/myVideo.webm&amp;quot; type=&amp;quot;video/webm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Lua &amp;lt;==&amp;gt; Javascript communication=&lt;br /&gt;
First of all, communication between Lua and Javascript is only available in local mode due to security reasons.&lt;br /&gt;
&lt;br /&gt;
==Lua to Javascript==&lt;br /&gt;
Lua to javascript is pretty easy as you can execute Javascript code from Lua using [[executeBrowserJavascript]].&lt;br /&gt;
&lt;br /&gt;
So, a bit Lua code around it and you have got the first direction:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/WebWindow.lua#L180-189&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/mtaevents.js#L9-L15&lt;br /&gt;
&lt;br /&gt;
==Javascript to Lua==&lt;br /&gt;
You are able to trigger a client event via the Javascript method ''triggerEvent'' which is part of the static class/namespace ''mta''.&lt;br /&gt;
The syntax is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mta.triggerEvent(string event, var parameter1, var parameter2, var parameter3, ...)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The source of this event is always the browser element that triggered the event.&lt;br /&gt;
&lt;br /&gt;
An example is available here:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/html/ui2.html#L66&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/Main.lua#L35-L40&lt;br /&gt;
&lt;br /&gt;
=Debugging=&lt;br /&gt;
The ''web development mode'' can be enabled as follows (type it in the client's F8 console):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;start runcode&lt;br /&gt;
crun setDevelopmentMode(true, true)&lt;br /&gt;
debugscript 3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to see web errors and blocked domains/URLs in the debug window at the bottom.&lt;br /&gt;
&lt;br /&gt;
=Things you should keep in mind while working with CEF=&lt;br /&gt;
You should always keep in mind that some modern browser features are not available on some computers.&lt;br /&gt;
This is for example true for '''WebGL'''.&lt;br /&gt;
&lt;br /&gt;
Another problematic feature is '''Adobe Flash'''. Adobe Flash is enabled by default, but you should avoid using it due to the fact that plugins can be disabled in the settings on the one hand (Java is disabled completely by the way) and Flash is very restrictive on the other hand. Restrictive means it runs in a separate process uses a very old interface and offers therefore just a few ways to control it.&lt;br /&gt;
As a consequence, you cannot control the volume of flash objects. Fortunately, HTML5 is an even better replacement and provides very good audio and video interface (http://www.w3schools.com/tags/ref_av_dom.asp) which even supports 3D sound (@all bored people among us: Feel free to write a 3D sound 'wrapper' that maps the GTA onto HTML5 coordinates :P).&lt;br /&gt;
&lt;br /&gt;
=Advanced usage=&lt;br /&gt;
Since our CEF implementation does not do z-ordering by default, you have to provide your own z-ordering mechanism.&lt;br /&gt;
You can find a basic implementation of such a mechanism here: https://github.com/Jusonex/mtasa_cef_tools&lt;br /&gt;
There are also a few utility functions that allow you to integrate these classes easily into your own object-oriented UI system.&lt;br /&gt;
I'll provide some code to use CEF along with CEGUI soon too.&lt;br /&gt;
&lt;br /&gt;
=Performance=&lt;br /&gt;
Creating lots of browsers does not influence MTA directly (except the fact MTA has to copy the texture data in the main/GTA thread due to technical restrictions), because one part of CEF runs in another process and the other part in a secondary thread.&lt;br /&gt;
So if you do not want to show the browser, it is definitely the best to destroy the browser. If you cannot destroy the browser (imagine you have to save the website's state for some reason), you can save a lot of resources by disabling rendering via [[setBrowserRenderingPaused]]. This will stop CEF from rendering new frames/processing input and MTA from copying the texture data.&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
===google.com doesn't work (even though I requested google.com)===&lt;br /&gt;
Google redirects to a country-specific website by default. If you want to prevent Google from doing this, load the following URL: https://www.google.com/ncr&lt;br /&gt;
&lt;br /&gt;
=Scripting functions=&lt;br /&gt;
{{CEF_functions}}&lt;br /&gt;
=Scripting events=&lt;br /&gt;
{{CEF_events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetServerConfigSetting&amp;diff=65857</id>
		<title>GetServerConfigSetting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetServerConfigSetting&amp;diff=65857"/>
		<updated>2020-04-15T12:56:33Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function retrieves server settings which are usually stored in the '''mtaserver.conf''' file.&lt;br /&gt;
&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
Available in 1.1 and onwards&lt;br /&gt;
}}&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 getServerConfigSetting ( string name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''name :''' The name of the setting (setting names can be found [[Server_mtaserver.conf|here]])&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the current value for the named setting, or ''false'' if the setting does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example prints the server minimum allowed client version to the chatbox&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( getServerConfigSetting (&amp;quot;minclientversion&amp;quot;) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65856</id>
		<title>SetFPSLimit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65856"/>
		<updated>2020-04-15T12:54:03Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at.  &lt;br /&gt;
{{Note|When set client side, the actual limit used is the lowest of both the server and client set values}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setFPSLimit ( int fpsLimit )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''fpsLimit:''' An integer value representing the maximum FPS. This value may be between '''25''' and '''100''' FPS. You can also pass '''0''' or ''false'', in which case the FPS limit will be the one set in the client settings (by default, 100 FPS and the client fps limit should also be manually changed via &amp;quot;fps_limit=0&amp;quot; in console or '''MTA San Andreas 1.5\MTA\config\coreconfig.xml''').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, or ''false'' if it was not possible to set the limit or an invalid value was passed.&lt;br /&gt;
&lt;br /&gt;
==Issues when increasing FPS==&lt;br /&gt;
It is also recommended to set a conservative FPS limit (between 30-60 and 74 highest) because high FPS can break some GTA internal calculations. The higher the FPS the more of a problem these become:&lt;br /&gt;
* Impossibility to move sideways while aiming certain weapons.&lt;br /&gt;
* Speed of vehicles is effected, racers with a higher FPS will have an unfair advantage.&lt;br /&gt;
* Pressing the horn button to turn on and off sirens gets really hard the higher the FPS.&lt;br /&gt;
* Climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266&lt;br /&gt;
* Animations can randomly get messed up.&lt;br /&gt;
* There were more issues like not being able to take off in Skimmer which MTA developers have fixed.&lt;br /&gt;
* Satchels can be thrown ~10% less distance.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This command sets the fps limit in a command handler.&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;function fpsFunction( player, command, limit ) -- First define the function&lt;br /&gt;
  if hasObjectPermissionTo ( player, &amp;quot;function.setFPSLimit&amp;quot; ) and limit then &lt;br /&gt;
    -- If the player has permission to set FPS limit and limit is submitted...&lt;br /&gt;
    setFPSLimit ( limit ) -- Set the fps.&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;setfps&amp;quot;, fpsFunction ) -- Attach the setfps command to fpsFunction function.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;br /&gt;
&lt;br /&gt;
[[pl:setFPSLimit]]&lt;br /&gt;
[[ru:setFPSLimit]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65855</id>
		<title>SetFPSLimit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65855"/>
		<updated>2020-04-15T12:53:37Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at.  &lt;br /&gt;
{{Note|When set client side, the actual limit used is the lowest of both the server and client set values}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setFPSLimit ( int fpsLimit )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''fpsLimit:''' An integer value representing the maximum FPS. This value may be between '''25''' and '''100''' FPS. You can also pass '''0''' or ''false'', in which case the FPS limit will be the one set in the client settings (by default, 100 FPS and the client fps limit should also be manually changed via &amp;quot;fps_limit=0&amp;quot; in console or '''MTA San Andreas 1.5\MTA\config\coreconfig.xml''').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, or ''false'' if it was not possible to set the limit or an invalid value was passed.&lt;br /&gt;
&lt;br /&gt;
==Issues when increasing FPS==&lt;br /&gt;
It is also recommended to set a conservative FPS limit (between 30-60 and 74 highest), because high FPS can break some GTA internal calculations. The higher the FPS the more of a problem these become:&lt;br /&gt;
* Impossibility to move sideways while aiming certain weapons.&lt;br /&gt;
* Speed of vehicles is effected, racers with a higher FPS will have an unfair advantage.&lt;br /&gt;
* Pressing the horn button to turn on and off sirens gets really hard the higher the FPS.&lt;br /&gt;
* Climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266&lt;br /&gt;
* Animations can randomly get messed up.&lt;br /&gt;
* There were more issues like not being able to take off in Skimmer which MTA developers have fixed.&lt;br /&gt;
* Satchels can be thrown ~10% less distance.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This command sets the fps limit in a command handler.&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;function fpsFunction( player, command, limit ) -- First define the function&lt;br /&gt;
  if hasObjectPermissionTo ( player, &amp;quot;function.setFPSLimit&amp;quot; ) and limit then &lt;br /&gt;
    -- If the player has permission to set FPS limit and limit is submitted...&lt;br /&gt;
    setFPSLimit ( limit ) -- Set the fps.&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;setfps&amp;quot;, fpsFunction ) -- Attach the setfps command to fpsFunction function.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;br /&gt;
&lt;br /&gt;
[[pl:setFPSLimit]]&lt;br /&gt;
[[ru:setFPSLimit]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65854</id>
		<title>SetFPSLimit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65854"/>
		<updated>2020-04-15T12:52:59Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at.  &lt;br /&gt;
{{Note|When set client side, the actual limit used is the lowest of both the server and client set values}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setFPSLimit ( int fpsLimit )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''fpsLimit:''' An integer value representing the maximum FPS. This value may be between '''25''' and '''100''' FPS. You can also pass '''0''' or ''false'', in which case the FPS limit will be the one set in the client settings (by default, 100 FPS and the client fps limit should also manually be changed via &amp;quot;fps_limit=0&amp;quot; in console or '''MTA San Andreas 1.5\MTA\config\coreconfig.xml''').&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, or ''false'' if it was not possible to set the limit or an invalid value was passed.&lt;br /&gt;
&lt;br /&gt;
==Issues when increasing FPS==&lt;br /&gt;
It is also recommended to set a conservative FPS limit (between 30-60 and 74 highest), because high FPS can break some GTA internal calculations. The higher the FPS the more of a problem these become:&lt;br /&gt;
* Impossibility to move sideways while aiming certain weapons.&lt;br /&gt;
* Speed of vehicles is effected, racers with a higher FPS will have an unfair advantage.&lt;br /&gt;
* Pressing the horn button to turn on and off sirens gets really hard the higher the FPS.&lt;br /&gt;
* Climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266&lt;br /&gt;
* Animations can randomly get messed up.&lt;br /&gt;
* There were more issues like not being able to take off in Skimmer which MTA developers have fixed.&lt;br /&gt;
* Satchels can be thrown ~10% less distance.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This command sets the fps limit in a command handler.&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;function fpsFunction( player, command, limit ) -- First define the function&lt;br /&gt;
  if hasObjectPermissionTo ( player, &amp;quot;function.setFPSLimit&amp;quot; ) and limit then &lt;br /&gt;
    -- If the player has permission to set FPS limit and limit is submitted...&lt;br /&gt;
    setFPSLimit ( limit ) -- Set the fps.&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;setfps&amp;quot;, fpsFunction ) -- Attach the setfps command to fpsFunction function.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;br /&gt;
&lt;br /&gt;
[[pl:setFPSLimit]]&lt;br /&gt;
[[ru:setFPSLimit]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65853</id>
		<title>SetFPSLimit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetFPSLimit&amp;diff=65853"/>
		<updated>2020-04-15T12:50:49Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Issues when increasing FPS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at.  &lt;br /&gt;
{{Note|When set client side, the actual limit used is the lowest of both the server and client set values}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setFPSLimit ( int fpsLimit )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''fpsLimit:''' An integer value representing the maximum FPS. This value may be between '''25''' and '''100''' FPS. You can also pass '''0''' or ''false'', in which case the FPS limit will be the one set in the client settings (by default, 100 FPS).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, or ''false'' if it was not possible to set the limit or an invalid value was passed.&lt;br /&gt;
&lt;br /&gt;
==Issues when increasing FPS==&lt;br /&gt;
It is also recommended to set a conservative FPS limit (between 30-60 and 74 highest), because high FPS can break some GTA internal calculations. The higher the FPS the more of a problem these become:&lt;br /&gt;
* Impossibility to move sideways while aiming certain weapons.&lt;br /&gt;
* Speed of vehicles is effected, racers with a higher FPS will have an unfair advantage.&lt;br /&gt;
* Pressing the horn button to turn on and off sirens gets really hard the higher the FPS.&lt;br /&gt;
* Climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266&lt;br /&gt;
* Animations can randomly get messed up.&lt;br /&gt;
* There were more issues like not being able to take off in Skimmer which MTA developers have fixed.&lt;br /&gt;
* Satchels can be thrown ~10% less distance.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This command sets the fps limit in a command handler.&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;function fpsFunction( player, command, limit ) -- First define the function&lt;br /&gt;
  if hasObjectPermissionTo ( player, &amp;quot;function.setFPSLimit&amp;quot; ) and limit then &lt;br /&gt;
    -- If the player has permission to set FPS limit and limit is submitted...&lt;br /&gt;
    setFPSLimit ( limit ) -- Set the fps.&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;setfps&amp;quot;, fpsFunction ) -- Attach the setfps command to fpsFunction function.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;br /&gt;
&lt;br /&gt;
[[pl:setFPSLimit]]&lt;br /&gt;
[[ru:setFPSLimit]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Control_names&amp;diff=65836</id>
		<title>Control names</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Control_names&amp;diff=65836"/>
		<updated>2020-04-11T23:32:04Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* GTA control list */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists all the control names. These can be used as key arguments by the console commands ''bind'' and ''unbind'' as well as scripting functions such as [[bindKey]], [[unbindKey]], [[toggleControl]] etc.&lt;br /&gt;
&lt;br /&gt;
Lua table of all the valid control names listed on this page:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;controlTable = { &amp;quot;fire&amp;quot;, &amp;quot;aim_weapon&amp;quot;, &amp;quot;next_weapon&amp;quot;, &amp;quot;previous_weapon&amp;quot;, &amp;quot;forwards&amp;quot;, &amp;quot;backwards&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot;, &amp;quot;zoom_in&amp;quot;, &amp;quot;zoom_out&amp;quot;,&lt;br /&gt;
 &amp;quot;change_camera&amp;quot;, &amp;quot;jump&amp;quot;, &amp;quot;sprint&amp;quot;, &amp;quot;look_behind&amp;quot;, &amp;quot;crouch&amp;quot;, &amp;quot;action&amp;quot;, &amp;quot;walk&amp;quot;, &amp;quot;conversation_yes&amp;quot;, &amp;quot;conversation_no&amp;quot;,&lt;br /&gt;
 &amp;quot;group_control_forwards&amp;quot;, &amp;quot;group_control_back&amp;quot;, &amp;quot;enter_exit&amp;quot;, &amp;quot;vehicle_fire&amp;quot;, &amp;quot;vehicle_secondary_fire&amp;quot;, &amp;quot;vehicle_left&amp;quot;, &amp;quot;vehicle_right&amp;quot;,&lt;br /&gt;
 &amp;quot;steer_forward&amp;quot;, &amp;quot;steer_back&amp;quot;, &amp;quot;accelerate&amp;quot;, &amp;quot;brake_reverse&amp;quot;, &amp;quot;radio_next&amp;quot;, &amp;quot;radio_previous&amp;quot;, &amp;quot;radio_user_track_skip&amp;quot;, &amp;quot;horn&amp;quot;, &amp;quot;sub_mission&amp;quot;,&lt;br /&gt;
 &amp;quot;handbrake&amp;quot;, &amp;quot;vehicle_look_left&amp;quot;, &amp;quot;vehicle_look_right&amp;quot;, &amp;quot;vehicle_look_behind&amp;quot;, &amp;quot;vehicle_mouse_look&amp;quot;, &amp;quot;special_control_left&amp;quot;, &amp;quot;special_control_right&amp;quot;,&lt;br /&gt;
 &amp;quot;special_control_down&amp;quot;, &amp;quot;special_control_up&amp;quot; }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GTA control list==&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid green;margin-bottom:3px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;ON FOOT&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''fire''' Fire a player's weapon ('''Note''': If you want to disable weapons fire, remember to also disable the control '''action''' in addition to the control '''fire'''.)&lt;br /&gt;
* '''aim_weapon''' Aim the player's current weapon (if possible) (this also affects right-click + F punching)&lt;br /&gt;
* '''next_weapon''' Switch to the next weapon&lt;br /&gt;
* '''previous_weapon''' Switch to the previous weapon&lt;br /&gt;
* '''forwards''' Move forwards&lt;br /&gt;
* '''backwards''' Move backwards&lt;br /&gt;
* '''left''' Move left&lt;br /&gt;
* '''right''' Move right&lt;br /&gt;
* '''zoom_in''' Zoom targeted weapon in (sniper/rocket launcher/camera etc)&lt;br /&gt;
* '''zoom_out''' Zoom targeted weapon out&lt;br /&gt;
* '''change_camera''' Change camera mode&lt;br /&gt;
* '''jump''' Make the player jump&lt;br /&gt;
* '''sprint''' Make the player sprint&lt;br /&gt;
* '''look_behind''' Make the player look behind (and allow the player to see behind them)&lt;br /&gt;
* '''crouch''' Make the player crouch/duck&lt;br /&gt;
* '''action''' Show the stats menu - Fire with tab key.&lt;br /&gt;
* '''walk''' Make the player move slowly/quietly&lt;br /&gt;
* '''conversation_yes''' Answer yes to a question&lt;br /&gt;
* '''conversation_no''' Answer no to a question&lt;br /&gt;
* '''group_control_forwards''' Make the group you are controlling move forwards&lt;br /&gt;
* '''group_control_back''' Make the group you are controlling move backwards&lt;br /&gt;
* '''enter_exit''' Make the player enter a vehicle. Also used for alternative fighting styles.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid red;margin-bottom:3px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;IN VEHICLE&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''vehicle_fire''' Fire the player's vehicle's primary weapon (e.g. hunter's missiles) or shoot with driveby&lt;br /&gt;
* '''vehicle_secondary_fire''' Fire the player's vehicle's secondary weapon (e.g. hunter's minigun)&lt;br /&gt;
* '''vehicle_left''' Make the player's vehicle turn left&lt;br /&gt;
* '''vehicle_right''' Make the player's vehicle turn right&lt;br /&gt;
* '''steer_forward''' Make the player's vehicle turn down (lean forwards for helicopters/planes)&lt;br /&gt;
* '''steer_back''' Make the player's vehicle turn up (lean backwards for helicopters/planes)&lt;br /&gt;
* '''accelerate''' Make the player's vehicle accelerate&lt;br /&gt;
* '''brake_reverse''' Make the player's vehicle brake (slow down) and if stationary reverse&lt;br /&gt;
* '''radio_next''' Change to the next radio station (Doesn't work - use [[setRadioChannel]] and [[onClientPlayerRadioSwitch]] instead.)&lt;br /&gt;
* '''radio_previous''' Change to the previous radio station (Doesn't work - use [[setRadioChannel]] and [[onClientPlayerRadioSwitch]] instead.)&lt;br /&gt;
* '''radio_user_track_skip''' Skip the current track being played on the custom radio station&lt;br /&gt;
* '''horn''' Play the horn of the player's vehicle (if the vehicle has a horn) and can trigger the siren on emergency vehicles&lt;br /&gt;
* '''sub_mission''' Start a submission if one is avaliable (e.g. taxi missions)&lt;br /&gt;
* '''handbrake''' Apply the handbrake on the player's vehicle&lt;br /&gt;
* '''vehicle_look_left''' Look to the left&lt;br /&gt;
* '''vehicle_look_right''' Look to the right&lt;br /&gt;
* '''vehicle_look_behind''' Look behind&lt;br /&gt;
* '''vehicle_mouse_look''' &lt;br /&gt;
* '''special_control_left''' Move the some special vehicle component left (e.g. tank's turret)&lt;br /&gt;
* '''special_control_right''' Move the some special vehicle component right (e.g. tank's turret)&lt;br /&gt;
* '''special_control_down''' Move the some special vehicle component down (e.g. tank's turret)&lt;br /&gt;
* '''special_control_up''' Move the some special vehicle component up (e.g. tank's turret)&lt;br /&gt;
* '''enter_exit''' Make the player exit a vehicle&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MTA hard-coded commands==&lt;br /&gt;
The following are names of hard-coded MTA commands which do not use bindKey, but can act as bindKey by using them in an [[addCommandHandler]]. Other than that, this control list will '''only''' work with the functions [[toggleControl]] and [[toggleAllControls]]. Please note that [[toggleControl]] can't disable screenshot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid blue;margin-bottom:3px;&amp;quot;&amp;gt;&amp;lt;div&lt;br /&gt;
style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;MTA COMMANDS&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''enter_passenger''' Enters the closest vehicle as passenger&lt;br /&gt;
* '''screenshot''' Takes a screenshot&lt;br /&gt;
* '''chatbox''' Opens the chatbox for input&lt;br /&gt;
* '''radar''' Toggles the radar-map showing&lt;br /&gt;
* '''radar_zoom_in''' Zooms in on the radar-map&lt;br /&gt;
* '''radar_zoom_out''' Zooms out on the radar-map&lt;br /&gt;
* '''radar_move_north''' Moves north on the radar-map&lt;br /&gt;
* '''radar_move_south''' Moves south on the radar-map&lt;br /&gt;
* '''radar_move_east''' Moves east on the radar-map&lt;br /&gt;
* '''radar_move_west''' Moves west on the radar-map&lt;br /&gt;
* '''radar_attach''' Attaches the view to the local-player on the radar-map&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Control_names&amp;diff=65835</id>
		<title>Control names</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Control_names&amp;diff=65835"/>
		<updated>2020-04-11T23:31:41Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* GTA control list */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists all the control names. These can be used as key arguments by the console commands ''bind'' and ''unbind'' as well as scripting functions such as [[bindKey]], [[unbindKey]], [[toggleControl]] etc.&lt;br /&gt;
&lt;br /&gt;
Lua table of all the valid control names listed on this page:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;controlTable = { &amp;quot;fire&amp;quot;, &amp;quot;aim_weapon&amp;quot;, &amp;quot;next_weapon&amp;quot;, &amp;quot;previous_weapon&amp;quot;, &amp;quot;forwards&amp;quot;, &amp;quot;backwards&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot;, &amp;quot;zoom_in&amp;quot;, &amp;quot;zoom_out&amp;quot;,&lt;br /&gt;
 &amp;quot;change_camera&amp;quot;, &amp;quot;jump&amp;quot;, &amp;quot;sprint&amp;quot;, &amp;quot;look_behind&amp;quot;, &amp;quot;crouch&amp;quot;, &amp;quot;action&amp;quot;, &amp;quot;walk&amp;quot;, &amp;quot;conversation_yes&amp;quot;, &amp;quot;conversation_no&amp;quot;,&lt;br /&gt;
 &amp;quot;group_control_forwards&amp;quot;, &amp;quot;group_control_back&amp;quot;, &amp;quot;enter_exit&amp;quot;, &amp;quot;vehicle_fire&amp;quot;, &amp;quot;vehicle_secondary_fire&amp;quot;, &amp;quot;vehicle_left&amp;quot;, &amp;quot;vehicle_right&amp;quot;,&lt;br /&gt;
 &amp;quot;steer_forward&amp;quot;, &amp;quot;steer_back&amp;quot;, &amp;quot;accelerate&amp;quot;, &amp;quot;brake_reverse&amp;quot;, &amp;quot;radio_next&amp;quot;, &amp;quot;radio_previous&amp;quot;, &amp;quot;radio_user_track_skip&amp;quot;, &amp;quot;horn&amp;quot;, &amp;quot;sub_mission&amp;quot;,&lt;br /&gt;
 &amp;quot;handbrake&amp;quot;, &amp;quot;vehicle_look_left&amp;quot;, &amp;quot;vehicle_look_right&amp;quot;, &amp;quot;vehicle_look_behind&amp;quot;, &amp;quot;vehicle_mouse_look&amp;quot;, &amp;quot;special_control_left&amp;quot;, &amp;quot;special_control_right&amp;quot;,&lt;br /&gt;
 &amp;quot;special_control_down&amp;quot;, &amp;quot;special_control_up&amp;quot; }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GTA control list==&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid green;margin-bottom:3px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;ON FOOT&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''fire''' Fire a player's weapon (Note: If you want to disable weapons fire, remember to also disable the control action in addition to the control fire.)&lt;br /&gt;
* '''aim_weapon''' Aim the player's current weapon (if possible) (this also affects right-click + F punching)&lt;br /&gt;
* '''next_weapon''' Switch to the next weapon&lt;br /&gt;
* '''previous_weapon''' Switch to the previous weapon&lt;br /&gt;
* '''forwards''' Move forwards&lt;br /&gt;
* '''backwards''' Move backwards&lt;br /&gt;
* '''left''' Move left&lt;br /&gt;
* '''right''' Move right&lt;br /&gt;
* '''zoom_in''' Zoom targeted weapon in (sniper/rocket launcher/camera etc)&lt;br /&gt;
* '''zoom_out''' Zoom targeted weapon out&lt;br /&gt;
* '''change_camera''' Change camera mode&lt;br /&gt;
* '''jump''' Make the player jump&lt;br /&gt;
* '''sprint''' Make the player sprint&lt;br /&gt;
* '''look_behind''' Make the player look behind (and allow the player to see behind them)&lt;br /&gt;
* '''crouch''' Make the player crouch/duck&lt;br /&gt;
* '''action''' Show the stats menu - Fire with tab key.&lt;br /&gt;
* '''walk''' Make the player move slowly/quietly&lt;br /&gt;
* '''conversation_yes''' Answer yes to a question&lt;br /&gt;
* '''conversation_no''' Answer no to a question&lt;br /&gt;
* '''group_control_forwards''' Make the group you are controlling move forwards&lt;br /&gt;
* '''group_control_back''' Make the group you are controlling move backwards&lt;br /&gt;
* '''enter_exit''' Make the player enter a vehicle. Also used for alternative fighting styles.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid red;margin-bottom:3px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;IN VEHICLE&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''vehicle_fire''' Fire the player's vehicle's primary weapon (e.g. hunter's missiles) or shoot with driveby&lt;br /&gt;
* '''vehicle_secondary_fire''' Fire the player's vehicle's secondary weapon (e.g. hunter's minigun)&lt;br /&gt;
* '''vehicle_left''' Make the player's vehicle turn left&lt;br /&gt;
* '''vehicle_right''' Make the player's vehicle turn right&lt;br /&gt;
* '''steer_forward''' Make the player's vehicle turn down (lean forwards for helicopters/planes)&lt;br /&gt;
* '''steer_back''' Make the player's vehicle turn up (lean backwards for helicopters/planes)&lt;br /&gt;
* '''accelerate''' Make the player's vehicle accelerate&lt;br /&gt;
* '''brake_reverse''' Make the player's vehicle brake (slow down) and if stationary reverse&lt;br /&gt;
* '''radio_next''' Change to the next radio station (Doesn't work - use [[setRadioChannel]] and [[onClientPlayerRadioSwitch]] instead.)&lt;br /&gt;
* '''radio_previous''' Change to the previous radio station (Doesn't work - use [[setRadioChannel]] and [[onClientPlayerRadioSwitch]] instead.)&lt;br /&gt;
* '''radio_user_track_skip''' Skip the current track being played on the custom radio station&lt;br /&gt;
* '''horn''' Play the horn of the player's vehicle (if the vehicle has a horn) and can trigger the siren on emergency vehicles&lt;br /&gt;
* '''sub_mission''' Start a submission if one is avaliable (e.g. taxi missions)&lt;br /&gt;
* '''handbrake''' Apply the handbrake on the player's vehicle&lt;br /&gt;
* '''vehicle_look_left''' Look to the left&lt;br /&gt;
* '''vehicle_look_right''' Look to the right&lt;br /&gt;
* '''vehicle_look_behind''' Look behind&lt;br /&gt;
* '''vehicle_mouse_look''' &lt;br /&gt;
* '''special_control_left''' Move the some special vehicle component left (e.g. tank's turret)&lt;br /&gt;
* '''special_control_right''' Move the some special vehicle component right (e.g. tank's turret)&lt;br /&gt;
* '''special_control_down''' Move the some special vehicle component down (e.g. tank's turret)&lt;br /&gt;
* '''special_control_up''' Move the some special vehicle component up (e.g. tank's turret)&lt;br /&gt;
* '''enter_exit''' Make the player exit a vehicle&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MTA hard-coded commands==&lt;br /&gt;
The following are names of hard-coded MTA commands which do not use bindKey, but can act as bindKey by using them in an [[addCommandHandler]]. Other than that, this control list will '''only''' work with the functions [[toggleControl]] and [[toggleAllControls]]. Please note that [[toggleControl]] can't disable screenshot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid blue;margin-bottom:3px;&amp;quot;&amp;gt;&amp;lt;div&lt;br /&gt;
style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;MTA COMMANDS&amp;lt;/div&amp;gt;&lt;br /&gt;
* '''enter_passenger''' Enters the closest vehicle as passenger&lt;br /&gt;
* '''screenshot''' Takes a screenshot&lt;br /&gt;
* '''chatbox''' Opens the chatbox for input&lt;br /&gt;
* '''radar''' Toggles the radar-map showing&lt;br /&gt;
* '''radar_zoom_in''' Zooms in on the radar-map&lt;br /&gt;
* '''radar_zoom_out''' Zooms out on the radar-map&lt;br /&gt;
* '''radar_move_north''' Moves north on the radar-map&lt;br /&gt;
* '''radar_move_south''' Moves south on the radar-map&lt;br /&gt;
* '''radar_move_east''' Moves east on the radar-map&lt;br /&gt;
* '''radar_move_west''' Moves west on the radar-map&lt;br /&gt;
* '''radar_attach''' Attaches the view to the local-player on the radar-map&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:About&amp;diff=65828</id>
		<title>Multi Theft Auto: Wiki:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Multi_Theft_Auto:_Wiki:About&amp;diff=65828"/>
		<updated>2020-04-10T23:15:51Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Multi Theft Auto''' ''(MTA)'' is a multiplayer modification for the Microsoft Windows version of Rockstar North games Grand Theft Auto III, Grand Theft Auto: Vice City and Grand Theft Auto: San Andreas that adds online multiplayer functionality, find out more at [https://en.wikipedia.org/wiki/Multi_Theft_Auto wikipedia.org]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MTA_Classes&amp;diff=65827</id>
		<title>MTA Classes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MTA_Classes&amp;diff=65827"/>
		<updated>2020-04-10T23:13:55Z</updated>

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

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Tre.png|frame|Element tree]]&lt;br /&gt;
MTA uses a so-called ''element tree'' to store all the elements that exist on the server and the client. This is directly related to the set of running [[resources]] and their map files' XML layout, although it can be changed at run-time by scripts.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the concept of ''trees'' in computer-science, this should be easy to understand. If you are not, think of it as a family tree - except everyone only has a single parent. Every [[element]] has a ''parent'' element.&lt;br /&gt;
&lt;br /&gt;
All elements that are created within scripts or from .map files are child elements of the resource they belong to. Thus, most elements (except for [[client]]s) exist only within resources and are also destroyed as soon as their resource is stopped.&lt;br /&gt;
&lt;br /&gt;
==Tree elements==&lt;br /&gt;
* '''root''': This is at the very base of the tree - all elements are children (or descendants) of this element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRootElement()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''resource''': These are direct children of the root element - with one for each ''running'' resource. This element is called the ''resource root''. Its ID holds the name of the resource.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getResourceRootElement()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''map''': Each resource element contains at least one map element, representing either a &amp;quot;.map&amp;quot; file in the resource or the one containing the elements created by scripts (this is called the ''dynamic'' map). Their IDs contain the maps' filenames, or ''dynamic'' for the dynamic map.&lt;br /&gt;
** Map files can contain a number of other [[element]]s as well as an unlimited number of custom elements.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This in an example of a serverside tree dumped to XML from a running server.&lt;br /&gt;
''Please note that it is shortened on some places for the sake of overview.''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
	&amp;lt;console/&amp;gt;&lt;br /&gt;
	&amp;lt;player dontRespawn=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;player dontRespawn=&amp;quot;false&amp;quot; lastSpawnarea=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;resourcebrowser&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;ajax&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;resourcemanager&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;spawnmanager&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;mapmanager&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;runcode&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;fr&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;map id=&amp;quot;dynamic&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;vehicle/&amp;gt;&lt;br /&gt;
		&amp;lt;/map&amp;gt;&lt;br /&gt;
	&amp;lt;/resource&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;elementbrowser&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;assault&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;map id=&amp;quot;dynamic&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;team/&amp;gt;&lt;br /&gt;
			&amp;lt;team/&amp;gt;&lt;br /&gt;
			&amp;lt;blip/&amp;gt;&lt;br /&gt;
			&amp;lt;marker/&amp;gt;&lt;br /&gt;
			&amp;lt;colshape/&amp;gt;&lt;br /&gt;
			&amp;lt;blip/&amp;gt;&lt;br /&gt;
			&amp;lt;blip/&amp;gt;&lt;br /&gt;
		&amp;lt;/map&amp;gt;&lt;br /&gt;
	&amp;lt;/resource&amp;gt;&lt;br /&gt;
	&amp;lt;resource id=&amp;quot;as-farm&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;map id=&amp;quot;dynamic&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;map id=&amp;quot;as-farm.map&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;spawngroup req=&amp;quot;&amp;quot; type=&amp;quot;attacker&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;spawnarea posY=&amp;quot;-8.3976354598999&amp;quot; posX=&amp;quot;20.182683944702&amp;quot; skins=&amp;quot;9&amp;quot; ... /&amp;gt;&lt;br /&gt;
			&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
			&amp;lt;spawngroup req=&amp;quot;&amp;quot; type=&amp;quot;attacker&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;spawnarea posY=&amp;quot;32.166355133057&amp;quot; posX=&amp;quot;-46.90763092041&amp;quot; skins=&amp;quot;9&amp;quot; ... /&amp;gt;&lt;br /&gt;
			&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
			&amp;lt;spawngroup req=&amp;quot;&amp;quot; type=&amp;quot;attacker&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;spawnarea posY=&amp;quot;35.214984893799&amp;quot; posX=&amp;quot;-33.486911773682&amp;quot; skins=&amp;quot;9&amp;quot; ... /&amp;gt;&lt;br /&gt;
			&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
			&amp;lt;spawngroup req=&amp;quot;&amp;quot; type=&amp;quot;attacker&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;spawnarea posY=&amp;quot;35.214984893799&amp;quot; posX=&amp;quot;-33.486911773682&amp;quot; skins=&amp;quot;9&amp;quot; ... /&amp;gt;&lt;br /&gt;
			&amp;lt;/spawngroup&amp;gt;&lt;br /&gt;
			&amp;lt;objective id=&amp;quot;first&amp;quot; type=&amp;quot;checkpoint&amp;quot; description=&amp;quot;Breach into the farm&amp;quot; ... /&amp;gt;&lt;br /&gt;
			&amp;lt;pickup type=&amp;quot;weapon&amp;quot; ... /&amp;gt;&lt;br /&gt;
		&amp;lt;/map&amp;gt;&lt;br /&gt;
	&amp;lt;/resource&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Explanation===&lt;br /&gt;
This tree consists of a number of resource root elements, the [[Element/Console|server console]] and two [[player]] elements, that are direct children of the '''root''' element. All these resources have a ''dynamic map'' as child element (it is just not shown for most of them). These contain the elements that are created dynamically by this resource using scripts, for example a [[vehicle]]. If the resource has a map file, it is also a child element, itself containing all the elements in the .map file.&lt;br /&gt;
&lt;br /&gt;
Let's have a closer look at the '''assault''' resource: This contains just one ''dynamic'' map that has 2 teams, 3 blips, 1 marker, and 1 colshape as child elements. These are the elements that are created by the script, for example, the marker, the colshape and one of the blips are probably used for the objective.&lt;br /&gt;
&lt;br /&gt;
The '''as-farm''' resource's function on the contrary is to be a map for the '''assault''' gamemode. The dynamic map is empty (it could contain elements if there was a script in it though), while there is a map called 'as-farm.map', that contains a number of elements. These are mostly custom elements (like spawngroup, spawnarea, objective) but also a few elements that MTA creates automatically after loading the map (like pickup). In the brackets after the element type, you can see the element data it contains. These are identical with the attributes the .map file contains within these elements, while you can also set and get element data for any other elements (e.g. players) with [[setElementData]] and [[getElementData]].&lt;br /&gt;
&lt;br /&gt;
==Pratical application==&lt;br /&gt;
Elements can have as many children as they like. This does not directly affect the map in any way, but it comes into its own when combined with the scripting system.&lt;br /&gt;
&lt;br /&gt;
===Setting data for elements===&lt;br /&gt;
If you call a set... function on a node of the element tree, the function will affect every element within it (that it can work on).&lt;br /&gt;
&lt;br /&gt;
So, the following code would set the size of every marker (the only type of element the setMarkerSize function can work on) that is below the root element to ''2.5''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setMarkerSize ( getRootElement(), 2.5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same can be done on any element, it is not restricted to the root element.&lt;br /&gt;
&lt;br /&gt;
===Map manager===&lt;br /&gt;
The [[#Example|example above]] shows the way the [[map manager]] uses different resources. The 'assault' resource is the gamemode, that manages what happens on the server using scripts and thus by creating elements in the tree dynamically. When a map resource is started, the gamemode receives a [[resource|resource pointer]] referring to the started resource - in this case ''as-farm'' - from which you can retrieve and store the resource root element. Using this element in conjunction with functions like [[getElementsByType]], [[getElementData]] and various others, you can access any of the information that was loaded into the tree from the 'as-farm.map'-file through scripts in the gamemode resource.&lt;br /&gt;
&lt;br /&gt;
Another thing that has to be considered related to the tree of elements is the fact that when you change the map, you don't have to remove any elements you created within the map resource, while you '''do''' have to remove elements that are created within the gamemode resource, '''if''' they are specific to the map (which will be probably the case for those items you create based on information read from the map resource's .map files).&lt;br /&gt;
&lt;br /&gt;
==Element browser==&lt;br /&gt;
You can start the resource ''elementbrowser'' to see a live view of the element tree on your server. Just start the resource and browser to your server's web page and choose the ''Element browser'' option in the sidebar (firefox only currently).&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[hu:Element tree]]&lt;br /&gt;
[[es:Árbol de elementos]]&lt;br /&gt;
[[ru:Element tree]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Client_Manual&amp;diff=65825</id>
		<title>Client Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Client_Manual&amp;diff=65825"/>
		<updated>2020-04-10T23:02:45Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before you start==&lt;br /&gt;
Before you install Multi Theft Auto: San Andreas, first make sure that there are no modifications to GTA:SA installed. These will conflict with MTA. If you would like to keep your single-player mods, you can create two installations by reinstalling San Andreas to a second folder on your hard drive.&lt;br /&gt;
&lt;br /&gt;
Also, make sure that your machine is capable of running the game in single player. Note that if you are running single player on the absolute minimum requirements, you will experience slowdowns in MTA as it takes up extra processing power.&lt;br /&gt;
{{Note| &lt;br /&gt;
* MTA:SA will only work on GTA:SA '''v1.0'''. If you bought the game recently, it is likely that you have a later version.''' [[Known_Issues_-_FAQ#Does_MTASA_work_with_v1.01_or_v2.00_of_GTA_San_Andreas.3F| (More info)]]&lt;br /&gt;
* If you have a Steam copy of GTA: San Andreas you should [[Known_Issues_-_FAQ#I_have_the_Steam_version_of_GTA_San_Andreas._How_can_I_play_MTASA.3F|read this first]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===System requirements===&lt;br /&gt;
====Minimum system requirements====&lt;br /&gt;
The minimum system requirements for Multi Theft Auto: San Andreas are '''slightly higher''' than the original minimum requirements for Grand Theft Auto: San Andreas:&lt;br /&gt;
* Windows 7 or newer (Microsoft supported) operating system ([[Compatibility FAQ|XP and Vista work, but they are obsolete and their support is being phased out]])&lt;br /&gt;
* Intel Pentium 4 or AMD Athlon XP&lt;br /&gt;
* 1GB DDR RAM&lt;br /&gt;
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)&lt;br /&gt;
* 3.7GB of free hard disk space (3.6GB for a minimum Grand Theft Auto installation; remember that MTA caches files from the servers that you play on and require disk space)&lt;br /&gt;
* Nvidia GeForce 4 series or ATI Radeon 8xxx series (64MB VRAM and DirectX 9.0 compatible)&lt;br /&gt;
* DirectX 9.0 compatible sound card&lt;br /&gt;
* Keyboard and mouse&lt;br /&gt;
* Internet access&lt;br /&gt;
&lt;br /&gt;
====Recommended system requirements====&lt;br /&gt;
* Windows 7 or newer 64-bits (Microsoft supported) operating system&lt;br /&gt;
* Intel Core 2 Duo Processor or AMD equivalent&lt;br /&gt;
* 2GB DDR RAM&lt;br /&gt;
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)&lt;br /&gt;
* &amp;gt;5GB of free hard disk space (Remember that MTA caches files from the servers that you play on and require disk space)&lt;br /&gt;
* Nvidia GeForce FX series or higher, ATI Radeon 9xxx series or higher, Pixel Shader 2.0 compatible&lt;br /&gt;
* DirectX 9.0 compatible sound card&lt;br /&gt;
* Keyboard and mouse&lt;br /&gt;
* Broadband internet access (for smooth online play)&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* The minimum system requirements are considered the bare minimum for MTA: San Andreas, the performance can depend on the game modes that are running and the player count.&lt;br /&gt;
* For extra loading performance, more RAM is recommended.&lt;br /&gt;
* Make sure Windows is fully up to date.&lt;br /&gt;
* Make sure you head over to the [[Known_Issues_-_FAQ|Known Issues]] page if you have issues, or join us on IRC @ irc://irc.multitheftauto.com/mta or [https://mtasa.com/discord MTA discord] and do so in the #help-support channel.&lt;br /&gt;
&lt;br /&gt;
==Installing the game==&lt;br /&gt;
# If you haven't already, download the MTA:SA client from the download page at [http://mtasa.com mtasa.com].&lt;br /&gt;
# Run the installer, for Windows Vista and 7 it is required to run this with administrator rights. (The installer will ask.)&lt;br /&gt;
# You need to accept the license that comes with MTA:SA (GPLv3).&lt;br /&gt;
# You will be asked which components to install:&lt;br /&gt;
#* '''Game Client''' interfaces with the game and is a required component.&lt;br /&gt;
#* '''Dedicated Server''' enables you to host your own home-brew server.&lt;br /&gt;
#** '''Core components''' and '''Game module''' are required components for the dedicated server.&lt;br /&gt;
#** '''Core resources''' required resources for dedicated server.&lt;br /&gt;
#** '''Optional resources''' additional resources for your dedicated server, gamemodes and maps.&lt;br /&gt;
#** '''Editor''' is used to create new maps, this is an optional component.&lt;br /&gt;
#* '''Development''' development tools.&lt;br /&gt;
#** '''Module SDK''' development SDK for creating your own MTA server modules, this component requires C++ knowledge.&lt;br /&gt;
#* '''Start menu group''' creates a start menu group for the installed components.&lt;br /&gt;
#* '''Desktop icon''' creates a desktop icon for the client.&lt;br /&gt;
# You are then asked for a folder in which to install the mod. This can by anywhere and doesn't have to be in you San Andreas directory.&lt;br /&gt;
# Next, you will be asked for the directory where you have San Andreas installed. The default location is: '''C:\Program Files\Rockstar Games\GTA San Andreas\'''.&lt;br /&gt;
# When the installation completes, you will be given the option to start MTA: San Andreas straight away. Choose your option and then press '''Finish'''.&lt;br /&gt;
# You will be able to launch ''MTA San Andreas'' from your Start Menu if you wish to play.&lt;br /&gt;
&lt;br /&gt;
==Running the game==&lt;br /&gt;
# Start Multi Theft Auto by clicking the icon located in your Start Menu under '''MTA:San Andreas'''.&lt;br /&gt;
# GTA: San Andreas will start and once it is loaded, you will be presented with the MTA:SA main menu. Here you will find several options (you could also watch a how-to tutorial [http://www.youtube.com/watch?v=ShiqnOazNYw here]):&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Server_Browser.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Browse servers''' – this allows you to receive a list of available servers to play on. &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Host_Game.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Host game''' – this allows you to start a local server. &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Menu_Settings.JPG|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Settings '''– this allows you to change your in-game nickname, customize controls and adjust display settings.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:About_Menu.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''About '''– this gives you a list of contributors to the project.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Map_Editor.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Map editor '''– this allows you to create your own maps, complete with checkpoints, ramps, pickups and other objects. These can then be uploaded onto a server so that you can play them with other people.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Quit '''– this returns you back to your Windows desktop.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The easiest way to play the game is to click '''Browse Servers''' on the menu. If servers have not appeared already, press the '''Refresh''' button and MTA will scan for servers, displaying them as a list.&lt;br /&gt;
&lt;br /&gt;
* Under the '''Name''' tab, each server's name is displayed.&lt;br /&gt;
* Under the '''Players''' tab, the number of players and the maximum capacity of the server is displayed, in the format of [Used Slots] / [Maximum Slots].&lt;br /&gt;
* The '''Ping''' tab displays the ping, or latency, between your machine and the server. Ping is a measure of the time it takes for &amp;quot;packets&amp;quot; of data to be received back from the server after sending them, so a higher ping means that you will experience more lag on that particular server. Generally, servers closest to your location should have the lowest pings.&lt;br /&gt;
* The '''Host''' is the IP address of the server. You can use this address in future to connect to the same server via the Quick Connect option on the main menu.&lt;br /&gt;
&lt;br /&gt;
Each tab can be clicked to arrange the respective column in ascending or descending order.&lt;br /&gt;
&lt;br /&gt;
For optimal performance and gameplay, look for the best balance between players and ping.&lt;br /&gt;
&lt;br /&gt;
Once you have picked a server, select it and click the '''Connect''' button in the top right-hand corner of the dialog. If all goes well, you should connect to the server and automatically join the game.&lt;br /&gt;
&lt;br /&gt;
==How to Play==&lt;br /&gt;
&lt;br /&gt;
MTA:SA offers a comprehensive scripting system that allows map creators to customize many elements of the game in order to create their own innovative game modes. The game incorporates as many single player elements as possible but some aspects are different.&lt;br /&gt;
&lt;br /&gt;
The only other people on the map are your opponents, or allies if it is a team game. You can talk with them using the chatbox located in the left-hand corner of the screen by pressing '''T'''. To chat only to your team members, press '''Y'''.&lt;br /&gt;
&lt;br /&gt;
MTA's map editor allows map creators to add various GTA objects to their maps including roads, exploding barrels, ramps, buildings, hills and more. Not only this, but the objects can be scripted to move, change model and disappear. This offers a great deal of fun and variation to the gameplay. &lt;br /&gt;
&lt;br /&gt;
Holding Tab will display the scoreboard. By default, only names and pings are displayed, but scripts can add extra columns that are specific to the particular gamemode being played. For example, a deathmatch game mode would definitely have a column listing total kills, but the map creator may choose to add extra columns for the number of deaths you have and how long you have been playing for, in order to put your score into perspective.&lt;br /&gt;
&lt;br /&gt;
==Default Controls==&lt;br /&gt;
&lt;br /&gt;
===In-Game Keys===&lt;br /&gt;
&lt;br /&gt;
* F8 (or Tilde Key) - Console&lt;br /&gt;
* F11 - Show SA map ''(the following list is for use when the map is up)''&lt;br /&gt;
**numpad  /- - Zoom in and out&lt;br /&gt;
**numpad 4, 8, 6, 2 - move map left, up, right, down&lt;br /&gt;
**numpad 0 - toggle between attach to local player (map follows player blip) and free move (map stays stationary)  &lt;br /&gt;
* F12 - Take a screenshot&lt;br /&gt;
* T - Chat&lt;br /&gt;
* Y - Team Chat&lt;br /&gt;
&lt;br /&gt;
===Resource Specific Keys===&lt;br /&gt;
These keys depend on the scripts that are running on the server.&lt;br /&gt;
&lt;br /&gt;
* F9 - In-game help (Help manager resource)&lt;br /&gt;
* Z - Push to talk, if voice is enabled on the server.&lt;br /&gt;
* TAB - Player List (if [[Scoreboard]] resource is running on the server)&lt;br /&gt;
&lt;br /&gt;
==Console Commands==&lt;br /&gt;
&lt;br /&gt;
'''bind defaults''' Binds control defaults in the settings menu&lt;br /&gt;
&lt;br /&gt;
Press '''~ (tilde)''' or '''F8''' to access the console, then type a command followed by any necessary parameters (if applicable) then press Enter.&lt;br /&gt;
&lt;br /&gt;
;'''maps''' :This displays a list of all maps available on the server. &lt;br /&gt;
&lt;br /&gt;
;'''nick [nickname]''' :This changes your nickname whilst in-game to whatever you specify in the parameters.&lt;br /&gt;
&lt;br /&gt;
;'''msg [nickname] [message]''' or '''pm [nickname] [message]''' :This sends a private message to the person you specify in the [nickname] parameter. Only the person you specify can see the message. Both '''msg''' and '''pm''' perform the same function.&lt;br /&gt;
&lt;br /&gt;
;'''quit''' or '''exit''' :This disconnects you from the server and returns you to the Windows desktop. Performs the same function as the Quit button on the main menu.&lt;br /&gt;
&lt;br /&gt;
;'''ver''' :This displays the version number and copyright information for the software.&lt;br /&gt;
&lt;br /&gt;
;'''sver''' :This displays the version number of the server you are connected to.&lt;br /&gt;
&lt;br /&gt;
;'''time''' :This displays the current time.&lt;br /&gt;
&lt;br /&gt;
;'''disconnect''' :This disconnects you from the server and returns you to the main menu.&lt;br /&gt;
&lt;br /&gt;
;'''say [text]''' :This enables you to continue talking to people in the chat box whilst the console is open.&lt;br /&gt;
&lt;br /&gt;
;'''ignore [nickname]''' :This will not display any text typed by the player you wish to ignore. To stop ignoring a player, type '''ignore [nickname]''' again.&lt;br /&gt;
{{Tip|You can use these commands in the chatbox by putting a / (forward slash) in front of them.}}&lt;br /&gt;
&lt;br /&gt;
A list of console commands can be seen by typing '''help''' into the console and pressing Enter. The current map may also have extra commands which can be accessed by typing '''commands''' into the console.&lt;br /&gt;
&lt;br /&gt;
For information on more commands see: [[Client Commands]]&lt;br /&gt;
&lt;br /&gt;
==Error codes and their meanings==&lt;br /&gt;
=== Download errors ===&lt;br /&gt;
:{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code&lt;br /&gt;
!scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|UNKNOWN_ERROR&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|INVALID_FILE_DESCRIPTORS&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|INVALID_MAX_FILE_DESCRIPTOR&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|INVALID_SELECT_RETURN&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|INVALID_INITIAL_MULTI_PERFORM&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|INVALID_MULTI_PERFORM_CODE&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|INVALID_MULTI_PERFORM_CODE_NEW_DOWNLOADS&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|UNEXPECTED_CURL_MESSAGE&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|UNABLE_TO_CONNECT&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|UNABLE_TO_DOWNLOAD_FILE&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|FAILED_TO_INITIALIZE_DOWNLOAD&lt;br /&gt;
|}&lt;br /&gt;
===Fatal errors===&lt;br /&gt;
:{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code&lt;br /&gt;
!scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|no local player model on ingame event&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|no local player on ingame event&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|server downloads disabled&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|no local player model on player-list packet&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|no local player on player-list packet&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|invalid custom data length on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|invalid bitstream data on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|system entity on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|failed to create object on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|failed to create pickup on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|failed to create vehicle on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|invalid team-name length on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|invalid lua-event name length in lua-event packet&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|invalid resource name length in resource-start packet&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==='Unable to enter vehicle' errors===&lt;br /&gt;
:{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code&lt;br /&gt;
!scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|script cancelled&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|script cancelled (jack)&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|current occupier is entering/exiting&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|invalid seat&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|not close enough&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|already in a vehicle&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|already entering/exiting&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|invalid vehicle (trailer)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Special: Playing MTA on Linux or macOS?==&lt;br /&gt;
If you're one of those who use other precious systems, and want to have the client working on your computer,&lt;br /&gt;
please read the [[Client on Linux Manual]] or [[Client on Mac OS X Manual]].&lt;br /&gt;
&lt;br /&gt;
[[cs:Client Manual]]&lt;br /&gt;
[[es:Manual Cliente Deathmatch]]&lt;br /&gt;
[[de:MTA DM Client Anleitung]]&lt;br /&gt;
[[it:Manuale del Client]]&lt;br /&gt;
[[nl:Deathmatch Client Manual]]&lt;br /&gt;
[[ru:Deathmatch Client Manual]]&lt;br /&gt;
[[pl:Client Manual]]&lt;br /&gt;
[[pt-br:Manual do Cliente]]&lt;br /&gt;
[[hu:Client Manual]]&lt;br /&gt;
[[zh-cn:客户端手册]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=65824</id>
		<title>Where to buy GTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=65824"/>
		<updated>2020-04-10T23:02:20Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page outlines some of the places Grand Theft Auto San Andreas can be bought and played with MTA:SA (sometimes with an automatic downgrade step).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Compatibility'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Not all of the GTA versions listed below have been tested, but all should work correctly.  If not, visit [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this topic] and first follow the described procedure of re-installing MTA and if necessary afterward, using the patcher offered in the topic. If MTA is still not compatible, then please [https://forum.mtasa.com/forum/83-client/ contact MTA support] on the forums, or join the [https://mtasa.com/discord MTA discord] and do so in the #help-support channel.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Even though this page focuses on digital downloads, disc (DVD) versions of Windows GTA:SA are known to work fine.&lt;br /&gt;
If you are planning on buying GTA:SA to play MTA:SA, you should try to obtain a &amp;quot;Standard&amp;quot; version rather than &amp;quot;Second Edition&amp;quot;, &amp;quot;Remastered Edition&amp;quot;, or &amp;quot;Greatest Hits&amp;quot; editions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 900px; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Retailer&lt;br /&gt;
!Notes&lt;br /&gt;
!Works with MTA:SA?&lt;br /&gt;
|-&lt;br /&gt;
|[http://store.steampowered.com/app/12120/ Steam]&lt;br /&gt;
|Specialized Steam version of the game.&lt;br /&gt;
MTA installer will make this compatible for you (make sure to install the latest version of MTA '''after''' installing the Steam GTA version), but without modifying original game files.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; |[http://www.amazon.com/Grand-Theft-Auto-Andreas-Download/dp/B006YVXGJQ Amazon]&lt;br /&gt;
|For the '''Standard''' edition of the game, if MTA is incompatible, visit [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this topic] and follow the instructions.&lt;br /&gt;
|{{Partial|Unconfirmed (Standard)}}&lt;br /&gt;
|-&lt;br /&gt;
| Steam version and disc copies of GTA:SA will work fine&lt;br /&gt;
| {{Yes| Yes (Steam/Boxed DVD)}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.gamersgate.com/DD-GTASAS-GN/grand-theft-auto-san-andreas GamersGate]&lt;br /&gt;
|rowspan=4|To our knowledge, these vendors are offering Steam versions of the game (make sure to verify), and therefore will function similarly to the first entry in this article (Retailer: Steam).&lt;br /&gt;
|rowspan=&amp;quot;4&amp;quot; {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://digital.gamefly.co.uk/#!/download-grand-theft-auto-san-andreas/5006365 GameFly Digital]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.greenmangaming.com/games/grand-theft-auto-san-andreas/ GreenManGaming]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.walmart.com/ip/Grand-Theft-Auto-San-Andreas-PC-Digital-Download/55689611 Walmart]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.rockstarwarehouse.com/store/rsg/en_IE/pd/productID.5281755000 Rockstar Games Launcher]&lt;br /&gt;
|It is recommended to get GTA:SA straight from the [https://socialclub.rockstargames.com/rockstar-games-launcher Rockstar Games Launcher application] rather than the webshop page.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.microsoft.com/en-us/p/grand-theft-auto-san-andreas/9wzdncrfj1zn Windows App Store]&lt;br /&gt;
|This is a mobile version of the game ported to PC. '''Will never work with MTA.'''&lt;br /&gt;
|{{No}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[hu:Where to buy GTASA]]&lt;br /&gt;
[[es:Dónde comprar GTA: SA]]&lt;br /&gt;
[[pl:Where to buy GTASA]]&lt;br /&gt;
[[ru:Where to buy GTASA]]&lt;br /&gt;
[[uk:Where to buy GTASA]]&lt;br /&gt;
[[tr:GTA:SA Nerden Alınır]]&lt;br /&gt;
[[zh-cn:在那里可以购买GTASA]]&lt;br /&gt;
[[ro:Where to buy GTASA]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Client_Manual&amp;diff=65823</id>
		<title>Client Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Client_Manual&amp;diff=65823"/>
		<updated>2020-04-10T23:00:26Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Recommended system requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before you start==&lt;br /&gt;
Before you install Multi Theft Auto: San Andreas, first make sure that there are no modifications to GTA:SA installed. These will conflict with MTA. If you would like to keep your single-player mods, you can create two installations by reinstalling San Andreas to a second folder on your hard drive.&lt;br /&gt;
&lt;br /&gt;
Also, make sure that your machine is capable of running the game in single player. Note that if you are running single player on the absolute minimum requirements, you will experience slowdowns in MTA as it takes up extra processing power.&lt;br /&gt;
{{Note| &lt;br /&gt;
* MTA:SA will only work on GTA:SA '''v1.0'''. If you bought the game recently, it is likely that you have a later version.''' [[Known_Issues_-_FAQ#Does_MTASA_work_with_v1.01_or_v2.00_of_GTA_San_Andreas.3F| (More info)]]&lt;br /&gt;
* If you have a Steam copy of GTA: San Andreas you should [[Known_Issues_-_FAQ#I_have_the_Steam_version_of_GTA_San_Andreas._How_can_I_play_MTASA.3F|read this first]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===System requirements===&lt;br /&gt;
====Minimum system requirements====&lt;br /&gt;
The minimum system requirements for Multi Theft Auto: San Andreas are '''slightly higher''' than the original minimum requirements for Grand Theft Auto: San Andreas:&lt;br /&gt;
* Windows 7 or newer (Microsoft supported) operating system ([[Compatibility FAQ|XP and Vista work, but they are obsolete and their support is being phased out]])&lt;br /&gt;
* Intel Pentium 4 or AMD Athlon XP&lt;br /&gt;
* 1GB DDR RAM&lt;br /&gt;
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)&lt;br /&gt;
* 3.7GB of free hard disk space (3.6GB for a minimum Grand Theft Auto installation; remember that MTA caches files from the servers that you play on and require disk space)&lt;br /&gt;
* Nvidia GeForce 4 series or ATI Radeon 8xxx series (64MB VRAM and DirectX 9.0 compatible)&lt;br /&gt;
* DirectX 9.0 compatible sound card&lt;br /&gt;
* Keyboard and mouse&lt;br /&gt;
* Internet access&lt;br /&gt;
&lt;br /&gt;
====Recommended system requirements====&lt;br /&gt;
* Windows 7 or newer 64-bits (Microsoft supported) operating system&lt;br /&gt;
* Intel Core 2 Duo Processor or AMD equivalent&lt;br /&gt;
* 2GB DDR RAM&lt;br /&gt;
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)&lt;br /&gt;
* &amp;gt;5GB of free hard disk space (Remember that MTA caches files from the servers that you play on and require disk space)&lt;br /&gt;
* Nvidia GeForce FX series or higher, ATI Radeon 9xxx series or higher, Pixel Shader 2.0 compatible&lt;br /&gt;
* DirectX 9.0 compatible sound card&lt;br /&gt;
* Keyboard and mouse&lt;br /&gt;
* Broadband internet access (for smooth online play)&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* The minimum system requirements are considered the bare minimum for MTA: San Andreas, the performance can depend on the game modes that are running and the player count.&lt;br /&gt;
* For extra loading performance, more RAM is recommended.&lt;br /&gt;
* Make sure Windows is fully up to date.&lt;br /&gt;
* Make sure you head over to the [[Known_Issues_-_FAQ|Known Issues]] page if you have issues, or join us on IRC @ irc://irc.multitheftauto.com/mta&lt;br /&gt;
&lt;br /&gt;
==Installing the game==&lt;br /&gt;
# If you haven't already, download the MTA:SA client from the download page at [http://mtasa.com mtasa.com].&lt;br /&gt;
# Run the installer, for Windows Vista and 7 it is required to run this with administrator rights. (The installer will ask.)&lt;br /&gt;
# You need to accept the license that comes with MTA:SA (GPLv3).&lt;br /&gt;
# You will be asked which components to install:&lt;br /&gt;
#* '''Game Client''' interfaces with the game and is a required component.&lt;br /&gt;
#* '''Dedicated Server''' enables you to host your own home-brew server.&lt;br /&gt;
#** '''Core components''' and '''Game module''' are required components for the dedicated server.&lt;br /&gt;
#** '''Core resources''' required resources for dedicated server.&lt;br /&gt;
#** '''Optional resources''' additional resources for your dedicated server, gamemodes and maps.&lt;br /&gt;
#** '''Editor''' is used to create new maps, this is an optional component.&lt;br /&gt;
#* '''Development''' development tools.&lt;br /&gt;
#** '''Module SDK''' development SDK for creating your own MTA server modules, this component requires C++ knowledge.&lt;br /&gt;
#* '''Start menu group''' creates a start menu group for the installed components.&lt;br /&gt;
#* '''Desktop icon''' creates a desktop icon for the client.&lt;br /&gt;
# You are then asked for a folder in which to install the mod. This can by anywhere and doesn't have to be in you San Andreas directory.&lt;br /&gt;
# Next, you will be asked for the directory where you have San Andreas installed. The default location is: '''C:\Program Files\Rockstar Games\GTA San Andreas\'''.&lt;br /&gt;
# When the installation completes, you will be given the option to start MTA: San Andreas straight away. Choose your option and then press '''Finish'''.&lt;br /&gt;
# You will be able to launch ''MTA San Andreas'' from your Start Menu if you wish to play.&lt;br /&gt;
&lt;br /&gt;
==Running the game==&lt;br /&gt;
# Start Multi Theft Auto by clicking the icon located in your Start Menu under '''MTA:San Andreas'''.&lt;br /&gt;
# GTA: San Andreas will start and once it is loaded, you will be presented with the MTA:SA main menu. Here you will find several options (you could also watch a how-to tutorial [http://www.youtube.com/watch?v=ShiqnOazNYw here]):&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Server_Browser.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Browse servers''' – this allows you to receive a list of available servers to play on. &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Host_Game.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Host game''' – this allows you to start a local server. &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Menu_Settings.JPG|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Settings '''– this allows you to change your in-game nickname, customize controls and adjust display settings.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:About_Menu.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''About '''– this gives you a list of contributors to the project.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
[[Image:Map_Editor.jpg|280px]]&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Map editor '''– this allows you to create your own maps, complete with checkpoints, ramps, pickups and other objects. These can then be uploaded onto a server so that you can play them with other people.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;188&amp;quot; |&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
| width=&amp;quot;380&amp;quot; |&lt;br /&gt;
&amp;lt;font size=&amp;quot;-1&amp;quot; face=&amp;quot;tahoma,helvetica,arial,sans-serif&amp;quot;&amp;gt;'''Quit '''– this returns you back to your Windows desktop.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The easiest way to play the game is to click '''Browse Servers''' on the menu. If servers have not appeared already, press the '''Refresh''' button and MTA will scan for servers, displaying them as a list.&lt;br /&gt;
&lt;br /&gt;
* Under the '''Name''' tab, each server's name is displayed.&lt;br /&gt;
* Under the '''Players''' tab, the number of players and the maximum capacity of the server is displayed, in the format of [Used Slots] / [Maximum Slots].&lt;br /&gt;
* The '''Ping''' tab displays the ping, or latency, between your machine and the server. Ping is a measure of the time it takes for &amp;quot;packets&amp;quot; of data to be received back from the server after sending them, so a higher ping means that you will experience more lag on that particular server. Generally, servers closest to your location should have the lowest pings.&lt;br /&gt;
* The '''Host''' is the IP address of the server. You can use this address in future to connect to the same server via the Quick Connect option on the main menu.&lt;br /&gt;
&lt;br /&gt;
Each tab can be clicked to arrange the respective column in ascending or descending order.&lt;br /&gt;
&lt;br /&gt;
For optimal performance and gameplay, look for the best balance between players and ping.&lt;br /&gt;
&lt;br /&gt;
Once you have picked a server, select it and click the '''Connect''' button in the top right-hand corner of the dialog. If all goes well, you should connect to the server and automatically join the game.&lt;br /&gt;
&lt;br /&gt;
==How to Play==&lt;br /&gt;
&lt;br /&gt;
MTA:SA offers a comprehensive scripting system that allows map creators to customize many elements of the game in order to create their own innovative game modes. The game incorporates as many single player elements as possible but some aspects are different.&lt;br /&gt;
&lt;br /&gt;
The only other people on the map are your opponents, or allies if it is a team game. You can talk with them using the chatbox located in the left-hand corner of the screen by pressing '''T'''. To chat only to your team members, press '''Y'''.&lt;br /&gt;
&lt;br /&gt;
MTA's map editor allows map creators to add various GTA objects to their maps including roads, exploding barrels, ramps, buildings, hills and more. Not only this, but the objects can be scripted to move, change model and disappear. This offers a great deal of fun and variation to the gameplay. &lt;br /&gt;
&lt;br /&gt;
Holding Tab will display the scoreboard. By default, only names and pings are displayed, but scripts can add extra columns that are specific to the particular gamemode being played. For example, a deathmatch game mode would definitely have a column listing total kills, but the map creator may choose to add extra columns for the number of deaths you have and how long you have been playing for, in order to put your score into perspective.&lt;br /&gt;
&lt;br /&gt;
==Default Controls==&lt;br /&gt;
&lt;br /&gt;
===In-Game Keys===&lt;br /&gt;
&lt;br /&gt;
* F8 (or Tilde Key) - Console&lt;br /&gt;
* F11 - Show SA map ''(the following list is for use when the map is up)''&lt;br /&gt;
**numpad  /- - Zoom in and out&lt;br /&gt;
**numpad 4, 8, 6, 2 - move map left, up, right, down&lt;br /&gt;
**numpad 0 - toggle between attach to local player (map follows player blip) and free move (map stays stationary)  &lt;br /&gt;
* F12 - Take a screenshot&lt;br /&gt;
* T - Chat&lt;br /&gt;
* Y - Team Chat&lt;br /&gt;
&lt;br /&gt;
===Resource Specific Keys===&lt;br /&gt;
These keys depend on the scripts that are running on the server.&lt;br /&gt;
&lt;br /&gt;
* F9 - In-game help (Help manager resource)&lt;br /&gt;
* Z - Push to talk, if voice is enabled on the server.&lt;br /&gt;
* TAB - Player List (if [[Scoreboard]] resource is running on the server)&lt;br /&gt;
&lt;br /&gt;
==Console Commands==&lt;br /&gt;
&lt;br /&gt;
'''bind defaults''' Binds control defaults in the settings menu&lt;br /&gt;
&lt;br /&gt;
Press '''~ (tilde)''' or '''F8''' to access the console, then type a command followed by any necessary parameters (if applicable) then press Enter.&lt;br /&gt;
&lt;br /&gt;
;'''maps''' :This displays a list of all maps available on the server. &lt;br /&gt;
&lt;br /&gt;
;'''nick [nickname]''' :This changes your nickname whilst in-game to whatever you specify in the parameters.&lt;br /&gt;
&lt;br /&gt;
;'''msg [nickname] [message]''' or '''pm [nickname] [message]''' :This sends a private message to the person you specify in the [nickname] parameter. Only the person you specify can see the message. Both '''msg''' and '''pm''' perform the same function.&lt;br /&gt;
&lt;br /&gt;
;'''quit''' or '''exit''' :This disconnects you from the server and returns you to the Windows desktop. Performs the same function as the Quit button on the main menu.&lt;br /&gt;
&lt;br /&gt;
;'''ver''' :This displays the version number and copyright information for the software.&lt;br /&gt;
&lt;br /&gt;
;'''sver''' :This displays the version number of the server you are connected to.&lt;br /&gt;
&lt;br /&gt;
;'''time''' :This displays the current time.&lt;br /&gt;
&lt;br /&gt;
;'''disconnect''' :This disconnects you from the server and returns you to the main menu.&lt;br /&gt;
&lt;br /&gt;
;'''say [text]''' :This enables you to continue talking to people in the chat box whilst the console is open.&lt;br /&gt;
&lt;br /&gt;
;'''ignore [nickname]''' :This will not display any text typed by the player you wish to ignore. To stop ignoring a player, type '''ignore [nickname]''' again.&lt;br /&gt;
{{Tip|You can use these commands in the chatbox by putting a / (forward slash) in front of them.}}&lt;br /&gt;
&lt;br /&gt;
A list of console commands can be seen by typing '''help''' into the console and pressing Enter. The current map may also have extra commands which can be accessed by typing '''commands''' into the console.&lt;br /&gt;
&lt;br /&gt;
For information on more commands see: [[Client Commands]]&lt;br /&gt;
&lt;br /&gt;
==Error codes and their meanings==&lt;br /&gt;
=== Download errors ===&lt;br /&gt;
:{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code&lt;br /&gt;
!scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|UNKNOWN_ERROR&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|INVALID_FILE_DESCRIPTORS&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|INVALID_MAX_FILE_DESCRIPTOR&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|INVALID_SELECT_RETURN&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|INVALID_INITIAL_MULTI_PERFORM&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|INVALID_MULTI_PERFORM_CODE&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|INVALID_MULTI_PERFORM_CODE_NEW_DOWNLOADS&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|UNEXPECTED_CURL_MESSAGE&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|UNABLE_TO_CONNECT&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|UNABLE_TO_DOWNLOAD_FILE&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|FAILED_TO_INITIALIZE_DOWNLOAD&lt;br /&gt;
|}&lt;br /&gt;
===Fatal errors===&lt;br /&gt;
:{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code&lt;br /&gt;
!scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|no local player model on ingame event&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|no local player on ingame event&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|server downloads disabled&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|no local player model on player-list packet&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|no local player on player-list packet&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|invalid custom data length on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|invalid bitstream data on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|system entity on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|failed to create object on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|failed to create pickup on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|failed to create vehicle on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|invalid team-name length on entity-add packet&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|invalid lua-event name length in lua-event packet&lt;br /&gt;
|-&lt;br /&gt;
|14&lt;br /&gt;
|invalid resource name length in resource-start packet&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==='Unable to enter vehicle' errors===&lt;br /&gt;
:{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: auto; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Code&lt;br /&gt;
!scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Meaning&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|script cancelled&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|script cancelled (jack)&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|current occupier is entering/exiting&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|invalid seat&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|not close enough&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|already in a vehicle&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|already entering/exiting&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|invalid vehicle (trailer)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Special: Playing MTA on Linux or macOS?==&lt;br /&gt;
If you're one of those who use other precious systems, and want to have the client working on your computer,&lt;br /&gt;
please read the [[Client on Linux Manual]] or [[Client on Mac OS X Manual]].&lt;br /&gt;
&lt;br /&gt;
[[cs:Client Manual]]&lt;br /&gt;
[[es:Manual Cliente Deathmatch]]&lt;br /&gt;
[[de:MTA DM Client Anleitung]]&lt;br /&gt;
[[it:Manuale del Client]]&lt;br /&gt;
[[nl:Deathmatch Client Manual]]&lt;br /&gt;
[[ru:Deathmatch Client Manual]]&lt;br /&gt;
[[pl:Client Manual]]&lt;br /&gt;
[[pt-br:Manual do Cliente]]&lt;br /&gt;
[[hu:Client Manual]]&lt;br /&gt;
[[zh-cn:客户端手册]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=65822</id>
		<title>Where to buy GTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Where_to_buy_GTASA&amp;diff=65822"/>
		<updated>2020-04-10T22:59:08Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page outlines some of the places Grand Theft Auto San Andreas can be bought and played with MTA:SA (sometimes with an automatic downgrade step).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Compatibility'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Not all of the GTA versions listed below have been tested, but all should work correctly.  If not, visit [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this topic] and first follow the described procedure of re-installing MTA and if necessary afterward, using the patcher offered in the topic. If MTA is still not compatible, then please [https://forum.mtasa.com/forum/83-client/ contact MTA support] on the forums, or join the [https://mtasa.com/discord MTA discord] and do so in the #support channel.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Even though this page focuses on digital downloads, disc (DVD) versions of Windows GTA:SA are known to work fine.&lt;br /&gt;
If you are planning on buying GTA:SA to play MTA:SA, you should try to obtain a &amp;quot;Standard&amp;quot; version rather than &amp;quot;Second Edition&amp;quot;, &amp;quot;Remastered Edition&amp;quot;, or &amp;quot;Greatest Hits&amp;quot; editions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 900px; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Retailer&lt;br /&gt;
!Notes&lt;br /&gt;
!Works with MTA:SA?&lt;br /&gt;
|-&lt;br /&gt;
|[http://store.steampowered.com/app/12120/ Steam]&lt;br /&gt;
|Specialized Steam version of the game.&lt;br /&gt;
MTA installer will make this compatible for you (make sure to install the latest version of MTA '''after''' installing the Steam GTA version), but without modifying original game files.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; |[http://www.amazon.com/Grand-Theft-Auto-Andreas-Download/dp/B006YVXGJQ Amazon]&lt;br /&gt;
|For the '''Standard''' edition of the game, if MTA is incompatible, visit [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this topic] and follow the instructions.&lt;br /&gt;
|{{Partial|Unconfirmed (Standard)}}&lt;br /&gt;
|-&lt;br /&gt;
| Steam version and disc copies of GTA:SA will work fine&lt;br /&gt;
| {{Yes| Yes (Steam/Boxed DVD)}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.gamersgate.com/DD-GTASAS-GN/grand-theft-auto-san-andreas GamersGate]&lt;br /&gt;
|rowspan=4|To our knowledge, these vendors are offering Steam versions of the game (make sure to verify), and therefore will function similarly to the first entry in this article (Retailer: Steam).&lt;br /&gt;
|rowspan=&amp;quot;4&amp;quot; {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://digital.gamefly.co.uk/#!/download-grand-theft-auto-san-andreas/5006365 GameFly Digital]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.greenmangaming.com/games/grand-theft-auto-san-andreas/ GreenManGaming]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.walmart.com/ip/Grand-Theft-Auto-San-Andreas-PC-Digital-Download/55689611 Walmart]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.rockstarwarehouse.com/store/rsg/en_IE/pd/productID.5281755000 Rockstar Games Launcher]&lt;br /&gt;
|It is recommended to get GTA:SA straight from the [https://socialclub.rockstargames.com/rockstar-games-launcher Rockstar Games Launcher application] rather than the webshop page.&lt;br /&gt;
|{{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.microsoft.com/en-us/p/grand-theft-auto-san-andreas/9wzdncrfj1zn Windows App Store]&lt;br /&gt;
|This is a mobile version of the game ported to PC. '''Will never work with MTA.'''&lt;br /&gt;
|{{No}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[hu:Where to buy GTASA]]&lt;br /&gt;
[[es:Dónde comprar GTA: SA]]&lt;br /&gt;
[[pl:Where to buy GTASA]]&lt;br /&gt;
[[ru:Where to buy GTASA]]&lt;br /&gt;
[[uk:Where to buy GTASA]]&lt;br /&gt;
[[tr:GTA:SA Nerden Alınır]]&lt;br /&gt;
[[zh-cn:在那里可以购买GTASA]]&lt;br /&gt;
[[ro:Where to buy GTASA]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Haxardous&amp;diff=65706</id>
		<title>User:Haxardous</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Haxardous&amp;diff=65706"/>
		<updated>2020-04-06T18:52:15Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Haxardous */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Haxardous&amp;diff=65705</id>
		<title>User:Haxardous</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Haxardous&amp;diff=65705"/>
		<updated>2020-04-06T18:52:08Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Haxardous */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Haxardous ==&lt;br /&gt;
*'''Forums:''' https://forum.mtasa.com/profile/57792-haxardous/ &lt;br /&gt;
*'''GTA Forums''': https://gtaforums.com/profile/1056938-axa/&lt;br /&gt;
*'''GitHub''': https://github.com/Haxardous&lt;br /&gt;
*'''Community Resources''': https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=474102&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Known_Issues_-_FAQ&amp;diff=65704</id>
		<title>Known Issues - FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Known_Issues_-_FAQ&amp;diff=65704"/>
		<updated>2020-04-06T18:47:28Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* General */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Important Note|Before you check the known issues make sure everything is [[Up-to-date]].}}&lt;br /&gt;
Post here your proposed Q&amp;amp;A, regarding the known problems with MTA:SA and their solutions, especially the problems we are encountering now, that might be also encountered by users in the final release. You are also welcome to edit them grammar/style wise.&lt;br /&gt;
&lt;br /&gt;
* [[Resource:Editor#FAQ|Map editor FAQ/known issues can be found here.]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[MTA 0.5r2 Known Issues|Known issues for MTA 0.5r2 can be found here.]]&lt;br /&gt;
* [[Compatibility FAQ|Compatibility FAQ]]&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
=== General ===&lt;br /&gt;
==== I have the Steam version of GTA San Andreas.  How can I play MTASA? ====&lt;br /&gt;
:The Steam version of GTASA is currently incompatible with MTASA, just like it is with some other mods. However, it can be made to work with it.&lt;br /&gt;
&lt;br /&gt;
:'''If you just want to play the newest version of the mod, all you need to do is download the mod from our home page and then install it'''. The installer will detect your Steam's GTASA installation and will make some adjustments automatically.&lt;br /&gt;
:No original files are modified in the process, so the single-player mode will work the same way as it did before.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:If you want to play some older MTA:SA version (1.3.2 or older), follow a few simple steps, and the Steam version will be compatible with it:&lt;br /&gt;
:* '''Option 1:''' Find a '''GTA SA 1.00 No-CD''' (Google will give useful results).  You should obtain a 1.00 Cracked/NoCd EXE, not a Disc image.  Any HOODLUM release will work fine.&lt;br /&gt;
:** Open the download with Winrar or other similar archive tools, and inside there should be a gta_sa.exe.  Place this file inside your installation directory.  This is normally '''C:\Program Files\Steam\steamapps\common\grand theft auto san andreas'''.  No files need to be replaced during this process.&lt;br /&gt;
:This procedure will not affect your Steam version of GTASA, but will allow MTASA to boot alongside it.&lt;br /&gt;
:* '''Option 2:''' Use the unofficial [https://forums.steampowered.com/forums/showthread.php?t=1952458 steam downgrade patch], be sure to downgrade to 1.0 and not 1.01.&lt;br /&gt;
&lt;br /&gt;
==== Does MTASA work with v1.01 or v2.00 of GTA San Andreas? ====&lt;br /&gt;
:No. It can be made to work with them, however - please see [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this forum topic] for instructions on patching the exe.&lt;br /&gt;
&lt;br /&gt;
==== Initial black screen/hanging GTA splash screens ====&lt;br /&gt;
:* '''MTA shows a permanent black screen or hanging GTA splash screens.'''&lt;br /&gt;
&lt;br /&gt;
:It may be necessary that during/after the logo splash screens in Grand Theft Auto you have to give some input in order to skip the videos correctly. Try to click your left-mouse button a few times, or tapping a few keys.&lt;br /&gt;
&lt;br /&gt;
:* '''MTA shows a permanent black screen after the GTA splash screens (possibly with text in the bottom right corner).'''&lt;br /&gt;
&lt;br /&gt;
:This can be related to a lack of support for DirectX or video card features, on your system, which is needed to run the dynamically rendered menu. This dynamic menu is enabled by default. You can disable it by opening your [[coreconfig.xml]] configuration file located in the ''GTA San Andreas\MTA'' directory, and changing the value of ''menu_options'' to ''248''.&lt;br /&gt;
&lt;br /&gt;
==== Halt after MTA splash screen ====&lt;br /&gt;
:* '''Nothing happens after the 'Stop playing with yourself' splash screen'''&lt;br /&gt;
&lt;br /&gt;
:If you use Nvidia GeForce, try turning off nView Desktop Manager before starting MTA.&lt;br /&gt;
&lt;br /&gt;
:Also try deleting GTA San Andreas settings file (&amp;quot;gta_sa.set&amp;quot;) in &amp;quot;Documents\GTA San Andreas User Files&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
:If it all fails and you run Kaspersky Anti-Virus or Internet Security, make sure status of &amp;quot;multi theft auto.exe&amp;quot; is not restricted. Other anti-virus software may block MTA from running.&lt;br /&gt;
&lt;br /&gt;
==== Crash after MTA splash screen ====&lt;br /&gt;
:* '''MTA crashes after the 'Stop playing with yourself' logo. Both single-player and the MTA: Race ran fine before.'''&lt;br /&gt;
&lt;br /&gt;
:Try downloading the latest DirectX Runtime files from [https://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en Microsoft]. Also check in Task Manager, if :gta_sa.exe process isn't already running.&lt;br /&gt;
&lt;br /&gt;
:If you run at any substandard resolutions (e.g. 960x720), try to change your resolution to a commonly supported one (e.g. 640×480, 800×600, 1024×768, 1152×864, 1280×1024) by launching Grand Theft Auto: San Andreas in normal mode, setting the new resolution and exiting.&lt;br /&gt;
&lt;br /&gt;
:If you are a user of Windows Vista or Windows 7, try the following:&lt;br /&gt;
:* Enable Windows XP SP3 compatibility mode for both Multi Theft Auto.exe and gta_sa.exe, setting their privilege level to &amp;quot;Run this program as an administrator&amp;quot;.&lt;br /&gt;
:* Configure Data Execution Prevention: Use the setting ''Turn DEP for all programs and services except those I select''.  Click ''add'' and find &amp;quot;Multi Theft Auto.exe&amp;quot; and &amp;quot;gta_sa.exe&amp;quot; and add them.&lt;br /&gt;
:* Run MTASA as administrator.&lt;br /&gt;
&lt;br /&gt;
==== Crash after connecting to any server ====&lt;br /&gt;
:* '''MTASA crashes upon connecting to any server. Single player runs fine.'''&lt;br /&gt;
&lt;br /&gt;
:Single-player mods can affect the way MTA:SA works, potentially causing crashes - you should always use a clean GTASA install for MTA:SA.&lt;br /&gt;
&lt;br /&gt;
:This might also occur on non-modded installs, when your GTASA executable is in an unsupported by MTA:SA version (eg. 1.0 German or Australian). To resolve this, use [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ our converter].&lt;br /&gt;
&lt;br /&gt;
==== Controls not working ====&lt;br /&gt;
:* '''My controls don't seem to work as they should.'''&lt;br /&gt;
&lt;br /&gt;
:Try using the 'copygtacontrols' command in the console.&lt;br /&gt;
&lt;br /&gt;
==== Incorrect models ====&lt;br /&gt;
:* '''Woman model's breasts look awkward ingame / I'm seeing odd, spider-like shaped player models.'''&lt;br /&gt;
&lt;br /&gt;
:This is caused by the way GTA handles player stats. To fix this, be sure to set both fat and muscles player stats to 0 when you're changing player skin.&lt;br /&gt;
&lt;br /&gt;
==== Incorrect drive-by functionality ====&lt;br /&gt;
:* '''Drivebys arent working as they should'''&lt;br /&gt;
&lt;br /&gt;
:Drivebys are handled by the script, and will change depending on the loaded gamemode.&lt;br /&gt;
&lt;br /&gt;
==== Unsaved settings ====&lt;br /&gt;
:* '''My MTA setting(s) didn't get saved (...) I crashed.'''&lt;br /&gt;
&lt;br /&gt;
:First, configure the MTA the way you want to, then exit the game and launch it again. Settings should get saved. Alternatively, try removing the coreconfig.xml file, then configure it and quit the game.&lt;br /&gt;
&lt;br /&gt;
==== Gamepad support ====&lt;br /&gt;
:* '''MTA doesn't recognise my gamepad'''&lt;br /&gt;
&lt;br /&gt;
:Ensure that your controller is the first controller recognized by Windows (MTA will only use the first controller).  You can configure your gamepad in options in MTASA's main menu.&lt;br /&gt;
&lt;br /&gt;
==== Free mouselook not working properly ====&lt;br /&gt;
:* '''MTA doesnt recognise my mouse'''&lt;br /&gt;
&lt;br /&gt;
:Some people got problems with their mouse in MTA. They can use it in the menu, connect to a server, but they can't use the mouse for free look.&lt;br /&gt;
:This problem can be solved by entering a server, click your Win/Windows key at your keyboard once, and then click your mouse.&lt;br /&gt;
:If that doesn't work try starting GTA in Singleplayer, go to options &amp;gt; controller setup and set &amp;quot;Configuration&amp;quot; to &amp;quot;Mouse + Keys&amp;quot; instead of &amp;quot;Joypad&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Server browser not working ====&lt;br /&gt;
:* '''The in-game server browser shows &amp;quot;Loading&amp;quot; but does not come up with any servers'''&lt;br /&gt;
&lt;br /&gt;
:Depending on the type and status of the internet connection you are using, it can take up to a few seconds for the server browser to retrieve all the servers. Please wait a little longer for the results to appear.&lt;br /&gt;
&lt;br /&gt;
==== Invalid serial number ====&lt;br /&gt;
:* '''I am getting an 'Invalid serial number' error when trying to launch or play the game'''&lt;br /&gt;
&lt;br /&gt;
:You are running an outdated version of Multi Theft Auto. Head over to the [https://mtasa.com/ main page] and download the latest version of Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
==== 'Network module not compatible!' on MTA:SA launch ====&lt;br /&gt;
:* '''I am getting 'Network module not compatible!' error message upon launching MTA:SA&lt;br /&gt;
&lt;br /&gt;
:This could mean that your MTA:SA install is incomplete or broken. Reinstall it.&lt;br /&gt;
&lt;br /&gt;
==== 'No such mod installed (deathmatch)' ====&lt;br /&gt;
:* '''I am getting a 'No such mod installed (deathmatch)' error message when trying to connect to any server&lt;br /&gt;
&lt;br /&gt;
:'''Option 1:''' Simply re-install MTA. &amp;lt;br&amp;gt;&lt;br /&gt;
:'''Option 2:''' Run both gta_sa.exe and Multi Theft Auto.exe with administrator privileges.&lt;br /&gt;
&lt;br /&gt;
==== D3dx9_**.dll is not found ====&lt;br /&gt;
:* '''When I start Multi Theft Auto: San Andreas I am getting an error D3dx9_**.dll (** = a number) cannot be found.&lt;br /&gt;
&lt;br /&gt;
:This means that DirectX 9 is not installed or not up to date.&lt;br /&gt;
:To install/update DirectX download the [https://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3 DirectX End-User Runtime Web Installer] from the Microsoft download site.&lt;br /&gt;
&lt;br /&gt;
==== CRC mismatch ====&lt;br /&gt;
:* '''When joining a server, the chatbox shows 'CRC mismatch'&lt;br /&gt;
:This is a server problem. Tell the owner to look at the server section of this page.&lt;br /&gt;
&lt;br /&gt;
==== 'Error loading netc.dll module! (Error 14001)' on MTA:SA launch ====&lt;br /&gt;
:* Full error message:&lt;br /&gt;
:''Error loading netc.dll module! (Error 14001: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.)''&lt;br /&gt;
&lt;br /&gt;
:Make sure you have installed Microsoft Visual C++ 2008 regular and SP1 redistributable packages (x86):&lt;br /&gt;
&lt;br /&gt;
:[https://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&amp;amp;displaylang=en Microsoft Visual C++ 2008 Redistributable Package (x86)]&lt;br /&gt;
&lt;br /&gt;
:[https://www.microsoft.com/download/en/details.aspx?id=5582 Microsoft Visual C++ 2008 SP1 Redistributable package (x86)]&lt;br /&gt;
&lt;br /&gt;
==== 'Error 1935. An error occurred during the installation of assembly 'Microsoft.VC90.ATL...' ====&lt;br /&gt;
: Download the 'Fix it' helper from here: [https://support.microsoft.com/default.aspx?scid=kb;en-us;946414]&lt;br /&gt;
&lt;br /&gt;
==== Your virus scanner warns you about MTA:SA ====&lt;br /&gt;
:* '''Your virus scanner informs you that the MTA:SA or setup executable is a virus or malware.'''&lt;br /&gt;
:MTA does '''NOT''' contain any viruses, malware, adware or spyware. You should re-download MTASA [https://mtasa.com here] if you doubt the validity of your copy of MTA.&lt;br /&gt;
&lt;br /&gt;
==== When downloading large maps, progress halts ====&lt;br /&gt;
:* '''When downloading large maps, progress often halts, while transmission is still taking place.'''&lt;br /&gt;
:This issue is fixed in [https://forum.mtasa.com/topic/33297-multi-theft-auto-san-andreas-13-released/ MTA:SA 1.3].&lt;br /&gt;
&lt;br /&gt;
==== loader.dll (error 126) ====&lt;br /&gt;
loader.dll (error 126) has been flagged as a false positive by Avast, McAfee and perhaps other antivirus software. This means that your antivirus software thinks it's a virus, but it actually isn't.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Avast instructions'''&lt;br /&gt;
&lt;br /&gt;
:* Make sure Avast is up to date.&lt;br /&gt;
:* Reinstall MTA.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''McAfee'''&lt;br /&gt;
:* Open your McAfee security software.&lt;br /&gt;
:* Click the settings cog at the top right.&lt;br /&gt;
:* Click Real-Time Scanning.&lt;br /&gt;
:* Click Excluded Files.&lt;br /&gt;
:* Click Add file.&lt;br /&gt;
:* Browse to, and select, the file that you want to exclude from scans.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You'll need to exclude the MTA installation folder. Once done, reinstall MTA and then add &amp;quot;loader.dll&amp;quot; to your exclusions and remove the previously added exclusion for the MTA folder. If you want you can skip the last bit and keep MTA installation folder whitelisted (excluded)&lt;br /&gt;
&lt;br /&gt;
=== Display ===&lt;br /&gt;
==== I can only set my display to square resolutions... ====&lt;br /&gt;
: Try reinstalling your display driver.&lt;br /&gt;
&lt;br /&gt;
=== Windows Vista® / Windows 7-specific (Vista is no longer supported on 1.5.7) ===&lt;br /&gt;
&lt;br /&gt;
==== Crash on connect ====&lt;br /&gt;
:* '''I seem to crash whenever I connect to a server just before I go in-game on Vista'''&lt;br /&gt;
&lt;br /&gt;
:This seems to be an issue with the Microsoft DirectX April 2006 SDK Redistributable DLL file (d3dx9_30.dll) when running in compatibility mode. Please make sure that compatibility mode is completely turned off for  '''both''' your GTA_SA.exe and Multi Theft Auto.exe executables.&lt;br /&gt;
&lt;br /&gt;
==== Clock manipulation error ====&lt;br /&gt;
:* '''I am getting 'Clock manipulation detected!' error message upon launching MTA:SA&lt;br /&gt;
&lt;br /&gt;
:This is caused by incorrect system date/time is set (which could be a result of wrong settings or a faulty battery on the pc's motherboard). Setting time and date again should fix the problem.&lt;br /&gt;
&lt;br /&gt;
:It might also happen if you are using an AMD Athlon 64 X2 processor with some old drivers. Update them at [https://support.amd.com/en-us/download AMD's site].&lt;br /&gt;
&lt;br /&gt;
==== Halt on launch ====&lt;br /&gt;
:* '''When I launch MTA:SA, nothing happens (GTA_SA.exe is running but not loading up)&lt;br /&gt;
&lt;br /&gt;
:Run MTA:SA with Administrator privileges. To do this, right-click on the installer executable, choose 'Properties', go into 'Compatibility' tab and tick the checkbox on the last field and try again.&lt;br /&gt;
&lt;br /&gt;
==== General GTA problems ====&lt;br /&gt;
:* '''I have unexplainable GTA problems or crashes'''&lt;br /&gt;
&lt;br /&gt;
:Make sure your computer, as well as your GTA install, meet the [[Deathmatch_Client_Manual#System_requirements|minimum requirements]] and that you are not running in any 98/2000/XP/2003 compatibility modes.&lt;br /&gt;
&lt;br /&gt;
:Also try the solutions from these pages:&lt;br /&gt;
:* http://gtaforums.com/topic/307992-san-andreas-v1-works-on-windows-vista/&lt;br /&gt;
:* [https://web.archive.org/web/20160330172922/http://pullmonkey.com/2007/4/30/how-i-got-gta-san-andreas-to-work-with-a-crappy-os-vista http://pullmonkey.com/2007/4/30/how-i-got-gta-san-andreas-to-work-with-a-crappy-os-vista]&lt;br /&gt;
&lt;br /&gt;
==== Performance Issues Sandy Bridge / Second Generation Intel Core ====&lt;br /&gt;
:* '''Slow MTA performance on Sandy Bridge Processors while other games and San Andreas Singleplayer run fine.'''&lt;br /&gt;
:There seems to be an issue in combination with the Windows power profile running in power saving mode, you can solve this issue by changing the power profile to high performance when playing MTA:SA.&lt;br /&gt;
:* Topic about this issue: [https://forum.mtasa.com/topic/26441-solved-sandy-bridge-performance-issues/ Sandy Bridge performance issues?]&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
==== Fatal error 3 ====&lt;br /&gt;
:* '''I'm getting ''Fatal Error 3'' whenever I connect to my server'''&lt;br /&gt;
&lt;br /&gt;
:This error happens when the server you are trying to connect to is unable to provide you the required downloads because it does not have HTTP downloading enabled. Be sure to set the '''httpdownload''' configuration tag in your configuration to '''1'''.&lt;br /&gt;
==== Download error 9: Error downloading requested files ====&lt;br /&gt;
:* '''I'm getting ''Download Error 9: Error downloading requested files'' whenever I connect to my server'''&lt;br /&gt;
&lt;br /&gt;
:This error happens when the server you are trying to connect to is unable to provide you with a valid link. This results in a 404 (Not found) HTTP error and an error at your end.&lt;br /&gt;
&lt;br /&gt;
:* If you are running the built-in server ('''httpserver''' is set to '''1''' and '''httpdownloadurl''' is empty), make sure that your HTTP server is accessible (you can try to access it by using a browser) for everyone.&lt;br /&gt;
&lt;br /&gt;
:* If you have configured an external web server ('''httpdownloadurl''' is set to your custom URL), make sure that your HTTP is accessible and make sure you have read the [[Deathmatch_Server_Manual#Configuring_an_external_web_server | Configuring an external web server]] guide.&lt;br /&gt;
&lt;br /&gt;
==== CRC mismatch ====&lt;br /&gt;
:* '''When clients join my server, their chatbox shows 'CRC mismatch'&lt;br /&gt;
:CRC mismatch occurs when either:&lt;br /&gt;
:* The server files have been changed, but the resource has not been restarted/refreshed&lt;br /&gt;
:* An external HTTP server is being used and the files are not synchronized&lt;br /&gt;
&lt;br /&gt;
==== Accounts missing ====&lt;br /&gt;
:The file ''accounts.xml'' is not used from 1.0.4, it has been replaced by a file called ''internal.db''. To ensure your old accounts information is migrated:&lt;br /&gt;
:*Stop the server&lt;br /&gt;
:*Make sure your old ''accounts.xml'' is correct&lt;br /&gt;
:*Delete ''internal.db''&lt;br /&gt;
:*Start the server&lt;br /&gt;
&lt;br /&gt;
==== Resources missing ====&lt;br /&gt;
:From 1.0.4, resource names cannot contain dots.&lt;br /&gt;
&lt;br /&gt;
==== Download error 28 ====&lt;br /&gt;
:Try closing anti-virus or firewall applications. If it then works, try adding an exception to your firewall to allow your HTTP port through.&lt;br /&gt;
&lt;br /&gt;
==== Accounts disappearing ====&lt;br /&gt;
:Account information (or anything else) not being saved correctly can be caused by database corruption. From build 2836, the server checks the integrity of the SQLite database files on startup. If it reports a database error, please read [[How to repair the database files]].&lt;br /&gt;
:If you are running an earlier version and are having troubles such as accounts disappearing, you should upgrade your server to the [https://nightly.multitheftauto.com/ latest build]&lt;br /&gt;
&lt;br /&gt;
=== Windows-related ===&lt;br /&gt;
:No known reported issues in {{Current Version|full}}.&lt;br /&gt;
&lt;br /&gt;
=== Linux-related ===&lt;br /&gt;
====Default nohup creates infinitely big nohup.out====&lt;br /&gt;
&lt;br /&gt;
:Temporary fix, disable the nohup file: 'nohup ./mta_server &amp;gt; /dev/null &amp;amp;'&lt;br /&gt;
&lt;br /&gt;
[[es:Problemas Conocidos - FAQ]]&lt;br /&gt;
[[it:Bugs noti e FAQ]]&lt;br /&gt;
[[ru:Known Issues - FAQ]]&lt;br /&gt;
[[de:Known Issues - FAQ]]&lt;br /&gt;
[[pt-br:Soluções de Problemas - FAQ]]&lt;br /&gt;
[[hu:Known Issues - FAQ]]&lt;br /&gt;
[[zh-cn:已知问题 - 常见问题]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65615</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65615"/>
		<updated>2020-03-31T21:16:50Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Compiling the code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
Please read the instructions carefully and do not skip parts of it, if you have no experience.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Compiling the Multi Theft Atuo client is only supported on Windows 10.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the following software and SDKs installed:&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio 2019 ===&lt;br /&gt;
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]&lt;br /&gt;
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2019]''' - make sure you get the Community Edition, that one is free.&lt;br /&gt;
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these two items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''C++ MFC for latest v142 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
&lt;br /&gt;
If you don't enable MFC, you will get the following error: &amp;lt;code&amp;gt;cannot open include file 'afxres.h'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you've make a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.&lt;br /&gt;
&lt;br /&gt;
=== Microsoft DirectX SDK ===&lt;br /&gt;
[[File:DirectX_SDK.jpg|right|150px|link=https://www.microsoft.com/en-us/download/details.aspx?id=23549]]&lt;br /&gt;
'''Download'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.microsoft.com/en-us/download/details.aspx?id=23549 Microsoft DirectX SDK (August 2009)]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.h'''&amp;lt;br&amp;gt;&lt;br /&gt;
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.&lt;br /&gt;
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. &lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.lib'''&amp;lt;br&amp;gt;&lt;br /&gt;
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field&lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''S1023 Error'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://support.microsoft.com/en-us/kb/2728613 &amp;quot;S1023&amp;quot; error when you install the DirectX SDK (June 2010)]&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]&lt;br /&gt;
&lt;br /&gt;
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].&lt;br /&gt;
&lt;br /&gt;
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).&lt;br /&gt;
&lt;br /&gt;
== Getting the latest source code ==&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository.&amp;lt;br&amp;gt;&lt;br /&gt;
We recommend cloning the repository in your Git client, because you can pull any updates from there easily.&lt;br /&gt;
&lt;br /&gt;
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]&lt;br /&gt;
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]&lt;br /&gt;
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== Compiling the code ==&lt;br /&gt;
# Execute the script '''win-create-projects.bat'''&lt;br /&gt;
# Open the solution file '''MTASA.sln''' in the '''Build''' directory&lt;br /&gt;
# If you are asked to upgrade the project, click '''Cancel'''&lt;br /&gt;
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)&lt;br /&gt;
# Execute the script '''win-install-data.bat'''&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
== Running the client ==&lt;br /&gt;
&lt;br /&gt;
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Running the dedicated server ==&lt;br /&gt;
&lt;br /&gt;
If you already have run the step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can goto ''Starting the server''.&lt;br /&gt;
&lt;br /&gt;
=== Installing the latest resources ===&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.&lt;br /&gt;
&lt;br /&gt;
=== Starting the server ===&lt;br /&gt;
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compilling the code'' and follow the steps for a ''Debug'' build.&amp;lt;br&amp;gt;&lt;br /&gt;
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Local_Windows_Debugger.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== How to enable breakpoints ===&lt;br /&gt;
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise your&lt;br /&gt;
breakpoints will not work for anything beside the MTA Launcher project.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Attach_to_Process.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Extending timeout duration ===&lt;br /&gt;
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory.  &lt;br /&gt;
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.&lt;br /&gt;
&lt;br /&gt;
=== ReAttach for Visual Studio ===&lt;br /&gt;
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ReAttach_to_GTASA.PNG]]&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
= Errors =&lt;br /&gt;
== CL38 error. [netc_d.dll not found] ==&lt;br /&gt;
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.&lt;br /&gt;
&lt;br /&gt;
== After cloning the repository, it doesn't compile the project ==&lt;br /&gt;
Solution: Execute '''win-create-projects.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[hu:Compiling MTASA]]&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65614</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65614"/>
		<updated>2020-03-31T21:16:00Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Compiling the code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
Please read the instructions carefully and do not skip parts of it, if you have no experience.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Compiling the Multi Theft Atuo client is only supported on Windows 10.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the following software and SDKs installed:&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio 2019 ===&lt;br /&gt;
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]&lt;br /&gt;
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2019]''' - make sure you get the Community Edition, that one is free.&lt;br /&gt;
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these two items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''C++ MFC for latest v142 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
&lt;br /&gt;
If you don't enable MFC, you will get the following error: &amp;lt;code&amp;gt;cannot open include file 'afxres.h'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you've make a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.&lt;br /&gt;
&lt;br /&gt;
=== Microsoft DirectX SDK ===&lt;br /&gt;
[[File:DirectX_SDK.jpg|right|150px|link=https://www.microsoft.com/en-us/download/details.aspx?id=23549]]&lt;br /&gt;
'''Download'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.microsoft.com/en-us/download/details.aspx?id=23549 Microsoft DirectX SDK (August 2009)]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.h'''&amp;lt;br&amp;gt;&lt;br /&gt;
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.&lt;br /&gt;
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. &lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.lib'''&amp;lt;br&amp;gt;&lt;br /&gt;
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field&lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''S1023 Error'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://support.microsoft.com/en-us/kb/2728613 &amp;quot;S1023&amp;quot; error when you install the DirectX SDK (June 2010)]&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]&lt;br /&gt;
&lt;br /&gt;
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].&lt;br /&gt;
&lt;br /&gt;
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).&lt;br /&gt;
&lt;br /&gt;
== Getting the latest source code ==&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository.&amp;lt;br&amp;gt;&lt;br /&gt;
We recommend cloning the repository in your Git client, because you can pull any updates from there easily.&lt;br /&gt;
&lt;br /&gt;
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]&lt;br /&gt;
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]&lt;br /&gt;
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== Compiling the code ==&lt;br /&gt;
# Execute the script '''win-create-projects.bat'''&lt;br /&gt;
# Open the solution file '''MTASA.sln[MTASA.sln - Shortcut]''' in the '''Build''' directory&lt;br /&gt;
# If you are asked to upgrade the project, click '''Cancel'''&lt;br /&gt;
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)&lt;br /&gt;
# Execute the script '''win-install-data.bat'''&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
== Running the client ==&lt;br /&gt;
&lt;br /&gt;
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Running the dedicated server ==&lt;br /&gt;
&lt;br /&gt;
If you already have run the step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can goto ''Starting the server''.&lt;br /&gt;
&lt;br /&gt;
=== Installing the latest resources ===&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.&lt;br /&gt;
&lt;br /&gt;
=== Starting the server ===&lt;br /&gt;
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compilling the code'' and follow the steps for a ''Debug'' build.&amp;lt;br&amp;gt;&lt;br /&gt;
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Local_Windows_Debugger.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== How to enable breakpoints ===&lt;br /&gt;
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise your&lt;br /&gt;
breakpoints will not work for anything beside the MTA Launcher project.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Attach_to_Process.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Extending timeout duration ===&lt;br /&gt;
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory.  &lt;br /&gt;
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.&lt;br /&gt;
&lt;br /&gt;
=== ReAttach for Visual Studio ===&lt;br /&gt;
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ReAttach_to_GTASA.PNG]]&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
= Errors =&lt;br /&gt;
== CL38 error. [netc_d.dll not found] ==&lt;br /&gt;
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.&lt;br /&gt;
&lt;br /&gt;
== After cloning the repository, it doesn't compile the project ==&lt;br /&gt;
Solution: Execute '''win-create-projects.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[hu:Compiling MTASA]]&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65613</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65613"/>
		<updated>2020-03-31T20:33:49Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* The Windows SDK version 8.1 was not found. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
Please read the instructions carefully and do not skip parts of it, if you have no experience.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Compiling the Multi Theft Atuo client is only supported on Windows 10.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the following software and SDKs installed:&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio 2019 ===&lt;br /&gt;
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]&lt;br /&gt;
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2019]''' - make sure you get the Community Edition, that one is free.&lt;br /&gt;
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these two items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''C++ MFC for latest v142 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
&lt;br /&gt;
If you don't enable MFC, you will get the following error: &amp;lt;code&amp;gt;cannot open include file 'afxres.h'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you've make a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.&lt;br /&gt;
&lt;br /&gt;
=== Microsoft DirectX SDK ===&lt;br /&gt;
[[File:DirectX_SDK.jpg|right|150px|link=https://www.microsoft.com/en-us/download/details.aspx?id=23549]]&lt;br /&gt;
'''Download'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.microsoft.com/en-us/download/details.aspx?id=23549 Microsoft DirectX SDK (August 2009)]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.h'''&amp;lt;br&amp;gt;&lt;br /&gt;
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.&lt;br /&gt;
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. &lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.lib'''&amp;lt;br&amp;gt;&lt;br /&gt;
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field&lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''S1023 Error'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://support.microsoft.com/en-us/kb/2728613 &amp;quot;S1023&amp;quot; error when you install the DirectX SDK (June 2010)]&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]&lt;br /&gt;
&lt;br /&gt;
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].&lt;br /&gt;
&lt;br /&gt;
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).&lt;br /&gt;
&lt;br /&gt;
== Getting the latest source code ==&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository.&amp;lt;br&amp;gt;&lt;br /&gt;
We recommend cloning the repository in your Git client, because you can pull any updates from there easily.&lt;br /&gt;
&lt;br /&gt;
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]&lt;br /&gt;
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]&lt;br /&gt;
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== Compiling the code ==&lt;br /&gt;
# Execute the script '''win-create-projects.bat'''&lt;br /&gt;
# Open the solution file '''MTASA.sln''' in the '''Build''' directory&lt;br /&gt;
# If you are asked to upgrade the project, click '''Cancel'''&lt;br /&gt;
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)&lt;br /&gt;
# Execute the script '''win-install-data.bat'''&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
== Running the client ==&lt;br /&gt;
&lt;br /&gt;
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Running the dedicated server ==&lt;br /&gt;
&lt;br /&gt;
If you already have run the step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can goto ''Starting the server''.&lt;br /&gt;
&lt;br /&gt;
=== Installing the latest resources ===&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.&lt;br /&gt;
&lt;br /&gt;
=== Starting the server ===&lt;br /&gt;
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compilling the code'' and follow the steps for a ''Debug'' build.&amp;lt;br&amp;gt;&lt;br /&gt;
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Local_Windows_Debugger.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== How to enable breakpoints ===&lt;br /&gt;
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise your&lt;br /&gt;
breakpoints will not work for anything beside the MTA Launcher project.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Attach_to_Process.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Extending timeout duration ===&lt;br /&gt;
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory.  &lt;br /&gt;
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.&lt;br /&gt;
&lt;br /&gt;
=== ReAttach for Visual Studio ===&lt;br /&gt;
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ReAttach_to_GTASA.PNG]]&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
= Errors =&lt;br /&gt;
== CL38 error. [netc_d.dll not found] ==&lt;br /&gt;
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.&lt;br /&gt;
&lt;br /&gt;
== After cloning the repository, it doesn't compile the project ==&lt;br /&gt;
Solution: Execute '''win-create-projects.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
[[hu:Compiling MTASA]]&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65612</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=65612"/>
		<updated>2020-03-31T20:31:16Z</updated>

		<summary type="html">&lt;p&gt;Haxardous: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
Please read the instructions carefully and do not skip parts of it, if you have no experience.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Compiling the Multi Theft Atuo client is only supported on Windows 10.&lt;br /&gt;
&lt;br /&gt;
Make sure you have the following software and SDKs installed:&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio 2019 ===&lt;br /&gt;
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]&lt;br /&gt;
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2019]''' - make sure you get the Community Edition, that one is free.&lt;br /&gt;
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these two items]]:&lt;br /&gt;
## ''Desktop development with C++''&lt;br /&gt;
## ''C++ MFC for latest v142 build tools (x86 &amp;amp; x64)''&lt;br /&gt;
&lt;br /&gt;
If you don't enable MFC, you will get the following error: &amp;lt;code&amp;gt;cannot open include file 'afxres.h'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you've make a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.&lt;br /&gt;
&lt;br /&gt;
=== Microsoft DirectX SDK ===&lt;br /&gt;
[[File:DirectX_SDK.jpg|right|150px|link=https://www.microsoft.com/en-us/download/details.aspx?id=23549]]&lt;br /&gt;
'''Download'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.microsoft.com/en-us/download/details.aspx?id=23549 Microsoft DirectX SDK (August 2009)]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.h'''&amp;lt;br&amp;gt;&lt;br /&gt;
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.&lt;br /&gt;
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. &lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''Cant find d3dx9.lib'''&amp;lt;br&amp;gt;&lt;br /&gt;
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field&lt;br /&gt;
'''Note: You need to do the same thing in Release mode as well'''&lt;br /&gt;
&lt;br /&gt;
'''S1023 Error'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://support.microsoft.com/en-us/kb/2728613 &amp;quot;S1023&amp;quot; error when you install the DirectX SDK (June 2010)]&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]&lt;br /&gt;
&lt;br /&gt;
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].&lt;br /&gt;
&lt;br /&gt;
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).&lt;br /&gt;
&lt;br /&gt;
== Getting the latest source code ==&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository.&amp;lt;br&amp;gt;&lt;br /&gt;
We recommend cloning the repository in your Git client, because you can pull any updates from there easily.&lt;br /&gt;
&lt;br /&gt;
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]&lt;br /&gt;
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]&lt;br /&gt;
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== Compiling the code ==&lt;br /&gt;
# Execute the script '''win-create-projects.bat'''&lt;br /&gt;
# Open the solution file '''MTASA.sln''' in the '''Build''' directory&lt;br /&gt;
# If you are asked to upgrade the project, click '''Cancel'''&lt;br /&gt;
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)&lt;br /&gt;
# Execute the script '''win-install-data.bat'''&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
== Running the client ==&lt;br /&gt;
&lt;br /&gt;
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Running the dedicated server ==&lt;br /&gt;
&lt;br /&gt;
If you already have run the step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can goto ''Starting the server''.&lt;br /&gt;
&lt;br /&gt;
=== Installing the latest resources ===&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.&lt;br /&gt;
&lt;br /&gt;
=== Starting the server ===&lt;br /&gt;
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.&amp;lt;br&amp;gt;&lt;br /&gt;
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compilling the code'' and follow the steps for a ''Debug'' build.&amp;lt;br&amp;gt;&lt;br /&gt;
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Local_Windows_Debugger.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== How to enable breakpoints ===&lt;br /&gt;
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise your&lt;br /&gt;
breakpoints will not work for anything beside the MTA Launcher project.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Attach_to_Process.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Extending timeout duration ===&lt;br /&gt;
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory.  &lt;br /&gt;
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.&lt;br /&gt;
&lt;br /&gt;
=== ReAttach for Visual Studio ===&lt;br /&gt;
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:ReAttach_to_GTASA.PNG]]&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
= Errors =&lt;br /&gt;
== CL38 error. [netc_d.dll not found] ==&lt;br /&gt;
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.&lt;br /&gt;
&lt;br /&gt;
== After cloning the repository, it doesn't compile the project ==&lt;br /&gt;
Solution: Execute '''win-create-projects.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==&lt;br /&gt;
Solution: Execute '''win-install-data.bat''' in main directory.&lt;br /&gt;
&lt;br /&gt;
== The Windows SDK version 8.1 was not found. ==&lt;br /&gt;
Solution: Download &amp;amp; Install https://go.microsoft.com/fwlink/p/?LinkId=323507&lt;br /&gt;
&lt;br /&gt;
[[hu:Compiling MTASA]]&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Haxardous</name></author>
	</entry>
</feed>