<?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=Emiliano+Castro</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=Emiliano+Castro"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Emiliano_Castro"/>
	<updated>2026-04-06T23:02:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=67437</id>
		<title>Server mtaserver.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=67437"/>
		<updated>2020-09-30T07:32:13Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Revert last changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====servername====&lt;br /&gt;
:''&amp;lt;servername&amp;gt;Default MTA Server&amp;lt;/servername&amp;gt;''&lt;br /&gt;
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter. &lt;br /&gt;
&lt;br /&gt;
====owner_email_address====&lt;br /&gt;
:''&amp;lt;owner_email_address&amp;gt;&amp;lt;/owner_email_address&amp;gt;''&lt;br /&gt;
:This parameter specifies the contact email addresses for the owner(s) of this server. &lt;br /&gt;
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. &lt;br /&gt;
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. &lt;br /&gt;
:Values: Comma separated list of email addresses&lt;br /&gt;
&lt;br /&gt;
====serverip====&lt;br /&gt;
:''&amp;lt;serverip&amp;gt;auto&amp;lt;/serverip&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.&lt;br /&gt;
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.&lt;br /&gt;
:Values: auto or x.x.x.x ; default value: auto&lt;br /&gt;
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING&lt;br /&gt;
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY&lt;br /&gt;
&lt;br /&gt;
====serverport====&lt;br /&gt;
:''&amp;lt;serverport&amp;gt;22003&amp;lt;/serverport&amp;gt; &lt;br /&gt;
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;&lt;br /&gt;
:default value: 22003. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====maxplayers====&lt;br /&gt;
:''&amp;lt;maxplayers&amp;gt;32&amp;lt;/maxplayers&amp;gt;&lt;br /&gt;
:This parameter specifies the number of maximum player slots available on the server;&lt;br /&gt;
:default value: 32. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====httpserver====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
:This parameter specifies whether the built-in http server will be used.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpport====&lt;br /&gt;
:''&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as &amp;lt;serverport&amp;gt;. It is a required parameter if &amp;lt;httpserver&amp;gt; is set to 1.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpdownloadurl====&lt;br /&gt;
:''&amp;lt;httpdownloadurl&amp;gt;&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.&lt;br /&gt;
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]&lt;br /&gt;
&lt;br /&gt;
====httpmaxconnectionsperclient====&lt;br /&gt;
:''&amp;lt;httpmaxconnectionsperclient&amp;gt;5&amp;lt;/httpmaxconnectionsperclient&amp;gt;&lt;br /&gt;
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.&lt;br /&gt;
:Available range: 1 to 8.&lt;br /&gt;
&lt;br /&gt;
====httpdosthreshold====&lt;br /&gt;
:''&amp;lt;httpdosthreshold&amp;gt;20&amp;lt;/httpdosthreshold&amp;gt;&lt;br /&gt;
:This parameter limits the number http connections that an IP can initiate over a short period of time.&lt;br /&gt;
:Available range: 1 to 100. default value: 20&lt;br /&gt;
&lt;br /&gt;
====http_dos_exclude====&lt;br /&gt;
:''&amp;lt;http_dos_exclude&amp;gt;&amp;lt;/http_dos_exclude&amp;gt;&lt;br /&gt;
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.&lt;br /&gt;
:e.g. 88.11.22.33,101.2.3.4&lt;br /&gt;
&lt;br /&gt;
====allow_gta3_img_mods====&lt;br /&gt;
:''&amp;lt;allow_gta3_img_mods&amp;gt;none&amp;lt;/allow_gta3_img_mods&amp;gt;&lt;br /&gt;
:By default, the server will block the use of locally customized gta3.img player skins&lt;br /&gt;
:This setting can be used to allow such mods. Not recommended for competitive servers.&lt;br /&gt;
:Values: none, peds ; default value: none&lt;br /&gt;
&lt;br /&gt;
====client_file====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;client_file name=&amp;quot;data/carmods.dat&amp;quot; verify=&amp;quot;0&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:By default, the server will block the use of customized GTA:SA data files.&lt;br /&gt;
:To allow specific client files, add one or more of the above lines.&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====disableac====&lt;br /&gt;
:''&amp;lt;disableac&amp;gt;&amp;lt;/disableac&amp;gt;&lt;br /&gt;
:Comma separated list of disabled anti-cheats.&lt;br /&gt;
:e.g. To disable anti-cheat #2 and #3, use: 2,3&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====enablesd====&lt;br /&gt;
:''&amp;lt;enablesd&amp;gt;31,32&amp;lt;/enablesd&amp;gt;&lt;br /&gt;
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. &lt;br /&gt;
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.&lt;br /&gt;
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====minclientversion====&lt;br /&gt;
:''&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====minclientversion_auto_update====&lt;br /&gt;
:''&amp;lt;minclientversion_auto_update&amp;gt;1&amp;lt;/minclientversion_auto_update&amp;gt;&lt;br /&gt;
:This parameter specifies if/when the &amp;lt;minclientversion&amp;gt; setting is automatically updated.&lt;br /&gt;
:Keeping &amp;lt;minclientversion&amp;gt; updated can help reduce cheating.&lt;br /&gt;
:Note: The instant setting (2) is only recommended for competitive servers.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.&lt;br /&gt;
&lt;br /&gt;
====recommendedclientversion====&lt;br /&gt;
:''&amp;lt;recommendedclientversion&amp;gt;&amp;lt;/recommendedclientversion&amp;gt;&lt;br /&gt;
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[http://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====ase====&lt;br /&gt;
:''&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt;&lt;br /&gt;
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from &amp;lt;serverport&amp;gt; + 123 , so on a default &amp;lt;serverport&amp;gt; value 22003 the right port will be 22126 ).&lt;br /&gt;
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====donotbroadcastlan====&lt;br /&gt;
:''&amp;lt;donotbroadcastlan&amp;gt;0&amp;lt;/donotbroadcastlan&amp;gt;&lt;br /&gt;
:This parameter allows you to disable LAN broadcasting.	&lt;br /&gt;
&lt;br /&gt;
====password====&lt;br /&gt;
:''&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt; &lt;br /&gt;
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====bandwidth_reduction====&lt;br /&gt;
:''&amp;lt;bandwidth_reduction&amp;gt;medium&amp;lt;/bandwidth_reduction&amp;gt; &lt;br /&gt;
:This parameter reduces the server's bandwidth usage by using various optimizations.&lt;br /&gt;
:Values: none, medium or maximum ; default value: medium&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_syncer_distance&amp;gt;130&amp;lt;/unoccupied_vehicle_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced unoccupied vehicles&lt;br /&gt;
:Available range: 50 - 400; default value: 130&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====ped_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;ped_syncer_distance&amp;gt;100&amp;lt;/ped_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced peds&lt;br /&gt;
:Available range: 50 - 400; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====player_sync_interval====&lt;br /&gt;
:''&amp;lt;player_sync_interval&amp;gt;100&amp;lt;/player_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between player sync packets.&lt;br /&gt;
:Available range: 50 - 500; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====lightweight_sync_interval====&lt;br /&gt;
:''&amp;lt;lightweight_sync_interval&amp;gt;1500&amp;lt;/lightweight_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between lightweight (player) sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 1500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====camera_sync_interval====&lt;br /&gt;
:''&amp;lt;camera_sync_interval&amp;gt;500&amp;lt;/camera_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between camera sync packets.&lt;br /&gt;
:Available range: 200 - 400; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_sync_interval&amp;gt;400&amp;lt;/ped_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_sync_interval====&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_sync_interval&amp;gt;400&amp;lt;/unoccupied_vehicle_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_mouse_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_mouse_sync_interval&amp;gt;100&amp;lt;/keysync_mouse_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.&lt;br /&gt;
:Available range: 50 - 500; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_analog_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_analog_sync_interval&amp;gt;100&amp;lt;/keysync_analog_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.&lt;br /&gt;
:Available range: 50 - 500; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====bullet_sync====&lt;br /&gt;
:''&amp;lt;bullet_sync&amp;gt;1&amp;lt;/bullet_sync&amp;gt;   &lt;br /&gt;
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.&lt;br /&gt;
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====vehext_percent====&lt;br /&gt;
:''&amp;lt;vehext_percent&amp;gt;0&amp;lt;/vehext_percent&amp;gt;&lt;br /&gt;
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. &lt;br /&gt;
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.&lt;br /&gt;
:Depending on the gamemode, an incorrect prediction may have a negative effect. &lt;br /&gt;
:Therefore this setting should be considered experimental.&lt;br /&gt;
:Available range: 0 to 100.  Default - 0&lt;br /&gt;
&lt;br /&gt;
====vehext_ping_limit====&lt;br /&gt;
:''&amp;lt;vehext_ping_limit&amp;gt;150&amp;lt;/vehext_ping_limit&amp;gt;&lt;br /&gt;
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.&lt;br /&gt;
:Only relevant if &amp;lt;vehext_percent&amp;gt; is greater than zero.&lt;br /&gt;
:Available range: 50 to 500.  Default - 150&lt;br /&gt;
&lt;br /&gt;
====latency_reduction====&lt;br /&gt;
:''&amp;lt;latency_reduction&amp;gt;0&amp;lt;/latency_reduction&amp;gt;&lt;br /&gt;
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).&lt;br /&gt;
:Due to the impact this may have on shot lag compensation, it should be considered experimental.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
:Bugs caused by enabling latency_reduction: http://bugs.mtasa.com/view.php?id=8191 + http://bugs.mtasa.com/view.php?id=8226&lt;br /&gt;
&lt;br /&gt;
====threadnet====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;threadnet&amp;gt;1&amp;lt;/threadnet&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to run the network synchronization on another thread.&lt;br /&gt;
:Enabling will make the sync smoother, but may increase CPU usage slightly.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====idfile====&lt;br /&gt;
:''&amp;lt;idfile&amp;gt;server-id.keys&amp;lt;/idfile&amp;gt; &lt;br /&gt;
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. &lt;br /&gt;
:Keep a backup of this file in a safe place. Default value: server-id.keys&lt;br /&gt;
:More information about client private files: [[Filepath]]&lt;br /&gt;
&lt;br /&gt;
====logfile====&lt;br /&gt;
:''&amp;lt;logfile&amp;gt;logs/server.log&amp;lt;/logfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====authfile====&lt;br /&gt;
:''&amp;lt;authfile&amp;gt;logs/server_auth.log&amp;lt;/authfile&amp;gt;&lt;br /&gt;
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used&lt;br /&gt;
&lt;br /&gt;
====dbfile====&lt;br /&gt;
:''&amp;lt;dbfile&amp;gt;logs/db.log&amp;lt;/dbfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.&lt;br /&gt;
&lt;br /&gt;
====loadstringfile====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;loadstringfile&amp;gt;logs/loadstring.log&amp;lt;/loadstringfile&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.&lt;br /&gt;
&lt;br /&gt;
====acl====&lt;br /&gt;
:''&amp;lt;acl&amp;gt;acl.xml&amp;lt;/acl&amp;gt; &lt;br /&gt;
:This parameter specifies the location and name of the Access Control List settings file. If left&lt;br /&gt;
:blank, server will use acl.xml file, located in the same folder as this configuration file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebuglogfile====&lt;br /&gt;
:''&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebugloglevel====&lt;br /&gt;
:''&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====htmldebuglevel====&lt;br /&gt;
:''&amp;lt;htmldebuglevel&amp;gt;0&amp;lt;/htmldebuglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====filter_duplicate_log_lines====&lt;br /&gt;
:''&amp;lt;filter_duplicate_log_lines&amp;gt;1&amp;lt;/filter_duplicate_log_lines&amp;gt;&lt;br /&gt;
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.&lt;br /&gt;
&lt;br /&gt;
====fpslimit====&lt;br /&gt;
:''&amp;lt;fpslimit&amp;gt;36&amp;lt;/fpslimit&amp;gt;&lt;br /&gt;
:Specifies the frame rate limit that will be applied to connecting clients.&lt;br /&gt;
:Available range: 25 to 100. Default: 36.&lt;br /&gt;
:When running the map editor locally (i.e. from the client), the default FPS limit is 50.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====voice====&lt;br /&gt;
:''&amp;lt;voice&amp;gt;0&amp;lt;/voice&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to enable player voice chat in-game&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled&lt;br /&gt;
&lt;br /&gt;
====voice_samplerate====&lt;br /&gt;
:''&amp;lt;voice_samplerate&amp;gt;1&amp;lt;/voice_samplerate&amp;gt;&lt;br /&gt;
:This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat&lt;br /&gt;
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1&lt;br /&gt;
&lt;br /&gt;
====voice_quality====&lt;br /&gt;
:''&amp;lt;voice_quality&amp;gt;4&amp;lt;/voice_quality&amp;gt;&lt;br /&gt;
:This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat&lt;br /&gt;
:Available range: 0 to 10.  Default - 4&lt;br /&gt;
&lt;br /&gt;
====voice_bitrate====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;voice_bitrate&amp;gt;24600&amp;lt;/voice_bitrate&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically.  Use with care.&lt;br /&gt;
&lt;br /&gt;
====backup_path====&lt;br /&gt;
:''&amp;lt;backup_path&amp;gt;backups&amp;lt;/backup_path&amp;gt;&lt;br /&gt;
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups&lt;br /&gt;
&lt;br /&gt;
====backup_interval====&lt;br /&gt;
:''&amp;lt;backup_interval&amp;gt;3&amp;lt;/backup_interval&amp;gt;&lt;br /&gt;
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 30.  Default - 3&lt;br /&gt;
&lt;br /&gt;
====backup_copies====&lt;br /&gt;
:''&amp;lt;backup_copies&amp;gt;10&amp;lt;/backup_copies&amp;gt;&lt;br /&gt;
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 100.  Default - 10&lt;br /&gt;
&lt;br /&gt;
====compact_internal_databases====&lt;br /&gt;
:''&amp;lt;compact_internal_databases&amp;gt;1&amp;lt;/compact_internal_databases&amp;gt;&lt;br /&gt;
:This parameter specifies when the internal sqlite databases should be defragmented.&lt;br /&gt;
:For more info see: http://www.sqlite.org/lang_vacuum.html&lt;br /&gt;
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====crash_dump_upload====&lt;br /&gt;
:''&amp;lt;crash_dump_upload&amp;gt;1&amp;lt;/crash_dump_upload&amp;gt;&lt;br /&gt;
:This parameter specifies whether server crash dump files should be sent to MTA HQ.&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 1&lt;br /&gt;
&lt;br /&gt;
====fakelag====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;fakelag&amp;gt;0&amp;lt;/fakelag&amp;gt;&lt;br /&gt;
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 0&lt;br /&gt;
&lt;br /&gt;
====auth_serial_groups====&lt;br /&gt;
:''&amp;lt;auth_serial_groups&amp;gt;Admin&amp;lt;/auth_serial_groups&amp;gt;&lt;br /&gt;
:This parameter lists the ACL groups that are protected by serial authorization.&lt;br /&gt;
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.&lt;br /&gt;
:For more info see: https://mtasa.com/authserial&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.&lt;br /&gt;
:Values: Comma separated list of ACL groups.  Default - Admin&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http====&lt;br /&gt;
:''&amp;lt;auth_serial_http&amp;gt;1&amp;lt;/auth_serial_http&amp;gt;&lt;br /&gt;
:This parameter specifies if the authorized serial login checks should also apply to the http interface.&lt;br /&gt;
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.&lt;br /&gt;
:For more info see: https://mtasa.com/authserialhttp&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http_ip_exceptions====&lt;br /&gt;
:''&amp;lt;auth_serial_http_ip_exceptions&amp;gt;127.0.0.1&amp;lt;/auth_serial_http_ip_exceptions&amp;gt;&lt;br /&gt;
:This parameter specifies which IP addresses should always pass auth_serial_http checks.&lt;br /&gt;
:Values: Comma separated list of IP addresses&lt;br /&gt;
&lt;br /&gt;
====database_credentials_protection====&lt;br /&gt;
:''&amp;lt;database_credentials_protection&amp;gt;1&amp;lt;/database_credentials_protection&amp;gt;&lt;br /&gt;
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:The extra measures are:&lt;br /&gt;
: - script files cannot be accessed with [[fileOpen]]&lt;br /&gt;
: - [[meta.xml]] is read-only&lt;br /&gt;
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====module====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_win32.dll&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_linux.so&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the module(s) which are loaded with the server. To load several modules, add more &amp;lt;module&amp;gt; parameter(s). Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====resource====&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;admin&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;defaultstats&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;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;joinquit&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;resource src=&amp;quot;parachute&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;resourcebrowser&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; default=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;scoreboard&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;spawnmanager&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;voice&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;votemanager&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;webadmin&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;play&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more &amp;lt;resource&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
:In addition, there are several flags which control how the server deals with each resource:&lt;br /&gt;
&lt;br /&gt;
:* '''src''': the resource name. This is the only mandatory flag.&lt;br /&gt;
:* '''startup''': controls whether the resource will be started with the server or not. If &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will be started. If not specified, defaults to not starting the resource.&lt;br /&gt;
:* '''protected''': if &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.&lt;br /&gt;
:* '''default''': if given a &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot; value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.&lt;br /&gt;
&lt;br /&gt;
==Deprecated settings==&lt;br /&gt;
&lt;br /&gt;
The following settings have been deprecated in the production version of MTA:SA and no longer work.&lt;br /&gt;
&lt;br /&gt;
====networkencryption====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - also seems to be deprecated in code --&amp;gt;&lt;br /&gt;
:''&amp;lt;networkencryption&amp;gt;1&amp;lt;/networkencryption&amp;gt;&lt;br /&gt;
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====autologin====&lt;br /&gt;
&amp;lt;!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --&amp;gt;&lt;br /&gt;
:''&amp;lt;autologin&amp;gt;0&amp;lt;/autologin&amp;gt;&lt;br /&gt;
:Specifies whether or not players should automatically be logged in based on their IP adresses.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
&lt;br /&gt;
[[Category: Support]]&lt;br /&gt;
[[ru:Server mtaserver.conf]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=64479</id>
		<title>PHP SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=64479"/>
		<updated>2019-10-04T15:15:21Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
You can access the MTA Web Interface from almost any programming language that can request web pages. PHP can do this very easily.&lt;br /&gt;
&lt;br /&gt;
This SDK provides one function call that will allow you to call any exported script functions on any server that you have access to.&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.multitheftauto.com/wiki/PHP_SDK official wiki page] for further information.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
This SDK requires PHP 7.1 or greater.&lt;br /&gt;
&lt;br /&gt;
=== HTTPlug client abstraction ===&lt;br /&gt;
&lt;br /&gt;
As this SDK uses HTTPlug, you will have to require some libraries for get it working. See [http://docs.php-http.org/en/latest/httplug/users.html “HTTPlug for library users”] for more info.&lt;br /&gt;
&lt;br /&gt;
:warning: '''Note''': If you don’t follow this requirement before require the SDK, composer will throw you an error.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
The only supported installation method is via [https://getcomposer.org Composer]. Run the following command to require this SDK in your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;composer require multitheftauto/mtasa-php-sdk&amp;lt;/pre&amp;gt;&lt;br /&gt;
== A simple example ==&lt;br /&gt;
&lt;br /&gt;
There are three ways to call an MTA server’s exported functions, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('vendor/autoload.php');&lt;br /&gt;
&lt;br /&gt;
use MultiTheftAuto\Sdk\Mta;&lt;br /&gt;
use MultiTheftAuto\Sdk\Model\Server;&lt;br /&gt;
use MultiTheftAuto\Sdk\Model\Authentication;&lt;br /&gt;
&lt;br /&gt;
$server = new Server('127.0.0.1', 22005);&lt;br /&gt;
$auth = new Authentication('myUser', 'myPassword');&lt;br /&gt;
$mta = new Mta($server, $auth);&lt;br /&gt;
&lt;br /&gt;
$response = $mta-&amp;gt;getResource('someResource')-&amp;gt;call('callableFunction', $arg1, $arg2, $arg3, ...);&lt;br /&gt;
// or&lt;br /&gt;
$response = $mta-&amp;gt;getResource('someResource')-&amp;gt;call-&amp;gt;callableFunction($arg1, $arg2, $arg3, ...);&lt;br /&gt;
&lt;br /&gt;
var_dump($response);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A page that can be called by [[callRemote]]==&lt;br /&gt;
This example just adds two numbers passed to it by a lua script.&lt;br /&gt;
&lt;br /&gt;
'''PHP:''' (for the page that LUA expects to be at ''&amp;lt;nowiki&amp;gt;http://www.example.com/page.php&amp;lt;/nowiki&amp;gt;'')&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
&lt;br /&gt;
require_once('vendor/autoload.php');&lt;br /&gt;
&lt;br /&gt;
use MultiTheftAuto\Sdk\Mta;&lt;br /&gt;
&lt;br /&gt;
$input = Mta::getInput();&lt;br /&gt;
Mta::doReturn($input[0] + $input[1]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LUA:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- result is called when the function returns&lt;br /&gt;
function result(sum)&lt;br /&gt;
    outputChatBox(sum)&lt;br /&gt;
end&lt;br /&gt;
function addNumbers(number1, number2)&lt;br /&gt;
    callRemote ( &amp;quot;http://www.example.com/page.php&amp;quot;, result, number1, number2 )&lt;br /&gt;
end &lt;br /&gt;
addNumbers ( 123, 456 ) -- call the function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Releases ==&lt;br /&gt;
&lt;br /&gt;
Visit [https://github.com/multitheftauto/mtasa-php-sdk/releases the releases page on GitHub] to download the SDK.&lt;br /&gt;
&lt;br /&gt;
=== Note for Python ===&lt;br /&gt;
&lt;br /&gt;
There is a community made Python SDK with the same semantics on [https://gitlab.com/OwlGamingCommunity/mta-python-sdk the OwlGaming Gitlab] for use on Python projects.&lt;br /&gt;
&lt;br /&gt;
== Version History ==&lt;br /&gt;
&lt;br /&gt;
You can see in the [https://github.com/multitheftauto/mtasa-php-sdk/blob/master/CHANGELOG.md repository changelog file] the changes applied.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=64471</id>
		<title>PHP SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=64471"/>
		<updated>2019-10-04T01:30:25Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
You can access the MTA Web Interface from almost any programming language that can request web pages. PHP can do this very easily.&lt;br /&gt;
&lt;br /&gt;
This SDK provides one function call that will allow you to call any exported script functions on any server that you have access to.&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.multitheftauto.com/wiki/PHP_SDK official wiki page] for further information.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
This SDK requires PHP 7.1 or greater.&lt;br /&gt;
&lt;br /&gt;
=== HTTPlug client abstraction ===&lt;br /&gt;
&lt;br /&gt;
As this SDK uses HTTPlug, you will have to require some libraries for get it working. See [http://docs.php-http.org/en/latest/httplug/users.html “HTTPlug for library users”] for more info.&lt;br /&gt;
&lt;br /&gt;
:warning: '''Note''': If you don’t follow this requirement before require the SDK, composer will throw you an error.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
The only supported installation method is via [https://getcomposer.org Composer]. Run the following command to require this SDK in your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;composer require multitheftauto/mtasa-php-sdk&amp;lt;/pre&amp;gt;&lt;br /&gt;
== A simple example ==&lt;br /&gt;
&lt;br /&gt;
There are three ways to call an MTA server’s exported functions, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('vendor/autoload.php');&lt;br /&gt;
&lt;br /&gt;
use MultiTheftAuto\Sdk\Mta;&lt;br /&gt;
use MultiTheftAuto\Sdk\Model\Server;&lt;br /&gt;
use MultiTheftAuto\Sdk\Model\Authentication;&lt;br /&gt;
&lt;br /&gt;
$server = new Server('127.0.0.1', 22005);&lt;br /&gt;
$auth = new Authentication('myUser', 'myPassword');&lt;br /&gt;
$mta = new Mta($server, $auth);&lt;br /&gt;
&lt;br /&gt;
$response = $mta-&amp;gt;getResource('someResource')-&amp;gt;call('callableFunction', $arg1, $arg2, $arg3, ...);&lt;br /&gt;
// or&lt;br /&gt;
$response = $mta-&amp;gt;getResource('someResource')-&amp;gt;call-&amp;gt;callableFunction($arg1, $arg2, $arg3, ...);&lt;br /&gt;
&lt;br /&gt;
var_dump($response);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A page that can be called by [[callRemote]]==&lt;br /&gt;
This example just adds two numbers passed to it by a lua script.&lt;br /&gt;
&lt;br /&gt;
'''PHP:''' (for the page that LUA expects to be at ''&amp;lt;nowiki&amp;gt;http://www.example.com/page.php&amp;lt;/nowiki&amp;gt;'')&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
&lt;br /&gt;
require_once('vendor/autoload.php');&lt;br /&gt;
&lt;br /&gt;
$input = Mta::getInput();&lt;br /&gt;
Mta::doReturn($input[0] + $input[1]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LUA:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- result is called when the function returns&lt;br /&gt;
function result(sum)&lt;br /&gt;
    outputChatBox(sum)&lt;br /&gt;
end&lt;br /&gt;
function addNumbers(number1, number2)&lt;br /&gt;
    callRemote ( &amp;quot;http://www.example.com/page.php&amp;quot;, result, number1, number2 )&lt;br /&gt;
end &lt;br /&gt;
addNumbers ( 123, 456 ) -- call the function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Releases ==&lt;br /&gt;
&lt;br /&gt;
Visit [https://github.com/multitheftauto/mtasa-php-sdk/releases the releases page on GitHub] to download the SDK.&lt;br /&gt;
&lt;br /&gt;
=== Note for Python ===&lt;br /&gt;
&lt;br /&gt;
There is a community made Python SDK with the same semantics on [https://gitlab.com/OwlGamingCommunity/mta-python-sdk the OwlGaming Gitlab] for use on Python projects.&lt;br /&gt;
&lt;br /&gt;
== Version History ==&lt;br /&gt;
&lt;br /&gt;
You can see in the [https://github.com/multitheftauto/mtasa-php-sdk/blob/master/CHANGELOG.md repository changelog file] the changes applied.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=64470</id>
		<title>PHP SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=64470"/>
		<updated>2019-10-04T01:30:05Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
= MTA:SA PHP SDK =&lt;br /&gt;
&lt;br /&gt;
You can access the MTA Web Interface from almost any programming language that can request web pages. PHP can do this very easily.&lt;br /&gt;
&lt;br /&gt;
This SDK provides one function call that will allow you to call any exported script functions on any server that you have access to.&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.multitheftauto.com/wiki/PHP_SDK official wiki page] for further information.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
This SDK requires PHP 7.1 or greater.&lt;br /&gt;
&lt;br /&gt;
=== HTTPlug client abstraction ===&lt;br /&gt;
&lt;br /&gt;
As this SDK uses HTTPlug, you will have to require some libraries for get it working. See [http://docs.php-http.org/en/latest/httplug/users.html “HTTPlug for library users”] for more info.&lt;br /&gt;
&lt;br /&gt;
:warning: '''Note''': If you don’t follow this requirement before require the SDK, composer will throw you an error.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
The only supported installation method is via [https://getcomposer.org Composer]. Run the following command to require this SDK in your project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;composer require multitheftauto/mtasa-php-sdk&amp;lt;/pre&amp;gt;&lt;br /&gt;
== A simple example ==&lt;br /&gt;
&lt;br /&gt;
There are three ways to call an MTA server’s exported functions, as shown in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('vendor/autoload.php');&lt;br /&gt;
&lt;br /&gt;
use MultiTheftAuto\Sdk\Mta;&lt;br /&gt;
use MultiTheftAuto\Sdk\Model\Server;&lt;br /&gt;
use MultiTheftAuto\Sdk\Model\Authentication;&lt;br /&gt;
&lt;br /&gt;
$server = new Server('127.0.0.1', 22005);&lt;br /&gt;
$auth = new Authentication('myUser', 'myPassword');&lt;br /&gt;
$mta = new Mta($server, $auth);&lt;br /&gt;
&lt;br /&gt;
$response = $mta-&amp;gt;getResource('someResource')-&amp;gt;call('callableFunction', $arg1, $arg2, $arg3, ...);&lt;br /&gt;
// or&lt;br /&gt;
$response = $mta-&amp;gt;getResource('someResource')-&amp;gt;call-&amp;gt;callableFunction($arg1, $arg2, $arg3, ...);&lt;br /&gt;
&lt;br /&gt;
var_dump($response);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A page that can be called by [[callRemote]]==&lt;br /&gt;
This example just adds two numbers passed to it by a lua script.&lt;br /&gt;
&lt;br /&gt;
'''PHP:''' (for the page that LUA expects to be at ''&amp;lt;nowiki&amp;gt;http://www.example.com/page.php&amp;lt;/nowiki&amp;gt;'')&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
&lt;br /&gt;
require_once('vendor/autoload.php');&lt;br /&gt;
&lt;br /&gt;
$input = Mta::getInput();&lt;br /&gt;
Mta::doReturn($input[0] + $input[1]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''LUA:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- result is called when the function returns&lt;br /&gt;
function result(sum)&lt;br /&gt;
    outputChatBox(sum)&lt;br /&gt;
end&lt;br /&gt;
function addNumbers(number1, number2)&lt;br /&gt;
    callRemote ( &amp;quot;http://www.example.com/page.php&amp;quot;, result, number1, number2 )&lt;br /&gt;
end &lt;br /&gt;
addNumbers ( 123, 456 ) -- call the function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Releases ==&lt;br /&gt;
&lt;br /&gt;
Visit [https://github.com/multitheftauto/mtasa-php-sdk/releases the releases page on GitHub] to download the SDK.&lt;br /&gt;
&lt;br /&gt;
=== Note for Python ===&lt;br /&gt;
&lt;br /&gt;
There is a community made Python SDK with the same semantics on [https://gitlab.com/OwlGamingCommunity/mta-python-sdk the OwlGaming Gitlab] for use on Python projects.&lt;br /&gt;
&lt;br /&gt;
== Version History ==&lt;br /&gt;
&lt;br /&gt;
You can see in the [https://github.com/multitheftauto/mtasa-php-sdk/blob/master/CHANGELOG.md repository changelog file] the changes applied.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawPrimitive&amp;diff=59595</id>
		<title>DxDrawPrimitive</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawPrimitive&amp;diff=59595"/>
		<updated>2018-10-07T15:15:46Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{New feature/item|3.0157|1.5.6|14203|This function draws a 2D primitive shape across the screen - rendered for one frame. This should be used in conjunction with [[onClientRender]] in order to display continuously.}}&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 dxDrawPrimitive ( string pType, bool postGUI, table vertice1 [, table vertice2, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''pType:''' Type of primitive to be drawn.&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertices:''' Tables representing each primitive vertice, required amount of them is determined by primitive type.&lt;br /&gt;
&lt;br /&gt;
==Allowed types==&lt;br /&gt;
[[Image:MTAsa_primitives.png|thumb|240px|Available primitive types.]]&lt;br /&gt;
More info on primitives may be found on [https://msdn.microsoft.com/en-us/library/windows/desktop/bb147291(v=vs.85).aspx this MSDN site] &lt;br /&gt;
* '''pointlist:''' Renders the vertices as a collection of isolated points.&lt;br /&gt;
* '''linelist:''' Renders the vertices as a list of isolated straight line segments.&lt;br /&gt;
* '''linestrip:''' Renders the vertices as a single polyline.&lt;br /&gt;
* '''trianglelist:''' Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.&lt;br /&gt;
* '''trianglestrip:''' Renders the vertices as a triangle strip.&lt;br /&gt;
* '''trianglefan:''' Renders the vertices as a triangle fan.&lt;br /&gt;
&lt;br /&gt;
==Vertices format==&lt;br /&gt;
* '''posX:''' An float representing the absolute X position of the vertice, represented by pixels on the screen.&lt;br /&gt;
* '''posY:''' An float representing the absolute Y position of the vertice, represented by pixels on the screen.&lt;br /&gt;
* '''color (optional):''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue). If it's not specified, white color is used.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a small example that creates trianglefan primitive with vertices in places that user clicks. It assigns every vertice random color.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local vertices = {}&lt;br /&gt;
function onClick(btn, state, x, y)&lt;br /&gt;
	if btn ~= &amp;quot;left&amp;quot; then return end&lt;br /&gt;
	if state ~= &amp;quot;up&amp;quot; then return end&lt;br /&gt;
	local vertice = {x, y, tocolor(math.random(255), math.random(255), math.random(255))}&lt;br /&gt;
	table.insert(vertices, vertice)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientClick&amp;quot;, root, onClick)&lt;br /&gt;
&lt;br /&gt;
function draw()&lt;br /&gt;
	dxDrawPrimitive(&amp;quot;trianglefan&amp;quot;, true, unpack(vertices))&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, draw)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=52129</id>
		<title>PHP SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PHP_SDK&amp;diff=52129"/>
		<updated>2017-08-30T18:02:07Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
You can access the MTA Web Interface from almost any programming language that can request web pages using HTTP POST and encode and decode [[JSON]]. PHP can do this very easily. &lt;br /&gt;
&lt;br /&gt;
This SDK provides one function ''call'' that will allow you to call any exported script functions on any server that you have access to.&lt;br /&gt;
&lt;br /&gt;
The download below includes two example pages - one that shows a simple scoreboard, the other that shows the automatic handling of element and resource objects.&lt;br /&gt;
&lt;br /&gt;
If you use this and make any improvements, feel free to send us a copy and we can host it for others to benefit from.&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
===call===&lt;br /&gt;
This function calls an exported function in a specific resource.&lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mtaServer = new mta( $hostname, $port, $username, $password );&lt;br /&gt;
$resource = $mtaServer-&amp;gt;getResource ( $resourceName );&lt;br /&gt;
$returns[] = $resource-&amp;gt;call ( &amp;quot;functionName&amp;quot; [,args...] );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===getInput===&lt;br /&gt;
This function is for use with web pages that are called by [[callRemote]].&lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$inputData = mta::getInput();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===doReturn===&lt;br /&gt;
Use this function when you want to return data when a page is called with [[callRemote]]. You should '''NOT''' output any other data to the page, e.g. using ''echo'' as this will cause the return to fail.&lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
mta::doReturn( argument1, argument2 ... argumentN );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
include( &amp;quot;mta_sdk.php&amp;quot; );&lt;br /&gt;
$mtaServer = new mta(&amp;quot;bastage.net&amp;quot;, 33004);&lt;br /&gt;
$resource = $mtaServer-&amp;gt;getResource ( &amp;quot;echobot&amp;quot; );&lt;br /&gt;
$retn = $resource-&amp;gt;call ( &amp;quot;getThisResource&amp;quot; ); // $retn is an array containing the values the function returned&lt;br /&gt;
$resourceElement = $retn[0]; // the first returned value is the resource&lt;br /&gt;
$retn = $resource-&amp;gt;call ( &amp;quot;getResourceName&amp;quot;, $resourceElement ); &lt;br /&gt;
$resourceName = $retn[0]; // contains the name of the resource 'echobot'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Authentication==&lt;br /&gt;
If the server you are accessing requires authentication, you must pass the ''http_username'' and ''http_password'' variables to your instantiated instance of the mta() class.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
include( &amp;quot;mta_sdk.php&amp;quot; );&lt;br /&gt;
$mtaServer = new mta(&amp;quot;example.com&amp;quot;, 33004, &amp;quot;myUsername&amp;quot;, &amp;quot;myPassword&amp;quot; );&lt;br /&gt;
$mtaServer-&amp;gt;getResource(&amp;quot;someResource&amp;quot;)-&amp;gt;call(&amp;quot;someFunction&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A page that can be called by [[callRemote]]==&lt;br /&gt;
This example just adds two numbers passed to it by a lua script.&lt;br /&gt;
&lt;br /&gt;
'''PHP:''' (for the page that LUA expects to be at ''&amp;lt;nowiki&amp;gt;http://www.example.com/page.php&amp;lt;/nowiki&amp;gt;'')&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
include( &amp;quot;mta_sdk.php&amp;quot; );&lt;br /&gt;
$input = mta::getInput();&lt;br /&gt;
mta::doReturn($input[0] + $input[1]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''LUA:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- result is called when the function returns&lt;br /&gt;
function result(sum)&lt;br /&gt;
    outputChatBox(sum)&lt;br /&gt;
end&lt;br /&gt;
function addNumbers(number1, number2)&lt;br /&gt;
    callRemote ( &amp;quot;http://www.example.com/page.php&amp;quot;, result, number1, number2 )&lt;br /&gt;
end &lt;br /&gt;
addNumbers ( 123, 456 ) -- call the function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Caveats==&lt;br /&gt;
* This only works with PHP 5.0 and above.&lt;br /&gt;
* You cannot currently compare two Element instances that you expect to be identical - you need to do a &amp;quot;deep compare&amp;quot;, comparing the &amp;quot;id&amp;quot; fields.&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
=== Node for version 0.4 ===&lt;br /&gt;
On line 80 in mta_sdk.php you will find the string:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo $json_output;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace that one with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
//echo $json_output;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or remove it completly!&lt;br /&gt;
&lt;br /&gt;
*[http://code.opencoding.net/mta/mtaphpsdk_0.4.zip Download Version 0.4] - Renamed ''public function mta(..)'' to ''public function __construct(..)''.&lt;br /&gt;
*[http://code.opencoding.net/mta/mtaphpsdk_0.3_fix.zip Download Version 0.3] - Neater syntax, support functions for [[callRemote]] (fix version makes call work with args).&lt;br /&gt;
*[http://misc.opencoding.net/mta/mtaphpsdk_0.2.zip Download Version 0.2] -  ''Deprecated - Syntax differs from examples shown above.'' - Adds authentication support.&lt;br /&gt;
*[http://misc.opencoding.net/mta/mtaphpsdk_0.1.zip Download Version 0.1] - ''Deprecated - Syntax differs from examples shown above.''&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTrainPosition&amp;diff=52081</id>
		<title>SetTrainPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTrainPosition&amp;diff=52081"/>
		<updated>2017-08-25T01:17:00Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Shared function}}&lt;br /&gt;
{{New feature/item|3.0153|1.5.3|7485|&lt;br /&gt;
Sets the position the train is currently on the track&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setTrainPosition ( vehicle train, float position )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:setTrainPosition|trainPosition|getTrainPosition}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to set the track (0 - 18107 a complete way round)&lt;br /&gt;
*'''position:''' the position along the track&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the train position was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;OOP Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a command called &amp;quot;/settrainpos&amp;quot;, allowing you to set the position of the train.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local function setMyPosition(player, _, position)&lt;br /&gt;
	-- grab the vehicle, if it exists&lt;br /&gt;
	local veh = player.vehicle&lt;br /&gt;
&lt;br /&gt;
	-- make sure we're actually in a vehicle&lt;br /&gt;
	if not veh then&lt;br /&gt;
		player:outputChat(&amp;quot;You are not in a vehicle!&amp;quot;)&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- make sure we're in a train&lt;br /&gt;
	if veh.vehicleType ~= &amp;quot;Train&amp;quot; then&lt;br /&gt;
		player:outputChat(&amp;quot;You are not in a train!&amp;quot;)&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- convert position to a number&lt;br /&gt;
	position = tonumber(position)&lt;br /&gt;
&lt;br /&gt;
	-- if position cannot be converted to a number&lt;br /&gt;
	if not position then&lt;br /&gt;
		player:outputChat(&amp;quot;Syntax: /settrainpos &amp;lt;position&amp;gt;&amp;quot;)&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- finally set the train position&lt;br /&gt;
	veh.trainPosition = position&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;settrainpos&amp;quot;, setMyPosition)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=46834</id>
		<title>AddBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=46834"/>
		<updated>2016-03-11T23:31:39Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Undo revision 46833 by Emiliano Castro (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will add a [[ban]] for the specified IP/username/serial to the server.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban addBan ( [ string IP, string Username, string Serial, player responsibleElement, string reason, int seconds = 0 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note:''' One of the three: IP, Username or Serial have to be specified.&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''IP:''' The IP to be banned. If you don't want to ban by IP, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Username:''' The [http://community.mtasa.com/ MTA Community] username to be banned (now obsolete). If you don't want to ban by username, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Serial:''' The serial to be banned. If you don't want to ban by serial, set this to ''nil''.&lt;br /&gt;
''' or any combination.'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the IP/username/serial. This can be a player or the root ([[getRootElement]]()).&lt;br /&gt;
*'''reason:''' The reason the IP/username/serial will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the new [[ban]] if the IP/username/serial was banned successfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example bans a player's IP with the reason &amp;quot;Requested&amp;quot; when they type &amp;quot;/ban-me&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banMe ( source, command ) -- The function header and where source is defined&lt;br /&gt;
	local ipToBan = getPlayerIP ( source ) -- Get the player's IP&lt;br /&gt;
	addBan ( ipToBan, nil, nil, source, &amp;quot;Requested&amp;quot; ) -- Ban him with the reason; Requested&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban-me&amp;quot;, banMe ) -- Make it trigger when a player types &amp;quot;/ban-me&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
This example add command to ban player serial.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banSerial( source, command, noob, reason )&lt;br /&gt;
   if ( noob ) then&lt;br /&gt;
      local theNoob = getPlayerFromName( noob )&lt;br /&gt;
      if ( theNoob ) then&lt;br /&gt;
         local theNoobSerial = getPlayerSerial( theNoob )&lt;br /&gt;
         addBan( nil, nil, theNoobSerial, source, reason )&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;ban-serial&amp;quot;, banSerial )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;br /&gt;
[[ru:addBan]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=46833</id>
		<title>AddBan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=AddBan&amp;diff=46833"/>
		<updated>2016-03-11T23:30:57Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function will add a [[ban]] for the specified IP/username/serial to the server.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban addBan ( string IP/Username/Serial [, player responsibleElement, string reason, int seconds = 0 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Note:''' One of the three: IP, Username or Serial have to be specified.&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''IP:''' The IP to be banned. If you don't want to ban by IP, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Username:''' The [http://community.mtasa.com/ MTA Community] username to be banned (now obsolete). If you don't want to ban by username, set this to ''nil''.&lt;br /&gt;
'''or'''&lt;br /&gt;
*'''Serial:''' The serial to be banned. If you don't want to ban by serial, set this to ''nil''.&lt;br /&gt;
''' or any combination.'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the IP/username/serial. This can be a player or the root ([[getRootElement]]()).&lt;br /&gt;
*'''reason:''' The reason the IP/username/serial will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the new [[ban]] if the IP/username/serial was banned successfully, ''false'' if invalid arguments are specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example bans a player's IP with the reason &amp;quot;Requested&amp;quot; when they type &amp;quot;/ban-me&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banMe ( source, command ) -- The function header and where source is defined&lt;br /&gt;
	local ipToBan = getPlayerIP ( source ) -- Get the player's IP&lt;br /&gt;
	addBan ( ipToBan, nil, nil, source, &amp;quot;Requested&amp;quot; ) -- Ban him with the reason; Requested&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban-me&amp;quot;, banMe ) -- Make it trigger when a player types &amp;quot;/ban-me&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
This example add command to ban player serial.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function banSerial( source, command, noob, reason )&lt;br /&gt;
   if ( noob ) then&lt;br /&gt;
      local theNoob = getPlayerFromName( noob )&lt;br /&gt;
      if ( theNoob ) then&lt;br /&gt;
         local theNoobSerial = getPlayerSerial( theNoob )&lt;br /&gt;
         addBan( nil, nil, theNoobSerial, source, reason )&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;ban-serial&amp;quot;, banSerial )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin functions}}&lt;br /&gt;
[[ru:addBan]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CenterWindow&amp;diff=46698</id>
		<title>CenterWindow</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CenterWindow&amp;diff=46698"/>
		<updated>2016-02-19T16:14:45Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function center the window in any resolution.&amp;lt;br&amp;gt;&lt;br /&gt;
* '''NOTE:''' This is made to be used clientside!.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool centerWindow( element TheElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': The element you want to center it.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside script&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;
function centerWindow (center_window)&lt;br /&gt;
    local screenW, screenH = guiGetScreenSize()&lt;br /&gt;
    local windowW, windowH = guiGetSize(center_window, false)&lt;br /&gt;
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2&lt;br /&gt;
    return guiSetPosition(center_window, x, y, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example center the window.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
  myWindow = guiCreateWindow( 350, 100, 200, 250, &amp;quot;Window Title&amp;quot;, false )&lt;br /&gt;
end )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( &amp;quot;center&amp;quot;, function()&lt;br /&gt;
  if myWindow then&lt;br /&gt;
    centerWindow( myWindow )&lt;br /&gt;
  end&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: laserlaser&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=46478</id>
		<title>SetPedLookAt</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=46478"/>
		<updated>2016-01-26T18:12:29Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Note|Avoid calling setPedLookAt every frame as this can cause bugs like being invincible to burning.}}&lt;br /&gt;
{{Note|For remote players, you have to use [https://wiki.multitheftauto.com/wiki/SetPedAimTarget setPedAimTarget] before setPedLookAt.}}&lt;br /&gt;
Makes a ped turn his head and look at a specific world position or element.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000 [, int blend = 1000 ], element target = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the ped to change the lookat of.&lt;br /&gt;
*'''x:''' the x coordinate of the world position to look at.&lt;br /&gt;
*'''y:''' the y coordinate of the world position to look at.&lt;br /&gt;
*'''z:''' the z coordinate of the world position to look at.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.&lt;br /&gt;
*'''blend:''' the time, in milliseconds, during which the look will blend.&lt;br /&gt;
*'''target:''' if this argument is specified, the position arguments will be ignored and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example makes the local player look at where the camera points at. If you want to sync this effect with other players you can use [[triggerLatentServerEvent]] and [[triggerLatentClientEvent]] functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sx, sy = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function updateLookAt()&lt;br /&gt;
    -- The world coordinates of the center of the screen always are the point where the camera really looks at, so get them.&lt;br /&gt;
    local tx, ty, tz = getWorldFromScreenPosition(sx / 2, sy / 2, 10)&lt;br /&gt;
    setPedLookAt(localPlayer, tx, ty, tz, -1, 0) -- Make the player look that coordinates&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, updateLookAt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|4325|setPedLookAt does not work for remote players}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=46477</id>
		<title>SetPedLookAt</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=46477"/>
		<updated>2016-01-26T18:12:01Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: setPedAimTarget fixed the bug with remote players&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Note|Avoid calling setPedLookAt every frame as this can cause bugs like being invincible to burning.&lt;br /&gt;
For remote players, you have to use [https://wiki.multitheftauto.com/wiki/SetPedAimTarget setPedAimTarget] before setPedLookAt.}}&lt;br /&gt;
Makes a ped turn his head and look at a specific world position or element.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000 [, int blend = 1000 ], element target = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the ped to change the lookat of.&lt;br /&gt;
*'''x:''' the x coordinate of the world position to look at.&lt;br /&gt;
*'''y:''' the y coordinate of the world position to look at.&lt;br /&gt;
*'''z:''' the z coordinate of the world position to look at.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.&lt;br /&gt;
*'''blend:''' the time, in milliseconds, during which the look will blend.&lt;br /&gt;
*'''target:''' if this argument is specified, the position arguments will be ignored and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example makes the local player look at where the camera points at. If you want to sync this effect with other players you can use [[triggerLatentServerEvent]] and [[triggerLatentClientEvent]] functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sx, sy = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function updateLookAt()&lt;br /&gt;
    -- The world coordinates of the center of the screen always are the point where the camera really looks at, so get them.&lt;br /&gt;
    local tx, ty, tz = getWorldFromScreenPosition(sx / 2, sy / 2, 10)&lt;br /&gt;
    setPedLookAt(localPlayer, tx, ty, tz, -1, 0) -- Make the player look that coordinates&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, updateLookAt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|4325|setPedLookAt does not work for remote players}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MathNumber&amp;diff=46258</id>
		<title>MathNumber</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MathNumber&amp;diff=46258"/>
		<updated>2015-12-26T19:58:44Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function can be used to take or add a number from a large number.&lt;br /&gt;
&lt;br /&gt;
MTA clients do only support 24-bits numbers, therefore you can't take or add a single digit from large numbers like '1364576384'.&lt;br /&gt;
&lt;br /&gt;
This function is only needed clientside since the server runs with a floating-point precision of 56-bits, however this works also serverside.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int mathNumber ( int num, int integer [, string type = &amp;quot;+&amp;quot;] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''num''': The number you want to edit&lt;br /&gt;
* '''integer''': The amount you want to add or take from the number&lt;br /&gt;
* '''type ''': Can be either '-' or '+'&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a number if everything went good, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Function that takes a digit from a larger number&lt;br /&gt;
function mathNumber ( num, integer, type )&lt;br /&gt;
    if not ( num ) or not ( integer ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local function formatNumber( numb )&lt;br /&gt;
    if not ( numb ) then return false end&lt;br /&gt;
        local fn = string.sub( tostring( numb ), ( #tostring( numb ) -6 ) )&lt;br /&gt;
        return tonumber( fn )&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    if not ( type ) or ( type == &amp;quot;+&amp;quot; ) then&lt;br /&gt;
        local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) + integer&lt;br /&gt;
        return tonumber( fn )&lt;br /&gt;
    else&lt;br /&gt;
        local fn = string.sub( tostring( num ), 1, -8 )..( formatNumber ( num ) ) - integer&lt;br /&gt;
        return tonumber( fn )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mathNumber ( 1364576384, 1, '-' )&lt;br /&gt;
-- Returns: 1364576383&lt;br /&gt;
&lt;br /&gt;
1364576384 - 1&lt;br /&gt;
-- Returns: 1364576384&lt;br /&gt;
&lt;br /&gt;
mathNumber ( 1364576384, 1, '+' )&lt;br /&gt;
-- Returns: 1364576385&lt;br /&gt;
&lt;br /&gt;
1364576384 + 1&lt;br /&gt;
-- Returns: 1364576384&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Author: DennisUniOn&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetRGColorFromPercentage&amp;diff=46139</id>
		<title>GetRGColorFromPercentage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetRGColorFromPercentage&amp;diff=46139"/>
		<updated>2015-12-02T00:12:58Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function lets you get an RG Color depending on the percentage.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int, int getRGColorFromPercentage ( int percentage )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''percentage:''' The value which you want to get the RG from. It must be between 0 and 100.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two integers, with red, and green values if percentage goes between 0 and 100. Returns false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server/Client-Side Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getRGColorFromPercentage(percentage)&lt;br /&gt;
    if not percentage or percentage and type(percentage) ~= &amp;quot;number&amp;quot; or percentage &amp;gt; 100 or percentage &amp;lt; 0 then outputDebugString( &amp;quot;Invalid argument @ 'getRGColorFromPercentage'&amp;quot;, 2 ) return false end&lt;br /&gt;
    if percentage &amp;gt; 50 then&lt;br /&gt;
	local temp = 100 - percentage&lt;br /&gt;
        return temp*5.1, 255&lt;br /&gt;
    elseif percentage == 50 then&lt;br /&gt;
	return 255, 255&lt;br /&gt;
    else&lt;br /&gt;
	return 255, percentage*5.1&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client-Side Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example shows the vehicle health with a different color depending on its health in the bottom part of the screen.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sW, sH = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function showHealth()&lt;br /&gt;
     local health = getElementHealth(getPedOccupiedVehicle(localPlayer)) - 250&lt;br /&gt;
     -- When the car has got a health of 250, it turns into fire, so we remove 250 of the original health in order not to take it into account.&lt;br /&gt;
     if health &amp;lt; 0 then health = 0 end -- In case it goes negative, we set it as if it were 0.&lt;br /&gt;
     -- Now we need to make the conversion to a number between 0 to 100 knowing that health goes from 0 to 750.&lt;br /&gt;
     local percentage = math.floor((health*0.133333333333)+0.5) -- Transformation into percentage.&lt;br /&gt;
     -- We now use the function&lt;br /&gt;
     local r, g = getRGColorFromPercentage(percentage)&lt;br /&gt;
     -- We show it&lt;br /&gt;
     dxDrawText(&amp;quot;Health: &amp;quot;..percentage..&amp;quot;%&amp;quot;, sW/2-100, sH-45, sW/2+100, sH-15, tocolor(r, g, 0, 255), 1, &amp;quot;default&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- We add the handler of the function when player enters a car.&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerVehicleEnter&amp;quot;, localPlayer, &lt;br /&gt;
function()&lt;br /&gt;
    addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, showHealth)&lt;br /&gt;
end )&lt;br /&gt;
&lt;br /&gt;
-- We remove it when the player leaves a car.&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerVehicleExit&amp;quot;, localPlayer, &lt;br /&gt;
function()&lt;br /&gt;
    removeEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, showHealth)&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;
'''Author: Renkon'''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;br /&gt;
[[:Category:Useful_Functions]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46094</id>
		<title>GetBrowserVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46094"/>
		<updated>2015-11-05T22:02:36Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Undo revision 46093 by Emiliano Castro (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.5.1||&lt;br /&gt;
This function returns a specific [[Element/Browser|browser]]'s volume.&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;
float getBrowserVolume ( browser webBrowser )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:getVolume||setBrowserVolume}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''webBrowser:''' A browser element&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a specific [[Element/Browser|browser]]'s volume, or ''false'' if the browser element passed to the function is invalid.&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;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46093</id>
		<title>GetBrowserVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46093"/>
		<updated>2015-11-05T22:01:10Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.5.1||&lt;br /&gt;
This function returns a specific [[Element/Browser|browser]]'s volume.&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;
int getBrowserVolume ( browser webBrowser )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:getVolume||setBrowserVolume}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''webBrowser:''' A browser element&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a specific [[Element/Browser|browser]]'s volume, or ''false'' if the browser element passed to the function is invalid.&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;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46084</id>
		<title>GetBrowserVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46084"/>
		<updated>2015-10-31T19:15:31Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.5.1||&lt;br /&gt;
This function gets a specific [[Element/Browser|browser]]'s volume.&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;
bool getBrowserVolume ( webBrowser )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:getVolume||setBrowserVolume}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''webBrowser:''' A browser element&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a specific [[Element/Browser|browser]]'s volume, or ''false'' if the browser element passed to the function is invalid.&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;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46083</id>
		<title>GetBrowserVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetBrowserVolume&amp;diff=46083"/>
		<updated>2015-10-31T19:14:55Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Created page with &amp;quot;__NOTOC__ {{Client function}} {{New feature/item|3.0151|1.5|| This function gets a specific browser's volume. }}  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool getBrowserV...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.5||&lt;br /&gt;
This function gets a specific [[Element/Browser|browser]]'s volume.&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;
bool getBrowserVolume ( webBrowser )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:getVolume||setBrowserVolume}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''webBrowser:''' A browser element&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a specific [[Element/Browser|browser]]'s volume, or ''false'' if the browser element passed to the function is invalid.&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;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerNetworkStatus&amp;diff=46028</id>
		<title>OnPlayerNetworkStatus</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerNetworkStatus&amp;diff=46028"/>
		<updated>2015-10-10T04:33:12Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
{{New feature/item|3.0142|1.4.1|7295|&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when a players network connection is interrupted.&lt;br /&gt;
}}&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int status, int ticks&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''status''': A number which is 0 if the interruption has begun, or 1 if the interruption is ending.&lt;br /&gt;
*'''ticks''': Number of ticks since the interruption started.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player element]] that has the network interruption.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example shows a debug message when interruption starts and stops.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerNetworkStatus&amp;quot;, root,&lt;br /&gt;
  function( status, ticks )&lt;br /&gt;
    if status == 0 then&lt;br /&gt;
      outputDebugString( &amp;quot;(packets from &amp;quot; .. getPlayerName(source) .. &amp;quot;) interruption began &amp;quot; .. ticks .. &amp;quot; ticks ago&amp;quot; )&lt;br /&gt;
    elseif status == 1 then&lt;br /&gt;
      outputDebugString( &amp;quot;(packets from &amp;quot; .. getPlayerName(source) .. &amp;quot;) interruption began &amp;quot; .. ticks .. &amp;quot; ticks ago and has just ended&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other events===&lt;br /&gt;
{{Player_events}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerWeaponFire&amp;diff=46027</id>
		<title>OnClientPlayerWeaponFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerWeaponFire&amp;diff=46027"/>
		<updated>2015-10-10T04:29:04Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is called when a player fires a weapon.  This does not trigger for projectiles, melee weapons, or camera.&lt;br /&gt;
{{Note|This event is only triggered for players that are streamed in}}&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int weapon, int ammo, int ammoInClip, float hitX, float hitY, float hitZ, element hitElement, float startX, float startY, float startZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
*'''weapon''':  an [[int]] representing [[weapons|weapon]] used for making a shot.&lt;br /&gt;
*'''ammo''': an [[int]] amount of ammo left for this weapon type.&lt;br /&gt;
*'''ammoInClip''': an [[int]] amount of ammo left for this weapon type in clip.&lt;br /&gt;
*'''hitX''', '''hitY''', '''hitZ''': [[float]] world coordinates representing a hit point.&lt;br /&gt;
*'''hitElement''': an [[element]] which was hit by a shot.&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4311|&lt;br /&gt;
*'''startX''', '''startY''', '''startZ''': [[float]] world coordinates representing the start of the bullet. Note: This is not the gun muzzle.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the streamed in [[player]] who fired the weapon.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example sends a warning to the local player if they shoot another player with a minigun.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--First, we create a function for the event handler to use.&lt;br /&gt;
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement )&lt;br /&gt;
    if weapon == 38 and getElementType(hitElement)==&amp;quot;player&amp;quot; then -- If the player shoots with a minigun, and hits another player...&lt;br /&gt;
         outputChatBox ( &amp;quot;Don't kill people with minigun, it's lame!&amp;quot;, 255, 0, 0 ) -- We output a warning to him.&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- Add this as a handler so that the function will be triggered every time the local player fires.&lt;br /&gt;
addEventHandler ( &amp;quot;onClientPlayerWeaponFire&amp;quot;, getLocalPlayer(), onClientPlayerWeaponFireFunc )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example makes the Shotgun fire explosive rounds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)&lt;br /&gt;
    if (weapon == 25) then -- If the player shoots with a shotgun&lt;br /&gt;
        createExplosion(hitX, hitY, hitZ, 12, true, 0, true) -- Creates a tiny explosion where the bullet hit.&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- Add this as a handler so that the function will be triggered every time a player fires.&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWeaponFire&amp;quot;, root, onClientPlayerWeaponFireFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7459|[Fixed in 1.3.1-4916] onClientPlayerWeaponFire hitElement being nil sometimes with shotgun}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client player events===&lt;br /&gt;
{{Client_player_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Meta.xml&amp;diff=46018</id>
		<title>Meta.xml</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Meta.xml&amp;diff=46018"/>
		<updated>2015-09-23T22:44:39Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ''meta.xml'' file presents MTA with a set of metadata, such as the resource's name, the scripts to include, and which files to precache for sending to clients among other things. It is also the scope of &amp;quot;elements&amp;quot;. It is written in XML, which is based on HTML and is the parent of XHTML.&lt;br /&gt;
&lt;br /&gt;
=Tags=&lt;br /&gt;
XML is a textual data format which is widely used for the representation of data. MTA uses an XML-based language to describe the metadata for resources by using the tags below:&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;info /&amp;gt;''' Information about this resource, possible parameters include (any arbitrary parameters can be used and read using [[getResourceInfo]]):&lt;br /&gt;
** '''author:''' The author of this resource&lt;br /&gt;
** '''version:''' The version of this resource&lt;br /&gt;
** '''name:''' The name of this resource&lt;br /&gt;
** '''description:''' A brief description of this resource&lt;br /&gt;
** '''type:''' The type of this resource, that can be &amp;quot;gamemode&amp;quot;, &amp;quot;script&amp;quot;, &amp;quot;map&amp;quot; or &amp;quot;misc&amp;quot;.&lt;br /&gt;
*'''&amp;lt;script /&amp;gt;''' Source code for this resource, possible parameters are:&lt;br /&gt;
** '''src:''' The file name of the source code&lt;br /&gt;
** '''type:''' The type of source code: &amp;quot;client&amp;quot;, &amp;quot;server&amp;quot; or &amp;quot;shared&amp;quot;.&lt;br /&gt;
**'''cache:''' When the script file type is &amp;quot;client&amp;quot;, this setting controls whether the file is saved on the clients' hard drive. Default is &amp;quot;true&amp;quot;. Using &amp;quot;false&amp;quot; will mean the file is not saved. ''(Note: cache=false files are started at the client first, so lua file load order might differ when mixing cache settings)''&lt;br /&gt;
**'''validate:''' If set to &amp;quot;false&amp;quot;, compatibility checks are skipped.&lt;br /&gt;
*'''&amp;lt;map /&amp;gt;''' The map for a gamemode, possible parameters are:&lt;br /&gt;
**'''src:''' .map file name (can be path too eg. &amp;quot;maps/filename.map&amp;quot;)&lt;br /&gt;
**'''dimension:''' Dimension in which the map will be loaded (optional)&lt;br /&gt;
*'''&amp;lt;file /&amp;gt;''' A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join)&lt;br /&gt;
**'''src:''' client-side file name (can be path too eg. &amp;quot;images/image.png&amp;quot;)&lt;br /&gt;
**'''download:''' Whether or not to be sent to the client automatically (optional). Default is &amp;quot;true&amp;quot;. Using &amp;quot;false&amp;quot; will mean they are not sent on resource start but could later be used by [[downloadFile]] (from version 1.4)&lt;br /&gt;
*'''&amp;lt;include /&amp;gt;''' Include resources that this resource will use&lt;br /&gt;
**'''resource:''' Resource name that you want to start with this resource&lt;br /&gt;
**'''minversion:''' Minimum version that '''resource''' needs to be (optional)&lt;br /&gt;
**'''maxversion:''' Maximum version that '''resource''' needs to be (optional)&lt;br /&gt;
*'''&amp;lt;config /&amp;gt;''' Config file (.xml) can be accessed by resource, possible parameters are:&lt;br /&gt;
**'''src:''' The file name of the config file&lt;br /&gt;
**'''type:''' The type of the config file: &amp;quot;client&amp;quot; or &amp;quot;server&amp;quot;&lt;br /&gt;
*'''&amp;lt;export /&amp;gt;''' This exports functions from this resource, so other resources can use them with [[call]]&lt;br /&gt;
**'''function:''' The function name&lt;br /&gt;
**'''type''' Whether function is exported server-side or client-side (valid values are: &amp;quot;client&amp;quot;, &amp;quot;server&amp;quot; and &amp;quot;shared&amp;quot;)&lt;br /&gt;
**'''http:''' Can the function be called via HTTP (true/false)&lt;br /&gt;
*'''&amp;lt;html /&amp;gt;'''&lt;br /&gt;
**'''src:''' The filename for the HTTP file (can be a path)&lt;br /&gt;
**'''default:''' The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false)&lt;br /&gt;
**'''raw:''' The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false)&lt;br /&gt;
*'''&amp;lt;settings&amp;gt; &amp;lt;setting name=&amp;quot;&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt; &amp;lt;/settings&amp;gt;:''' Most gamemodes use [[settings system]] to let server admins to configure it how they like. For instance you could set round time and then use [[get]] and [[set]] to get the value or change it, respectively.&lt;br /&gt;
*'''&amp;lt;min_mta_version /&amp;gt;''' Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA (which at the moment is &amp;quot;{{Current Version|full}}&amp;quot;). See example for example.&lt;br /&gt;
**'''client:''' The minimum client version&lt;br /&gt;
**'''server:''' The minimum server version&lt;br /&gt;
*'''&amp;lt;aclrequest /&amp;gt;''' A list of [[Access_Control_List|ACL]] rights this resource will need.&lt;br /&gt;
{{New items|3.0132|1.3.1 r4141|&lt;br /&gt;
*'''&amp;lt;sync_map_element_data /&amp;gt;''' Controls whether map [[Element_data|element data]] such as &amp;quot;PosX&amp;quot; and &amp;quot;DoubleSided&amp;quot; are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource.&lt;br /&gt;
**'''false:''' Disable transfer of map element data for all resources. This can reduce map download times considerably.&lt;br /&gt;
**'''true:''' Enable transfer of map element data for all resources. (If '''false''' and '''true''' are set in different resources, true will have priority and all resources will transfer map element data)&lt;br /&gt;
}}&lt;br /&gt;
{{New items|3.0140|1.4.0 r5313|&lt;br /&gt;
*'''&amp;lt;oop/&amp;gt;''' OOP - Please refer to [[OOP]] for documentation.&lt;br /&gt;
**'''false:''' Disable OOP.&lt;br /&gt;
**'''true:''' Enable OOP.&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0150|1.5.0|7308|&lt;br /&gt;
*'''&amp;lt;download_priority_group/&amp;gt;''' If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Heres an example of a meta file using some of the tags mentioned:&lt;br /&gt;
{{#tag:code |&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info author=&amp;quot;Slothman&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;Stealth&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;config src=&amp;quot;help.xml&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;download_priority_group&amp;gt;0&amp;lt;/download_priority_group&amp;gt;&lt;br /&gt;
    &amp;lt;min_mta_version client=&amp;quot;{{Current Version|full}}&amp;quot; server=&amp;quot;{{Current Version|full}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;sync_map_element_data&amp;gt;false&amp;lt;/sync_map_element_data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noiseblip.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;mission_timer.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_client.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_client.lua&amp;quot; type=&amp;quot;client&amp;quot; validate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noisebar.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;spycam.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;riemann_z_demonstration.lua&amp;quot; type=&amp;quot;client&amp;quot; cache=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;map src=&amp;quot;base.map&amp;quot; dimension=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.txd&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.dff&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.col&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;armor.png&amp;quot; download=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;camera.png&amp;quot; download=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;cloak.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;goggles.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;mine.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;radar.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;shield.png&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;scoreboard&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;killmessages&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;maplimits&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport1&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport2&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport3&amp;quot; type=&amp;quot;shared&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;settings&amp;gt;&lt;br /&gt;
         &amp;lt;setting name=&amp;quot;roundlimit&amp;quot; value=&amp;quot;[6]&amp;quot; /&amp;gt; &amp;lt;!-- round length in minutes --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teamdamage&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!-- 0 for team protection off, 1 for team protection on --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teambalance&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!--  difference limit of amount of players between teams --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;spazammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt; &amp;lt;!-- ammo amounts --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;m4ammo&amp;quot; value=&amp;quot;[100]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;shotgunammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;sniperammo&amp;quot; value=&amp;quot;[20]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;ak47ammo&amp;quot; value=&amp;quot;[120]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;rifleammo&amp;quot; value=&amp;quot;[40]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;deserteagleammo&amp;quot; value=&amp;quot;[45]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;pistolammo&amp;quot; value=&amp;quot;[132]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;uziammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;tec9ammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;silencedammo&amp;quot; value=&amp;quot;[65]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;grenadeammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;satchelammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teargasammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;molatovammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;isAllowedToShoot&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/settings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;aclrequest&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;function.setPlayerMuted&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/aclrequest&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
|lang=&amp;quot;xml&amp;quot;}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[cs:Meta.xml]]&lt;br /&gt;
[[de:Meta.xml]]&lt;br /&gt;
[[es:Sobre el archivo &amp;quot;meta.xml&amp;quot;]]&lt;br /&gt;
[[it:Meta.xml]]&lt;br /&gt;
[[pl:Meta.xml]]&lt;br /&gt;
[[ru:Meta.xml]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Meta.xml&amp;diff=46017</id>
		<title>Meta.xml</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Meta.xml&amp;diff=46017"/>
		<updated>2015-09-23T22:40:18Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ''meta.xml'' file presents MTA with a set of metadata, such as the resource's name, the scripts to include, and which files to precache for sending to clients among other things. It is also the scope of &amp;quot;elements&amp;quot;. It is written in XML, which is based on HTML and is the parent of XHTML.&lt;br /&gt;
&lt;br /&gt;
=Tags=&lt;br /&gt;
XML is a textual data format which is widely used for the representation of data. MTA uses an XML-based language to describe the metadata for resources by using the tags below:&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;info /&amp;gt;''' Information about this resource, possible parameters include (any arbitrary parameters can be used and read using [[getResourceInfo]]):&lt;br /&gt;
** '''author:''' The author of this resource&lt;br /&gt;
** '''version:''' The version of this resource&lt;br /&gt;
** '''name:''' The name of this resource&lt;br /&gt;
** '''description:''' A brief description of this resource&lt;br /&gt;
** '''type:''' The type of this resource, that can be &amp;quot;gamemode&amp;quot;, &amp;quot;script&amp;quot;, &amp;quot;map&amp;quot; or &amp;quot;misc&amp;quot;.&lt;br /&gt;
*'''&amp;lt;script /&amp;gt;''' Source code for this resource, possible parameters are:&lt;br /&gt;
** '''src:''' The file name of the source code&lt;br /&gt;
** '''type:''' The type of source code: &amp;quot;client&amp;quot;, &amp;quot;server&amp;quot; or &amp;quot;shared&amp;quot;.&lt;br /&gt;
**'''cache:''' When the script file type is &amp;quot;client&amp;quot;, this setting controls whether the file is saved on the clients' hard drive. Default is &amp;quot;true&amp;quot;. Using &amp;quot;false&amp;quot; will mean the file is not saved. ''(Note: cache=false files are started at the client first, so lua file load order might differ when mixing cache settings)''&lt;br /&gt;
**'''validate:''' If set to &amp;quot;false&amp;quot;, compatibility checks are skipped.&lt;br /&gt;
*'''&amp;lt;map /&amp;gt;''' The map for a gamemode, possible parameters are:&lt;br /&gt;
**'''src:''' .map file name (can be path too eg. &amp;quot;maps/filename.map&amp;quot;)&lt;br /&gt;
**'''dimension:''' Dimension in which the map will be loaded (optional)&lt;br /&gt;
*'''&amp;lt;file /&amp;gt;''' A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join)&lt;br /&gt;
**'''src:''' client-side file name (can be path too eg. &amp;quot;images/image.png&amp;quot;)&lt;br /&gt;
**'''download:''' Whether or not to be sent to the client automatically (optional). Default is &amp;quot;true&amp;quot;. Using &amp;quot;false&amp;quot; will mean they are not sent on resource start but could later be used by [[downloadFile]] (from version 1.4)&lt;br /&gt;
*'''&amp;lt;include /&amp;gt;''' Include resources that this resource will use&lt;br /&gt;
**'''resource:''' Resource name that you want to start with this resource&lt;br /&gt;
**'''minversion:''' Minimum version that '''resource''' needs to be (optional)&lt;br /&gt;
**'''maxversion:''' Maximum version that '''resource''' needs to be (optional)&lt;br /&gt;
*'''&amp;lt;config /&amp;gt;''' Config file (.xml) can be accessed by resource, possible parameters are:&lt;br /&gt;
**'''src:''' The file name of the config file&lt;br /&gt;
**'''type:''' The type of the config file: &amp;quot;client&amp;quot; or &amp;quot;server&amp;quot;&lt;br /&gt;
*'''&amp;lt;export /&amp;gt;''' This exports functions from this resource, so other resources can use them with [[call]]&lt;br /&gt;
**'''function:''' The function name&lt;br /&gt;
**'''type''' Whether function is exported server-side or client-side (valid values are: &amp;quot;client&amp;quot;, &amp;quot;server&amp;quot; and &amp;quot;shared&amp;quot;)&lt;br /&gt;
**'''http:''' Can the function be called via HTTP (true/false)&lt;br /&gt;
*'''&amp;lt;html /&amp;gt;'''&lt;br /&gt;
**'''src:''' The filename for the HTTP file (can be a path)&lt;br /&gt;
**'''default:''' The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false)&lt;br /&gt;
**'''raw:''' The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false)&lt;br /&gt;
*'''&amp;lt;settings&amp;gt; &amp;lt;setting name=&amp;quot;&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt; &amp;lt;/settings&amp;gt;:''' Most gamemodes use [[settings system]] to let server admins to configure it how they like. For instance you could set round time and then use [[get]] and [[set]] to get the value or change it, respectively.&lt;br /&gt;
*'''&amp;lt;min_mta_version /&amp;gt;''' Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA (which at the moment is &amp;quot;{{Current Version|full}}&amp;quot;). See example for example.&lt;br /&gt;
**'''client:''' The minimum client version&lt;br /&gt;
**'''server:''' The minimum server version&lt;br /&gt;
*'''&amp;lt;aclrequest /&amp;gt;''' A list of [[Access_Control_List|ACL]] rights this resource will need.&lt;br /&gt;
{{New items|3.0132|1.3.1 r4141|&lt;br /&gt;
*'''&amp;lt;sync_map_element_data /&amp;gt;''' Controls whether map [[Element_data|element data]] such as &amp;quot;PosX&amp;quot; and &amp;quot;DoubleSided&amp;quot; are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource.&lt;br /&gt;
**'''false:''' Disable transfer of map element data for all resources. This can reduce map download times considerably.&lt;br /&gt;
**'''true:''' Enable transfer of map element data for all resources. (If '''false''' and '''true''' are set in different resources, true will have priority and all resources will transfer map element data)&lt;br /&gt;
}}&lt;br /&gt;
{{New items|3.0140|1.4.0 r5313|&lt;br /&gt;
*'''&amp;lt;oop/&amp;gt;''' OOP - Please refer to [[OOP]] for documentation.&lt;br /&gt;
**'''false:''' Disable OOP.&lt;br /&gt;
**'''true:''' Enable OOP.&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0150|1.5.0|7308|&lt;br /&gt;
*'''&amp;lt;download_priority_group/&amp;gt;''' If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Heres an example of a meta file using some of the tags mentioned:&lt;br /&gt;
{{#tag:code |&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info author=&amp;quot;Slothman&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;Stealth&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;config src=&amp;quot;help.xml&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;min_mta_version client=&amp;quot;{{Current Version|full}}&amp;quot; server=&amp;quot;{{Current Version|full}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;sync_map_element_data&amp;gt;false&amp;lt;/sync_map_element_data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noiseblip.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;mission_timer.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_client.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_client.lua&amp;quot; type=&amp;quot;client&amp;quot; validate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noisebar.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;spycam.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;riemann_z_demonstration.lua&amp;quot; type=&amp;quot;client&amp;quot; cache=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;map src=&amp;quot;base.map&amp;quot; dimension=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.txd&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.dff&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.col&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;armor.png&amp;quot; download=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;camera.png&amp;quot; download=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;cloak.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;goggles.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;mine.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;radar.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;shield.png&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;scoreboard&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;killmessages&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;maplimits&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport1&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport2&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport3&amp;quot; type=&amp;quot;shared&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;settings&amp;gt;&lt;br /&gt;
         &amp;lt;setting name=&amp;quot;roundlimit&amp;quot; value=&amp;quot;[6]&amp;quot; /&amp;gt; &amp;lt;!-- round length in minutes --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teamdamage&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!-- 0 for team protection off, 1 for team protection on --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teambalance&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!--  difference limit of amount of players between teams --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;spazammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt; &amp;lt;!-- ammo amounts --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;m4ammo&amp;quot; value=&amp;quot;[100]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;shotgunammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;sniperammo&amp;quot; value=&amp;quot;[20]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;ak47ammo&amp;quot; value=&amp;quot;[120]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;rifleammo&amp;quot; value=&amp;quot;[40]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;deserteagleammo&amp;quot; value=&amp;quot;[45]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;pistolammo&amp;quot; value=&amp;quot;[132]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;uziammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;tec9ammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;silencedammo&amp;quot; value=&amp;quot;[65]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;grenadeammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;satchelammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teargasammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;molatovammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;isAllowedToShoot&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/settings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;aclrequest&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;function.setPlayerMuted&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/aclrequest&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
|lang=&amp;quot;xml&amp;quot;}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[cs:Meta.xml]]&lt;br /&gt;
[[de:Meta.xml]]&lt;br /&gt;
[[es:Sobre el archivo &amp;quot;meta.xml&amp;quot;]]&lt;br /&gt;
[[it:Meta.xml]]&lt;br /&gt;
[[pl:Meta.xml]]&lt;br /&gt;
[[ru:Meta.xml]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=46016</id>
		<title>BanPlayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BanPlayer&amp;diff=46016"/>
		<updated>2015-09-23T21:17:10Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
This function will ban the specified player by either IP, [[serial]] or username&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
This function will ban the specified player from the server by IP.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, player/string responsiblePlayer = nil, string reason = nil, int seconds = 0 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{OOP||[[player]]:ban||}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bannedPlayer:''' The player that will be banned from the server.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''IP:''' Will player be banned by IP?&lt;br /&gt;
*'''Username:''' Will player be banned by username?&lt;br /&gt;
*'''Serial:''' Will player be banned by serial?&lt;br /&gt;
}}&lt;br /&gt;
*'''responsibleElement:''' The element that is responsible for banning the player. This can be a player or the root ([[getRootElement]]()) (Maximum 30 characters if using a string).&lt;br /&gt;
*'''reason:''' The reason the player will be banned from the server.&lt;br /&gt;
*'''seconds:''' The amount of seconds the player will be banned from the server for. This can be 0 for an infinite amount of time.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[ban]] object if banned successfully, or ''false'' if unsuccessful.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets a player ban anyone if he has ACL rights.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add the &amp;quot;ban&amp;quot; command handler&lt;br /&gt;
-- Example with the player&lt;br /&gt;
function banPlayerCommand ( theClient, commandName, bannedName, reason )&lt;br /&gt;
&lt;br /&gt;
	-- Give the player a nice error if he doesn't have rights&lt;br /&gt;
	if ( hasObjectPermissionTo ( theClient, &amp;quot;function.banPlayer&amp;quot; ) ) then&lt;br /&gt;
		--Get player element from the name&lt;br /&gt;
		local bannedPlayer = getPlayerFromName ( bannedName )&lt;br /&gt;
&lt;br /&gt;
		--Ban the player&lt;br /&gt;
		banPlayer ( bannedPlayer, theClient, reason )&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: &amp;quot; .. bannedName .. &amp;quot; successfully banned&amp;quot;, theClient )&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox ( &amp;quot;ban: You don't have enough permissions&amp;quot;, theClient )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;ban&amp;quot;, banPlayerCommand )&lt;br /&gt;
&lt;br /&gt;
-- Example function with the root element. Here you would pass a player element to the function.&lt;br /&gt;
function banCheater(theCheater)&lt;br /&gt;
	banPlayer(theCheater, getRootElement(), &amp;quot;You are banned because of cheating.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example is Firewall Account Player by serial on Login&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
    [ 'AccountName' ] = 'SerialPlayer',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if ( Serial ) then&lt;br /&gt;
            if Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
                banPlayer ( source, false, false, true, getRootElement ( ), 'reason ban' )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Admin_functions}}&lt;br /&gt;
[[es:banPlayer]]&lt;br /&gt;
[[ru:BanPlayer]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementModel&amp;diff=46015</id>
		<title>GetElementModel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementModel&amp;diff=46015"/>
		<updated>2015-09-23T00:26:43Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Returns the model ID of a given element. This can be a player/ped skin, a pickup model, an object model or a vehicle model.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getElementModel ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:getModel|model|setElementModel}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' the element to retrieve the model ID of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the model ID if successful, ''false'' otherwise.&lt;br /&gt;
* For players/peds: A GTASA player model (skin) ID. See [[Character Skins]].&lt;br /&gt;
* For vehicles: The [[Vehicle IDs|vehicle ID]] of the vehicle.&lt;br /&gt;
* For objects: An [[int]] specifying the model id.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Example 1 (Server)&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example destroys a haystack when a player targets it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerTargeted ( targetElem )&lt;br /&gt;
    if ( getElementType ( targetElem ) == &amp;quot;object&amp;quot; ) and ( getElementModel ( targetElem ) == 3374 ) then&lt;br /&gt;
        destroyElement ( targetElem )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerTarget&amp;quot;, root, onPlayerTargeted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Example 2 (Server)&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example prints out a message when a Shamal or AT-400 is entered by a player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function planeEnter ( theVehicle, seat, jacked ) -- when someone enters a vehicle&lt;br /&gt;
    local id = getElementModel ( theVehicle ) -- get the model ID of the vehicle&lt;br /&gt;
    if id == 519 or id == 577 then -- if theVehicle is either Shamal or AT-400&lt;br /&gt;
        local vehicleName = getVehicleName ( theVehicle ) -- get the name of theVehicle&lt;br /&gt;
        outputChatBox ( &amp;quot;Someone stole a &amp;quot; .. vehicleName .. &amp;quot;!&amp;quot; ) -- announce that someone stole the plane&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add the event handler to the event&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleEnter&amp;quot;, root, planeEnter )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementModel&amp;diff=46014</id>
		<title>SetElementModel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementModel&amp;diff=46014"/>
		<updated>2015-09-23T00:26:29Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Sets the model of a given element. This allows you to change the model of a player (or ped), a vehicle or an object.&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 setElementModel ( element theElement, int model )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:setModel|model|getElementModel}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' the element you want to change.&lt;br /&gt;
*'''model:''' the model ID to set.&lt;br /&gt;
** For players/peds: A GTASA player model (skin) ID. See [[Character Skins]].&lt;br /&gt;
** For vehicles: The [[Vehicle IDs|vehicle ID]] of the vehicle being changed.&lt;br /&gt;
** For objects/projectiles/weapons: An [[int]] specifying the model id.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Example 1 (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;
addCommandHandler ( &amp;quot;changeveh&amp;quot;,&lt;br /&gt;
    function ( thePlayer, command, newModel )&lt;br /&gt;
        local theVehicle = getPedOccupiedVehicle ( thePlayer ) -- get the vehicle the player is in&lt;br /&gt;
        newModel = tonumber ( newModel )                          -- try to convert the string argument to a number&lt;br /&gt;
        if theVehicle and newModel then                           -- make sure the player is in a vehicle and specified a number&lt;br /&gt;
            setElementModel ( theVehicle, newModel )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After the above code is executed, a player can get in any vehicle and execute e.g. the command &amp;quot;/changeveh 520&amp;quot; to change it into a hydra.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Example 2 (Server)&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This will continually change an object model every 2.5 seconds at the location -1084.52, -1634.81, 76.36 (Truth's farm).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myobject = createObject ( 5822, -1084.52, -1634.81, 76.36 )&lt;br /&gt;
-- We create an initial object element. I choose object model 5822 to begin with.&lt;br /&gt;
&lt;br /&gt;
function objectRandomization ()  &lt;br /&gt;
    local randomobjectnumber = math.random(1, 18000)&lt;br /&gt;
    -- Choose a random number between 1 and 18000 as a whole integer and assign it to&lt;br /&gt;
    -- the variable 'randomobjectnumber'&lt;br /&gt;
    setElementModel ( myobject, randomobjectnumber )&lt;br /&gt;
    -- Change our object appearance by applying a new model ID&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setTimer ( objectRandomization, 2500, 0 )&lt;br /&gt;
-- Every 2.5 seconds, the function 'objectRandomization' is called by this timer.&lt;br /&gt;
-- Each time the function runs, it changes the object model by applying a new whole-&lt;br /&gt;
-- integer random object ID. This timer is called an infinite amount of times since  &lt;br /&gt;
-- its repeat value is set to 0.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementRotation&amp;diff=46013</id>
		<title>GetElementRotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementRotation&amp;diff=46013"/>
		<updated>2015-09-23T00:26:02Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Retrieve the rotation of elements.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float float float getElementRotation ( element theElement [, string rotOrder = &amp;quot;default&amp;quot; ] )       &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:getRotation|rotation|setElementRotation}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element whose rotation will be retrieved&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''rotOrder:''' A string representing the rotation order desired when returning the [http://en.wikipedia.org/wiki/Euler_angles euler angles]. If omitted, default value is ''&amp;quot;default&amp;quot;''. Allowed values are:&lt;br /&gt;
**''&amp;quot;default&amp;quot;:'' default MTA behavior prior to 1.1, where rotation order depends on element type&lt;br /&gt;
**''&amp;quot;ZXY&amp;quot;:'' rotation about the Z axis (''up''), then about the resulting X axis (''right'') and finally about the resulting Y axis (''front''). This is the default rotation order for [[object|objects]]&lt;br /&gt;
**''&amp;quot;ZYX&amp;quot;:'' rotation about the Z axis (''up''), then about the resulting Y axis (''front''), and finally about the resulting X axis (''right''). This is the default rotation order for [[vehicle|vehicles]]&lt;br /&gt;
&lt;br /&gt;
The default rotation order for peds/players is Z-Y-X (clientside) and -Z-Y-X (serverside) but those rotation orders (set using ''&amp;quot;default&amp;quot;'' on peds) can not be used manually on other element types since they only exist due to historical and backward compatibility reasons.&lt;br /&gt;
Specifying a rotation order other than ''&amp;quot;default&amp;quot;'' allows the same angles to later be uniformly used on several elements without having to consider their type.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''rx, ry, rz'': 3 ''float''s representing the Euler rotation angles on the axis X, Y and Z (with the rotation order depending on the ''rotOrder'' argument) if ''element'' exists and is a valid element, ''false'' if it's invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
If a player points at a player element with a gun, its rotation will appear in the chat box.&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;
function onPlayerTargeted ( targetElem )&lt;br /&gt;
    if ( isElement(targetElem) and getElementType (targetElem) == &amp;quot;player&amp;quot; ) then&lt;br /&gt;
        local x,y,z = getElementRotation ( targetElem )&lt;br /&gt;
        outputChatBox ( &amp;quot;Target player rotation: &amp;quot; .. x .. &amp;quot; &amp;quot; .. y .. &amp;quot; &amp;quot; .. z )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientPlayerTarget&amp;quot;, root, onPlayerTargeted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_element_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementRotation&amp;diff=46012</id>
		<title>SetElementRotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementRotation&amp;diff=46012"/>
		<updated>2015-09-23T00:25:47Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Sets the rotation of elements according to the world (does not work with players that are on the ground).&lt;br /&gt;
{{Tip|New scripts should set '''conformPedRotation''' to ''true'' when using this function on [[Ped|peds]]. This will prevent quirky old behaviour.}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementRotation ( element theElement, float rotX, float rotY, float rotZ [, string rotOrder = &amp;quot;default&amp;quot;, bool conformPedRotation = false ] )       &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setRotation||getElementRotation}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element whose rotation will be set&lt;br /&gt;
*'''rotX:''' The element's rotation around the x axis in degrees&lt;br /&gt;
*'''rotY:''' The element's rotation around the y axis in degrees&lt;br /&gt;
*'''rotZ:''' The element's rotation around the z axis in degrees&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
*'''rotOrder:''' A string representing the rotation order desired when interpreting the provided [http://en.wikipedia.org/wiki/Euler_angles euler angles]. If omitted, default value is ''&amp;quot;default&amp;quot;''. Allowed values are:&lt;br /&gt;
**''&amp;quot;default&amp;quot;:'' default MTA behavior prior to 1.1, where rotation order depends on element type&lt;br /&gt;
**''&amp;quot;ZXY&amp;quot;:'' rotation about the Z axis (''up''), then about the resulting X axis (''right''), and finally about the resulting Y axis (''front''). This is the default rotation order for [[object|objects]]&lt;br /&gt;
**''&amp;quot;ZYX&amp;quot;:'' rotation about the Z axis (''up''), then about the resulting Y axis (''front''), and finally about the resulting X axis (''right''). This is the default rotation order for [[vehicle|vehicles]]&lt;br /&gt;
&lt;br /&gt;
The default rotation order for peds/players is -Z-Y-X but this rotation order (set using ''&amp;quot;default&amp;quot;'' on peds) can not be set manually on other element types since it only exists due to historical and backward compatibility reasons.&lt;br /&gt;
Specifying a rotation order other than ''&amp;quot;default&amp;quot;'' allows the same angles to be uniformly used on several elements without having to consider their type.&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0152|1.3.2|4680|&lt;br /&gt;
*'''conformPedRotation:''' ''Relevant only for peds and will be ignored for other element types.'' A bool which should be set to ''true'' to ensure the ped rotation is correctly set in all circumstances. Failing to set this argument may result in the ped rotation being inverted whilst it is in the air and other inconsistencies. The default value of false is for backward compatibility with scripts which may depend upon the incorrect behaviour.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element rotation was successfully set and ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
How to correctly set the rotation for a ped:&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;
function pedRotate ( )&lt;br /&gt;
    local rotX, rotY, rotZ = getElementRotation(localPlayer) -- get the local players's rotation&lt;br /&gt;
    setElementRotation(localPlayer,0,0,rotZ+10,&amp;quot;default&amp;quot;,true) -- turn the player 10 degrees clockwise&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;turn&amp;quot;, pedRotate )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a player used the command &amp;quot;turn&amp;quot; and they are the driver of a vehicle the vehicle will rotate 10 degrees clockwise&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;
function carRotate( )&lt;br /&gt;
    if isPedInVehicle(localPlayer) then -- if the local client is in a vehicle&lt;br /&gt;
        localVehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
        if getVehicleController(localVehicle) == localPlayer then -- if the local client is the controller (driver) of the vehicle&lt;br /&gt;
            local rotX, rotY, rotZ = getElementRotation(localVehicle) -- get the local client's vehicle rotation&lt;br /&gt;
            setElementRotation(localVehicle,rotX,rotY,rotZ+10) -- turn the vehicle 10 degrees clockwise&lt;br /&gt;
         end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;turn&amp;quot;, carRotate )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04680|Added conformPedRotation argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_element_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementInterior&amp;diff=46011</id>
		<title>GetElementInterior</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementInterior&amp;diff=46011"/>
		<updated>2015-09-23T00:25:05Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to retrieve the interior of any element. An interior is the current loaded place, 0 being outside.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getElementInterior ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:getInterior|interior|setElementInterior}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The element of which you'd like to retrieve the interior&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[int]] for the interior if '''theElement''' is valid, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
This example shows a player if he is outside or not, when he enters the command 'AmIOutside'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function AmIOutside ( thePlayer, command )&lt;br /&gt;
    if ( getElementInterior(thePlayer) == 0 ) then&lt;br /&gt;
        outputChatBox ( &amp;quot;Yes you are outside &amp;quot; .. getPlayerName(thePlayer), thePlayer )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( &amp;quot;No you aren't outside &amp;quot; .. getPlayerName(thePlayer), thePlayer )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;AmIOutside&amp;quot;, AmIOutside )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[de:getElementInterior]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementInterior&amp;diff=46010</id>
		<title>SetElementInterior</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementInterior&amp;diff=46010"/>
		<updated>2015-09-23T00:24:54Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to set the [[interior]] of any element. An interior is the current loaded place, 0 being outside.&lt;br /&gt;
{{Note|If passing the same interior as the element is in, the call will be ignored and position (optional arguments) will not be set either. Use [[setElementPosition]] separately to be sure the position will be set.}}&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 setElementInterior ( element theElement, int interior [, float x, float y, float z] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:setInterior||getElementInterior}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The element in which you'd like to set the interior of.&lt;br /&gt;
*'''interior:''' The interior you want to set the element to. Valid values are 0 to 255.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if '''theElement''' and '''interior''' are valid arguments, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
In this example, if a player were to type /interior 1, they would be teleported into this interior&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function interior ( source, commandName, interior )&lt;br /&gt;
  --Let's see if they gave an interior ID&lt;br /&gt;
  if ( interior ) then&lt;br /&gt;
    --They did, so lets assign them to that interior and teleport them there (all in 1 function call!)&lt;br /&gt;
    setElementInterior ( source, interior, 2233.91, 1714.73, 1011.38 )&lt;br /&gt;
  else&lt;br /&gt;
    --They didn't give one, so set them to the interior they wanted, but don't teleport them.&lt;br /&gt;
    setElementInterior ( source, 0 )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;interior&amp;quot;, interior )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
In this example, if a player were to type /interior 1, they would be teleported into this interior&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function interior ( commandName, interior )&lt;br /&gt;
  --Let's see if they gave a interior ID&lt;br /&gt;
  if ( interior ) then&lt;br /&gt;
    --They did, so let's assign them to that interior and teleport them there (all in 1 function call!)&lt;br /&gt;
    setElementInterior ( localPlayer, interior, 2233.91, 1714.73, 1011.38 )&lt;br /&gt;
  else&lt;br /&gt;
    --They didn't give one, so set them to the interior they wanted, but don't teleport them.&lt;br /&gt;
    setElementInterior ( localPlayer, 0 )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;interior&amp;quot;, interior )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[de:setElementInterior]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementPosition&amp;diff=46009</id>
		<title>SetElementPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementPosition&amp;diff=46009"/>
		<updated>2015-09-23T00:24:23Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the position of an element to the specified coordinates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FF7070; border: 3px solid #FF0000;&amp;quot;&amp;gt;&lt;br /&gt;
'''Attention:''' Do not use this function to spawn a [[player]]. It will cause problems with other functions like [[warpPedIntoVehicle]]. &amp;lt;br&amp;gt;&lt;br /&gt;
Use [[spawnPlayer]] instead.&lt;br /&gt;
&amp;lt;/div&amp;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;
bool setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setPosition|position|getElementPosition}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' A valid [[element]] to be moved.&lt;br /&gt;
*'''x:''' The x coordinate of the destination.&lt;br /&gt;
*'''y:''' The y coordinate of the destination.&lt;br /&gt;
*'''z:''' The z coordinate of the destination.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''warp:''' teleports players, resetting any animations they were doing. Setting this to ''false'' preserves the current animation.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a &amp;quot;setpos&amp;quot; command to console, which allows setting of a player's position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleSetPlayerPosition ( source, commandName, posX, posY, posZ )&lt;br /&gt;
	setElementPosition ( source, posX, posY, posZ )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;setpos&amp;quot;, consoleSetPlayerPosition  )&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;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a &amp;quot;setpos&amp;quot; command to console, which allows setting of the local player's position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleSetPlayerPosition ( commandName, posX, posY, posZ )&lt;br /&gt;
	setElementPosition ( localPlayer, posX, posY, posZ )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;setpos&amp;quot;, consoleSetPlayerPosition  )&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;Example 3&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
This example enables a player to type /warpto &amp;lt;playername&amp;gt; to warp to them. If the player being warped to is in a vehicle with a free passenger seat, it will warp into the vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function consoleWarpTo ( sourcePlayer, commandName, player2nick )&lt;br /&gt;
	-- Make sure required parameters are set&lt;br /&gt;
	if ( not sourcePlayer or not player2nick ) then return end&lt;br /&gt;
	-- Setup the variables we will be using for teleportation&lt;br /&gt;
	local x, y, z, r, d = 0, 0, 0, 0, 2.5&lt;br /&gt;
	-- Grab the element identifier of the player we are trying to warp to&lt;br /&gt;
	local player2 = getPlayerFromNick ( player2nick )&lt;br /&gt;
	-- Make sure it exists!&lt;br /&gt;
	if ( player2 ) then&lt;br /&gt;
		-- Is the player we're warping to in a vehicle?&lt;br /&gt;
		if ( isPlayerInVehicle ( player2 ) ) then&lt;br /&gt;
			-- Indeed they are, let's get the vehicle information such as the vehicle element itself, and the seats it's got.&lt;br /&gt;
			local player2vehicle = getPlayerOccupiedVehicle ( player2 )&lt;br /&gt;
			local numseats = getVehicleMaxPassengers ( player2vehicle )&lt;br /&gt;
			local i = 0&lt;br /&gt;
			-- Loop over the seats to see if there's a free one&lt;br /&gt;
			while ( i &amp;lt; numseats ) do&lt;br /&gt;
				if ( getVehicleOccupant ( player2vehicle, i ) ) then&lt;br /&gt;
					-- This seat isn't free, go ahead and check the next one&lt;br /&gt;
					i = i + 1&lt;br /&gt;
				else&lt;br /&gt;
					-- This seat is free, get out of the loop&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			-- Check if 'i' is lower than the number of seats. If it is, it means it's the number of a free seat&lt;br /&gt;
			if ( i &amp;lt; numseats ) then&lt;br /&gt;
				-- Teleport the player into the seat&lt;br /&gt;
				warpPlayerIntoVehicle ( sourcePlayer, player2vehicle, i )&lt;br /&gt;
			else&lt;br /&gt;
				-- There are no free seats, tell the player that.&lt;br /&gt;
				outputChatBox ( &amp;quot;Sorry, the player's vehicle is full (&amp;quot; .. getVehicleName ( player2vehicle ) .. &amp;quot; &amp;quot; .. i .. &amp;quot;/&amp;quot; .. numseats .. &amp;quot;)&amp;quot;, sourcePlayer )&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- The player isn't in a vehicle, let's get the player's position and warp to them.&lt;br /&gt;
			x, y, z = getElementPosition ( player2 )&lt;br /&gt;
			r = getPlayerRotation ( player2 )&lt;br /&gt;
			-- Make sure we get interior data, they might be inside one!&lt;br /&gt;
			interior = getElementInterior ( player2 )&lt;br /&gt;
			dimension = getElementDimension ( player2 )&lt;br /&gt;
			-- Do some funky math to make sure that we dont teleport inside of them (get us both stuck inside each other)&lt;br /&gt;
			x = x - ( ( math.cos ( math.rad ( r + 90 ) ) ) * d )&lt;br /&gt;
			y = y - ( ( math.sin ( math.rad ( r + 90 ) ) ) * d )&lt;br /&gt;
			-- Set a few timers for setting interiors, dimensions and positions&lt;br /&gt;
			setTimer ( setElementInterior, 800, 1, sourcePlayer, interior )&lt;br /&gt;
			setTimer ( setElementDimension, 900, 1, sourcePlayer, dimension )&lt;br /&gt;
			setTimer ( setElementPosition, 1000, 1, sourcePlayer, x, y, z )&lt;br /&gt;
			setTimer ( setPlayerRotation, 1000, 1, sourcePlayer, r )&lt;br /&gt;
			-- Fade the camera to make it look nicer&lt;br /&gt;
			fadeCamera ( sourcePlayer, false, 1, 0, 0, 0 )&lt;br /&gt;
			-- Fade it back once it's all complete!&lt;br /&gt;
			setTimer ( fadeCamera, 1000, 1, sourcePlayer, true, 1 )&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- No player by the specified name was found, tell the warper this.&lt;br /&gt;
		outputChatBox ( &amp;quot;No such player.&amp;quot;, sourcePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;warpto&amp;quot;, consoleWarpTo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementID&amp;diff=46008</id>
		<title>GetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementID&amp;diff=46008"/>
		<updated>2015-09-23T00:23:39Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function gets the ID of an element. This is the &amp;quot;id&amp;quot; attribute of the element and is a string, NOT a number like a model ID, weapons ID or similar.&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 getElementID ( element theElement ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:getID|id|setElementID}} &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' the element from which to retrieve the ID.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns a ''string'' containing the element ID. It will return an empty ''string'' if it has no ID. It will return ''false'' if the element is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
To get the ID of the following element:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;flag id=&amp;quot;northflag&amp;quot; posX=&amp;quot;2365&amp;quot; posY=&amp;quot;215&amp;quot; posZ=&amp;quot;32&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- assume flag refers to the flag element in the above XML code&lt;br /&gt;
idstring = getElementID ( flag )                   -- get the id of the flag element&lt;br /&gt;
outputChatBox ( &amp;quot;The flag's ID is: &amp;quot; .. idstring ) -- output: The flag's ID is: northflag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;br /&gt;
[[de:GetElementID]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=46007</id>
		<title>SetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=46007"/>
		<updated>2015-09-23T00:23:15Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets the ID of an element to a string. This can be anything from an identifying number, to a name.&lt;br /&gt;
You can only change the ID of an element clientside if that element has been created clientside as well.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementID ( element theElement, string name ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP|[[element]]:setID|id||getElementID}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you want to set the ID of.&lt;br /&gt;
*'''name:''' The new ID for theElement.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns ''true'' if successful. It will return ''false'' if '''theElement''' is invalid, or does not exist, or if '''name''' is invalid, or is not a string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType( &amp;quot;player&amp;quot; )&lt;br /&gt;
 &lt;br /&gt;
for i=1,#players do&lt;br /&gt;
   setElementID( players[i], &amp;quot;player&amp;quot; .. i )	-- Change element IDs to 'player1', 'players2', 'players3'...&lt;br /&gt;
   outputDebugString( &amp;quot;Player[&amp;quot; .. i .. &amp;quot;] = &amp;quot; .. getElementID( players[i] ) ) -- Output all the new element IDs&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Could also be --&lt;br /&gt;
&lt;br /&gt;
for i=1,#players do&lt;br /&gt;
   setElementID( players[i], getPlayerName( players[i] ) )	-- Change the element ID to the players name.&lt;br /&gt;
   outputDebugString( &amp;quot;Player[&amp;quot; .. i .. &amp;quot;] = &amp;quot; .. getElementID( players[i] ) )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{element_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=46006</id>
		<title>SetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=46006"/>
		<updated>2015-09-23T00:22:46Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets the ID of an element to a string. This can be anything from an identifying number, to a name.&lt;br /&gt;
You can only change the ID of an element clientside if that element has been created clientside as well.&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementID ( element theElement, string name ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP|[[element]]:setID|id|getElementID}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you want to set the ID of.&lt;br /&gt;
*'''name:''' The new ID for theElement.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns ''true'' if successful. It will return ''false'' if '''theElement''' is invalid, or does not exist, or if '''name''' is invalid, or is not a string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType( &amp;quot;player&amp;quot; )&lt;br /&gt;
 &lt;br /&gt;
for i=1,#players do&lt;br /&gt;
   setElementID( players[i], &amp;quot;player&amp;quot; .. i )	-- Change element IDs to 'player1', 'players2', 'players3'...&lt;br /&gt;
   outputDebugString( &amp;quot;Player[&amp;quot; .. i .. &amp;quot;] = &amp;quot; .. getElementID( players[i] ) ) -- Output all the new element IDs&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Could also be --&lt;br /&gt;
&lt;br /&gt;
for i=1,#players do&lt;br /&gt;
   setElementID( players[i], getPlayerName( players[i] ) )	-- Change the element ID to the players name.&lt;br /&gt;
   outputDebugString( &amp;quot;Player[&amp;quot; .. i .. &amp;quot;] = &amp;quot; .. getElementID( players[i] ) )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{element_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=46005</id>
		<title>SetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=46005"/>
		<updated>2015-09-23T00:20:03Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function stores [[element data]] under a certain key, attached to an element. Element data set using this is then synced with all clients and the server. The data can contain server created elements, but you should avoid passing data that is not able to be synced such as xmlnodes, acls, aclgroups etc.&lt;br /&gt;
&lt;br /&gt;
As element data is synced to all clients, it can generate a lot of network traffic and consume server CPU. Events are much more efficient for sending data from a client to the server only, or from the server to a specific client.&lt;br /&gt;
&lt;br /&gt;
{{Tip|A simple and efficient way to make a variable known to the server and clients is to use setElementData on the [[root]] element.}}&lt;br /&gt;
{{Note|See [[Script security]] for tips on preventing cheaters when using events and element data}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setData||getElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 31 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the server (client-side variation) and remote clients (both variations).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set succesfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7389|[Fixed in 1.3.5-7389] Problem with floating numbers}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example allows a player to add a custom tag onto their nickname, and also reverts it back to normal if they wish.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function addPlayerCustomTag ( thePlayer, command, newTag )&lt;br /&gt;
	--Let's make sure the newTag param has been entered...&lt;br /&gt;
	if ( newTag ) then&lt;br /&gt;
		--Grab their current playername for saving.&lt;br /&gt;
		local sPlayerNickname = getPlayerName ( thePlayer )&lt;br /&gt;
		--Create their new nickname with their tag&lt;br /&gt;
		local sNewPlayerNickname = newTag .. &amp;quot; &amp;quot; .. sPlayerNickname&lt;br /&gt;
		&lt;br /&gt;
		--Let's first load the element data, see if it's there already&lt;br /&gt;
		--The reason for this is that if a player were to do /addtag twice,&lt;br /&gt;
		--the tag would be prepended a second time&lt;br /&gt;
		local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
		if ( sOldNick == false ) then&lt;br /&gt;
			--Save their orignal nickname in their element data&lt;br /&gt;
			setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, sPlayerNickname )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Set their new nickname globally&lt;br /&gt;
		setPlayerName ( thePlayer, sNewPlayerNickname )&lt;br /&gt;
		&lt;br /&gt;
		--Tell them it's done&lt;br /&gt;
		outputChatBox ( &amp;quot;Your new nickname has been set, to put it back to its original state you can use /deltag&amp;quot;, thePlayer )&lt;br /&gt;
	else&lt;br /&gt;
		--The newTag param was not entered, give an error message&lt;br /&gt;
		outputChatBox ( &amp;quot;/addtag - Incorrect syntax, Correct: /addtag &amp;lt;newtag&amp;gt;&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;addtag&amp;quot;, addPlayerCustomTag )&lt;br /&gt;
&lt;br /&gt;
function removePlayerCustomTag ( thePlayer, command )&lt;br /&gt;
	--We first need to check that they have already used /addtag, let's do that now&lt;br /&gt;
	local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
	if ( sOldNick ) then&lt;br /&gt;
		--Great, they have a tag added, let's reset them&lt;br /&gt;
		&lt;br /&gt;
		--First we will want to reset the element data back to its default (that being false)&lt;br /&gt;
		setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, false )&lt;br /&gt;
		&lt;br /&gt;
		--Now set the client name back&lt;br /&gt;
		setPlayerName( thePlayer, sOldNick )&lt;br /&gt;
		&lt;br /&gt;
		--Notify them&lt;br /&gt;
		outputChatBox ( &amp;quot;Your old nickname has been set&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;deltag&amp;quot;, removePlayerCustomTag )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetAccountData&amp;diff=46004</id>
		<title>GetAccountData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetAccountData&amp;diff=46004"/>
		<updated>2015-09-23T00:19:31Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note_box|It is strongly recommended that you use the standard ''module.key'' naming for your keys, as shown in the example below. This prevents collisions between different scripts.}}&lt;br /&gt;
This function retrieves a string that has been stored using [[setAccountData]]. Data stored as account data is persistent across user's sessions and maps, unless they are logged into a guest account.&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 getAccountData ( account theAccount, string key )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[account]]:getData||setAccountData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theAccount:''' The account you wish to retrieve the data from.&lt;br /&gt;
*'''key:''' The key under which the data is stored&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[string]] containing the stored data or ''false'' if no data was stored under that key.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
For a pirate roleplaying gametype, the amount of money a player has is made persistent by storing it in his account. Note the code uses &amp;quot;piraterpg.money&amp;quot; as key instead of just &amp;quot;money&amp;quot;, as the player may be participating in other gametypes that also save his money amount to his account. If both gametypes would use &amp;quot;money&amp;quot; as the account key, they'd overwrite each other's data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerQuit()&lt;br /&gt;
      local playerAccount = getPlayerAccount(source) -- get his account&lt;br /&gt;
      if (playerAccount) then -- if we got the account then&lt;br /&gt;
            local playerMoney = getPlayerMoney(source) -- get his money amount&lt;br /&gt;
            setAccountData(playerAccount, &amp;quot;piraterpg.money&amp;quot;, playerMoney) -- store his current money amount in his account data&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, getRootElement(), onPlayerQuit) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function onPlayerLogin()&lt;br /&gt;
      -- when a player logins, retrieve his money amount from his account data and set it&lt;br /&gt;
      local playerAccount = getPlayerAccount(source) -- get his account&lt;br /&gt;
      if (playerAccount) then -- if we got the account then&lt;br /&gt;
            local playerMoney = getAccountData(playerAccount, &amp;quot;piraterpg.money&amp;quot;) -- get the money amount was store in his account data&lt;br /&gt;
            -- make sure there was actually a value saved under this key (check if playerMoney is not false).&lt;br /&gt;
            -- this will for example not be the case when a player plays the gametype for the first time&lt;br /&gt;
            if (playerMoney) then&lt;br /&gt;
                  setPlayerMoney(source, playerMoney)&lt;br /&gt;
            end&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, getRootElement(), onPlayerLogin) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:getAccountData]]&lt;br /&gt;
[[ar:getAccountData]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAccountData&amp;diff=46003</id>
		<title>SetAccountData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAccountData&amp;diff=46003"/>
		<updated>2015-09-23T00:19:18Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note_box|It is strongly recommended that you use the standard ''module.key'' naming for your keys, as shown in the example below. This prevents collisions between different scripts.}}&lt;br /&gt;
This function sets a string to be stored in an [[account]]. This can then be retrieved using [[getAccountData]]. Data stored as account data is persistent across user's sessions and maps, unless they are logged into a guest account. Even if logged into a guest account, account data can be useful as a way to store a reference to your own account system, though it's persistence is equivalent to that of using [[setElementData]] on the player's element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setAccountData ( account theAccount, string key, string value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[account]]:setData||getAccountData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theAccount:''' The account you wish to retrieve the data from.&lt;br /&gt;
*'''key:''' The key under which you wish to store the data&lt;br /&gt;
*'''value:''' The value you wish to store. Set to false to remove the data. '''NOTE:''' you cannot store tables as values, but you can use [[toJSON]] strings.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the account data was set, ''false'' if an invalid argument was specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
For a pirate roleplaying gametype, the amount of money a player has is made persistent by storing it in his account. Note the code uses &amp;quot;piraterpg.money&amp;quot; as key instead of just &amp;quot;money&amp;quot;, as the player may be participating in other gametypes that also save his money amount to his account. If both gametypes would use &amp;quot;money&amp;quot; as the account key, they'd overwrite each other's data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerQuit ( )&lt;br /&gt;
      -- when a player leaves, store his current money amount in his account data&lt;br /&gt;
      local playeraccount = getPlayerAccount ( source )&lt;br /&gt;
      if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in&lt;br /&gt;
            local playermoney = getPlayerMoney ( source ) -- get the player money&lt;br /&gt;
            setAccountData ( playeraccount, &amp;quot;piraterpg.money&amp;quot;, playermoney ) -- save it in his account&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function onPlayerLogin (_, playeraccount )&lt;br /&gt;
      -- when a player logins, retrieve his money amount from his account data and set it&lt;br /&gt;
      if ( playeraccount ) then&lt;br /&gt;
            local playermoney = getAccountData ( playeraccount, &amp;quot;piraterpg.money&amp;quot; )&lt;br /&gt;
            -- make sure there was actually a value saved under this key (check if playermoney is not false).&lt;br /&gt;
            -- this will for example not be the case when a player plays the gametype for the first time&lt;br /&gt;
            if ( playermoney ) then&lt;br /&gt;
                  setPlayerMoney ( source, playermoney )&lt;br /&gt;
            end&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerQuit&amp;quot;, getRootElement ( ), onPlayerQuit )&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerLogin&amp;quot;, getRootElement ( ), onPlayerLogin )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|7757|[Fixed in 1.3.4-7757] setAccountData clips the digits after the decimal point}}&lt;br /&gt;
}}&lt;br /&gt;
===Workaround for issue 7757===&lt;br /&gt;
Convert your floating point number to a string.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setAccountData(account, &amp;quot;myKey&amp;quot;, tostring(0.123))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:setAccountData]]&lt;br /&gt;
[[es:setAccountData]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=46002</id>
		<title>GetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=46002"/>
		<updated>2015-09-23T00:18:44Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function retrieves [[element data]] attached to an element under a certain key.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;var getElementData ( element theElement, string key [, inherit = true] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:getData||setElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' This is the element with data you want to retrieve.&lt;br /&gt;
*'''key:''' The name of the element data entry you want to retrieve. (Maximum 31 characters.)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''inherit:''' - toggles whether or not the function should go up the hierarchy to find the requested key in case the specified element doesn't have it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''variable'' containing the requested element data, or ''false'' if the element or the element data does not exist. When getting data corresponding to a XML attribute, this is always a ''string''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example stores the tick count when a player joins and then allows players to see how long they are connected using a console function 'joinTime'.&lt;br /&gt;
&amp;lt;section show=&amp;quot;true&amp;quot; name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinTime ( )&lt;br /&gt;
    setElementData ( source, &amp;quot;joinTime&amp;quot;, getTickCount() ) -- Store the current tick count in the player's data with the key 'joinTime'&lt;br /&gt;
end&lt;br /&gt;
-- Make our 'joinTime' function be called when a player joins&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, root, joinTime )&lt;br /&gt;
&lt;br /&gt;
function showJoinTime ( source, commandName, playerName )&lt;br /&gt;
	if ( playerName ) then -- see if a player was specified&lt;br /&gt;
		thePlayer = getPlayerFromName ( playerName ) -- get the player element for the specified player&lt;br /&gt;
		if ( thePlayer ) then -- if one was found...&lt;br /&gt;
			local timeOnline = (getTickCount() - getElementData ( thePlayer, &amp;quot;joinTime&amp;quot; )) / 1000 -- calculates the time since join&lt;br /&gt;
			outputChatBox ( getPlayerName ( thePlayer )..&amp;quot; joined &amp;quot;..timeOnline..&amp;quot; seconds ago&amp;quot;, source ) -- output the player's join time&lt;br /&gt;
		else&lt;br /&gt;
			outputChatBox ( &amp;quot;Couldn't find '&amp;quot; .. playerName .. &amp;quot;'&amp;quot;, source ) -- display an error&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- display when the player who used the function joined and inform how to see other people's join time&lt;br /&gt;
		local timeOnline = (getTickCount() - getElementData ( source, &amp;quot;joinTime&amp;quot; )) / 1000 -- calculate the time since join&lt;br /&gt;
		outputChatBox ( &amp;quot;You joined &amp;quot; ..timeOnline..&amp;quot; seconds ago&amp;quot;, source )&lt;br /&gt;
		outputChatBox ( &amp;quot;Use 'join_time &amp;lt;player name&amp;gt;' to see other people's join time&amp;quot;, source )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
-- Add a console command joinTime, that takes an optional parameter of a player's name&lt;br /&gt;
addCommandHandler ( &amp;quot;joinTime&amp;quot;, showJoinTime )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetBrowserProperty&amp;diff=45998</id>
		<title>SetBrowserProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetBrowserProperty&amp;diff=45998"/>
		<updated>2015-09-18T22:16:32Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
This function sets a given property of a specified browser.&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;
bool setBrowserProperty ( browser theBrowser, string key, string value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:setProperty||getBrowserProperty}}&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''theBrowser:''' The browser element you want to set a property of&lt;br /&gt;
*'''key:''' The browser property key. It can be:&lt;br /&gt;
**'''mobile:''' Surfing the web as mobile&lt;br /&gt;
*'''value:''' A value indicating whether to enable (&amp;quot;1&amp;quot;) the property or not (&amp;quot;0&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the property was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
{{Example}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetBrowserProperty&amp;diff=45975</id>
		<title>SetBrowserProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetBrowserProperty&amp;diff=45975"/>
		<updated>2015-09-15T01:13:34Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
This function sets a given property of a specified browser.&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;
bool setBrowserProperty ( browser theBrowser, string key, string value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:setProperty||getBrowserProperty}}&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''theBrowser:''' The browser element you want to set a property of&lt;br /&gt;
*'''key:''' The browser property key. It can be:&lt;br /&gt;
**'''mobile:''' Surfing the web as mobile&lt;br /&gt;
*'''value:''' A value indicating whether to enable (&amp;quot;1&amp;quot;) the property or not (&amp;quot;0&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the property was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetOnlineAdmins&amp;diff=45945</id>
		<title>GetOnlineAdmins</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetOnlineAdmins&amp;diff=45945"/>
		<updated>2015-09-12T23:59:02Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function will give the online admins&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getOnlineAdmins()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&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;
function getOnlineAdmins()&lt;br /&gt;
	local t = {}&lt;br /&gt;
	for k,v in ipairs ( getElementsByType(&amp;quot;player&amp;quot;) ) do&lt;br /&gt;
		local acc = getPlayerAccount(v)&lt;br /&gt;
		if acc and not isGuestAccount(acc) then&lt;br /&gt;
			local accName = getAccountName(acc)&lt;br /&gt;
			local isAdmin = isObjectInACLGroup(&amp;quot;user.&amp;quot;..accName,aclGetGroup(&amp;quot;Admin&amp;quot;))&lt;br /&gt;
			if isAdmin then&lt;br /&gt;
				table.insert(t,v)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return t&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&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;
addCommandHandler(&amp;quot;admins&amp;quot;,function(p)&lt;br /&gt;
	local Admins = getOnlineAdmins() -- the function will return 1 table&lt;br /&gt;
	if #Admins ~= 0 then -- if the admins table not empty then&lt;br /&gt;
		outputChatBox(&amp;quot;Online Admins&amp;quot;,p,255,0,0,true) &lt;br /&gt;
		for k,v in ipairs ( Admins ) do -- loop the table&lt;br /&gt;
			outputChatBox(&amp;quot;- &amp;quot;..getPlayerName(v),p,255,0,0,true) -- output the player name&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function created by '''Al3grab'''.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=45943</id>
		<title>FileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=45943"/>
		<updated>2015-09-12T23:43:16Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Little mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7446|&lt;br /&gt;
Use this function to get file's path.&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 fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file you want to get the path.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' with the path, ''false'' if there's something wrong with the file in the argument.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&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;
{{File functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&amp;diff=45942</id>
		<title>Template:Client vehicle functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&amp;diff=45942"/>
		<updated>2015-09-12T23:42:30Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Little mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[addVehicleUpgrade]]&lt;br /&gt;
*[[attachTrailerToVehicle]]&lt;br /&gt;
*[[blowVehicle]]&lt;br /&gt;
*[[createVehicle]]&lt;br /&gt;
*[[detachTrailerFromVehicle]]&lt;br /&gt;
*[[fixVehicle]]&lt;br /&gt;
*[[getHeliBladeCollisionsEnabled]]&lt;br /&gt;
*[[getHelicopterRotorSpeed]]&lt;br /&gt;
*[[getOriginalHandling]]&lt;br /&gt;
*[[getTrainDirection]]&lt;br /&gt;
*[[getTrainSpeed]]&lt;br /&gt;
*[[getVehicleAdjustableProperty]]&lt;br /&gt;
*[[getVehicleColor]]&lt;br /&gt;
*[[getVehicleCompatibleUpgrades]]&lt;br /&gt;
*[[getVehicleComponents]]&lt;br /&gt;
*[[getVehicleComponentPosition]]&lt;br /&gt;
*[[getVehicleComponentRotation]]&lt;br /&gt;
*[[getVehicleComponentVisible]]&lt;br /&gt;
*[[getVehicleController]]&lt;br /&gt;
*[[getVehicleDoorOpenRatio]]&lt;br /&gt;
*[[getVehicleDoorState]]&lt;br /&gt;
*[[getVehicleEngineState]]&lt;br /&gt;
*[[getVehicleGravity]]&lt;br /&gt;
*[[getVehicleHandling]]&lt;br /&gt;
*[[getVehicleHeadLightColor]]&lt;br /&gt;
*[[getVehicleLandingGearDown]]&lt;br /&gt;
*[[getVehicleLightState]]&lt;br /&gt;
*[[getVehicleMaxPassengers]]&lt;br /&gt;
*[[getVehicleModelFromName]]&lt;br /&gt;
*[[getVehicleName]]&lt;br /&gt;
*[[getVehicleNameFromModel]]&lt;br /&gt;
*[[getVehicleNitroCount]]&lt;br /&gt;
*[[getVehicleNitroLevel]]&lt;br /&gt;
*[[getVehicleOccupant]]&lt;br /&gt;
*[[getVehicleOccupants]]&lt;br /&gt;
*[[getVehicleCurrentGear]]&lt;br /&gt;
*[[getVehicleOverrideLights]]&lt;br /&gt;
*[[getVehiclePaintjob]]&lt;br /&gt;
*[[getVehiclePanelState]]&lt;br /&gt;
*[[getVehiclePlateText]]&lt;br /&gt;
*[[getVehicleSirens]]&lt;br /&gt;
*[[getVehicleSirensOn]]&lt;br /&gt;
*[[getVehicleSirenParams]]&lt;br /&gt;
*[[getVehicleTowedByVehicle]]&lt;br /&gt;
*[[getVehicleTowingVehicle]]&lt;br /&gt;
*[[getVehicleTurnVelocity]]&lt;br /&gt;
*[[getVehicleTurretPosition]]&lt;br /&gt;
*[[getVehicleType]]&lt;br /&gt;
*[[getVehicleUpgradeOnSlot]]&lt;br /&gt;
*[[getVehicleUpgrades]]&lt;br /&gt;
*[[getVehicleUpgradeSlotName]]&lt;br /&gt;
*[[getVehicleVariant]]&lt;br /&gt;
*[[getVehicleWheelStates]]&lt;br /&gt;
*[[isTrainChainEngine]]&lt;br /&gt;
*[[isTrainDerailable]]&lt;br /&gt;
*[[isTrainDerailed]]&lt;br /&gt;
*[[isVehicleBlown]]&lt;br /&gt;
*[[isVehicleDamageProof]]&lt;br /&gt;
*[[isVehicleFuelTankExplodable]]&lt;br /&gt;
*[[isVehicleLocked]]&lt;br /&gt;
*[[isVehicleNitroRecharging]]&lt;br /&gt;
*[[isVehicleNitroActivated]]&lt;br /&gt;
*[[isVehicleOnGround]]&lt;br /&gt;
*[[isVehicleTaxiLightOn]]&lt;br /&gt;
*[[removeVehicleUpgrade]]&lt;br /&gt;
*[[resetVehicleComponentPosition]]&lt;br /&gt;
*[[resetVehicleComponentRotation]]&lt;br /&gt;
*[[setHeliBladeCollisionsEnabled]]&lt;br /&gt;
*[[setHelicopterRotorSpeed]]&lt;br /&gt;
*[[setVehicleAdjustableProperty]]&lt;br /&gt;
*[[setVehicleColor]]&lt;br /&gt;
*[[setVehicleComponentPosition]]&lt;br /&gt;
*[[setVehicleComponentRotation]]&lt;br /&gt;
*[[setVehicleComponentVisible]]&lt;br /&gt;
*[[setVehicleDamageProof]]&lt;br /&gt;
*[[setVehicleDirtLevel]]&lt;br /&gt;
*[[setVehicleDoorOpenRatio]]&lt;br /&gt;
*[[setVehicleDoorState]]&lt;br /&gt;
*[[setVehicleDoorsUndamageable]]&lt;br /&gt;
*[[setVehicleEngineState]]&lt;br /&gt;
*[[setVehicleFuelTankExplodable]]&lt;br /&gt;
*[[setVehicleGravity]]&lt;br /&gt;
*[[setVehicleHeadLightColor]]&lt;br /&gt;
*[[setVehicleLandingGearDown]]&lt;br /&gt;
*[[setVehicleLightState]]&lt;br /&gt;
*[[setVehicleLocked]]&lt;br /&gt;
*[[setVehicleNitroActivated]]&lt;br /&gt;
*[[setVehicleNitroCount]]&lt;br /&gt;
*[[setVehicleNitroLevel]]&lt;br /&gt;
*[[setVehicleOverrideLights]]&lt;br /&gt;
*[[setVehiclePaintjob]]&lt;br /&gt;
*[[setVehiclePanelState]]&lt;br /&gt;
*[[setVehiclePlateText]]&lt;br /&gt;
*[[setVehicleSirens]]&lt;br /&gt;
*[[setVehicleSirensOn]]&lt;br /&gt;
*[[setVehicleTurretPosition]]&lt;br /&gt;
*[[setVehicleTaxiLightOn]]&lt;br /&gt;
*[[setVehicleTurnVelocity]]&lt;br /&gt;
*[[setVehicleWheelStates]]&lt;br /&gt;
*[[setTrainDerailable]]&lt;br /&gt;
*[[setTrainDerailed]]&lt;br /&gt;
*[[setTrainDirection]]&lt;br /&gt;
*[[setTrainSpeed]]&lt;br /&gt;
{{New items|3.0160|1.6|&lt;br /&gt;
*[[isVehicleWindowOpen]]&lt;br /&gt;
*[[getTrainTrack]]&lt;br /&gt;
*[[setTrainTrack]]&lt;br /&gt;
*[[setVehicleWindowOpen]]&lt;br /&gt;
|}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTrainTrack&amp;diff=45941</id>
		<title>SetTrainTrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTrainTrack&amp;diff=45941"/>
		<updated>2015-09-12T23:39:42Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Little mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7485|&lt;br /&gt;
Sets the track of a train&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setTrainTrack ( vehicle train, int track )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:setTrack|track|setTrainTrack}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to set the track&lt;br /&gt;
*'''track:''' the track where you want to set the train. It can be 1, 2 or 3.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the track was set to the train, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;setTrain&amp;quot;,&lt;br /&gt;
function (cmd,train)&lt;br /&gt;
	local thePlayer = getLocalPlayer()&lt;br /&gt;
	local theVehicle = getPedOccupiedVehicle(thePlayer)&lt;br /&gt;
	local cc = getElementModel(theVehicle)&lt;br /&gt;
		if cc == 449 or cc == 537 or cc == 538 or cc == 570 or cc == 569 or cc == 590 then&lt;br /&gt;
	setTrainTrack(theVehicle, train)&lt;br /&gt;
		end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTrainTrack&amp;diff=45940</id>
		<title>GetTrainTrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTrainTrack&amp;diff=45940"/>
		<updated>2015-09-12T23:39:29Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: Little mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7485|&lt;br /&gt;
Gets the track of a train&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getTrainTrack ( vehicle train )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:getTrack|track|getTrainTrack}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to get the track.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''intenger'' which means the track of the train, ''false'' if there is problem with train element.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;getTrain&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
	local thePlayer = getLocalPlayer()&lt;br /&gt;
	local theVehicle = getPedOccupiedVehicle(thePlayer)&lt;br /&gt;
	train = getTrainTrack(theVehicle)&lt;br /&gt;
	outputChatBox(&amp;quot;Train Track is &amp;quot;..train)&lt;br /&gt;
end)&lt;br /&gt;
&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>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTrainTrack&amp;diff=45939</id>
		<title>SetTrainTrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTrainTrack&amp;diff=45939"/>
		<updated>2015-09-12T23:18:21Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.6|7485|&lt;br /&gt;
Sets the track of a train&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setTrainTrack ( vehicle train, int track )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:setTrack|track|setTrainTrack}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to set the track&lt;br /&gt;
*'''track:''' the track where you want to set the train. It can be 1, 2 or 3.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the track was set to the train, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;setTrain&amp;quot;,&lt;br /&gt;
function (cmd,train)&lt;br /&gt;
	local thePlayer = getLocalPlayer()&lt;br /&gt;
	local theVehicle = getPedOccupiedVehicle(thePlayer)&lt;br /&gt;
	local cc = getElementModel(theVehicle)&lt;br /&gt;
		if cc == 449 or cc == 537 or cc == 538 or cc == 570 or cc == 569 or cc == 590 then&lt;br /&gt;
	setTrainTrack(theVehicle, train)&lt;br /&gt;
		end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTrainTrack&amp;diff=45938</id>
		<title>GetTrainTrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTrainTrack&amp;diff=45938"/>
		<updated>2015-09-12T23:13:45Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0151|1.6|7485|&lt;br /&gt;
Gets the track of a train&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getTrainTrack ( vehicle train )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:getTrack|track|getTrainTrack}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''train:''' the train of which to get the track.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''intenger'' which means the track of the train, ''false'' if there is problem with train element.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;getTrain&amp;quot;,&lt;br /&gt;
function ()&lt;br /&gt;
	local thePlayer = getLocalPlayer()&lt;br /&gt;
	local theVehicle = getPedOccupiedVehicle(thePlayer)&lt;br /&gt;
	train = getTrainTrack(theVehicle)&lt;br /&gt;
	outputChatBox(&amp;quot;Train Track is &amp;quot;..train)&lt;br /&gt;
end)&lt;br /&gt;
&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>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Changes_in_1.5.8&amp;diff=45933</id>
		<title>Changes in 1.5.8</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Changes_in_1.5.8&amp;diff=45933"/>
		<updated>2015-09-11T22:13:16Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: /* Client */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Main Additions / Changes ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New functions ===&lt;br /&gt;
&lt;br /&gt;
====Client====&lt;br /&gt;
*[[getTrainTrack]]&lt;br /&gt;
*[[isVehicleWindowOpen]]&lt;br /&gt;
*[[setTrainTrack]]&lt;br /&gt;
*[[setVehicleWindowOpen]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
==== Shared (''Client &amp;amp; Server side'') ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New Events ===&lt;br /&gt;
&lt;br /&gt;
==== Client ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
=== Scripting: Changes, Bugfixes and Additions ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
&lt;br /&gt;
=== Client: Additions ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
=== Client: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
=== Server: Additions ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
=== Server: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Extra information ==&lt;br /&gt;
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and GitHub repositories:&lt;br /&gt;
:* [https://github.com/multitheftauto/mtasa-blue MTA: SA Blue]&lt;br /&gt;
:* [https://github.com/multitheftauto/mtasa-resources MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&amp;diff=45932</id>
		<title>Template:Client vehicle functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&amp;diff=45932"/>
		<updated>2015-09-11T22:12:24Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[addVehicleUpgrade]]&lt;br /&gt;
*[[attachTrailerToVehicle]]&lt;br /&gt;
*[[blowVehicle]]&lt;br /&gt;
*[[createVehicle]]&lt;br /&gt;
*[[detachTrailerFromVehicle]]&lt;br /&gt;
*[[fixVehicle]]&lt;br /&gt;
*[[getHeliBladeCollisionsEnabled]]&lt;br /&gt;
*[[getHelicopterRotorSpeed]]&lt;br /&gt;
*[[getOriginalHandling]]&lt;br /&gt;
*[[getTrainDirection]]&lt;br /&gt;
*[[getTrainSpeed]]&lt;br /&gt;
*[[getVehicleAdjustableProperty]]&lt;br /&gt;
*[[getVehicleColor]]&lt;br /&gt;
*[[getVehicleCompatibleUpgrades]]&lt;br /&gt;
*[[getVehicleComponents]]&lt;br /&gt;
*[[getVehicleComponentPosition]]&lt;br /&gt;
*[[getVehicleComponentRotation]]&lt;br /&gt;
*[[getVehicleComponentVisible]]&lt;br /&gt;
*[[getVehicleController]]&lt;br /&gt;
*[[getVehicleDoorOpenRatio]]&lt;br /&gt;
*[[getVehicleDoorState]]&lt;br /&gt;
*[[getVehicleEngineState]]&lt;br /&gt;
*[[getVehicleGravity]]&lt;br /&gt;
*[[getVehicleHandling]]&lt;br /&gt;
*[[getVehicleHeadLightColor]]&lt;br /&gt;
*[[getVehicleLandingGearDown]]&lt;br /&gt;
*[[getVehicleLightState]]&lt;br /&gt;
*[[getVehicleMaxPassengers]]&lt;br /&gt;
*[[getVehicleModelFromName]]&lt;br /&gt;
*[[getVehicleName]]&lt;br /&gt;
*[[getVehicleNameFromModel]]&lt;br /&gt;
*[[getVehicleNitroCount]]&lt;br /&gt;
*[[getVehicleNitroLevel]]&lt;br /&gt;
*[[getVehicleOccupant]]&lt;br /&gt;
*[[getVehicleOccupants]]&lt;br /&gt;
*[[getVehicleCurrentGear]]&lt;br /&gt;
*[[getVehicleOverrideLights]]&lt;br /&gt;
*[[getVehiclePaintjob]]&lt;br /&gt;
*[[getVehiclePanelState]]&lt;br /&gt;
*[[getVehiclePlateText]]&lt;br /&gt;
*[[getVehicleSirens]]&lt;br /&gt;
*[[getVehicleSirensOn]]&lt;br /&gt;
*[[getVehicleSirenParams]]&lt;br /&gt;
*[[getVehicleTowedByVehicle]]&lt;br /&gt;
*[[getVehicleTowingVehicle]]&lt;br /&gt;
*[[getVehicleTurnVelocity]]&lt;br /&gt;
*[[getVehicleTurretPosition]]&lt;br /&gt;
*[[getVehicleType]]&lt;br /&gt;
*[[getVehicleUpgradeOnSlot]]&lt;br /&gt;
*[[getVehicleUpgrades]]&lt;br /&gt;
*[[getVehicleUpgradeSlotName]]&lt;br /&gt;
*[[getVehicleVariant]]&lt;br /&gt;
*[[getVehicleWheelStates]]&lt;br /&gt;
*[[isTrainChainEngine]]&lt;br /&gt;
*[[isTrainDerailable]]&lt;br /&gt;
*[[isTrainDerailed]]&lt;br /&gt;
*[[isVehicleBlown]]&lt;br /&gt;
*[[isVehicleDamageProof]]&lt;br /&gt;
*[[isVehicleFuelTankExplodable]]&lt;br /&gt;
*[[isVehicleLocked]]&lt;br /&gt;
*[[isVehicleNitroRecharging]]&lt;br /&gt;
*[[isVehicleNitroActivated]]&lt;br /&gt;
*[[isVehicleOnGround]]&lt;br /&gt;
*[[isVehicleTaxiLightOn]]&lt;br /&gt;
*[[removeVehicleUpgrade]]&lt;br /&gt;
*[[resetVehicleComponentPosition]]&lt;br /&gt;
*[[resetVehicleComponentRotation]]&lt;br /&gt;
*[[setHeliBladeCollisionsEnabled]]&lt;br /&gt;
*[[setHelicopterRotorSpeed]]&lt;br /&gt;
*[[setVehicleAdjustableProperty]]&lt;br /&gt;
*[[setVehicleColor]]&lt;br /&gt;
*[[setVehicleComponentPosition]]&lt;br /&gt;
*[[setVehicleComponentRotation]]&lt;br /&gt;
*[[setVehicleComponentVisible]]&lt;br /&gt;
*[[setVehicleDamageProof]]&lt;br /&gt;
*[[setVehicleDirtLevel]]&lt;br /&gt;
*[[setVehicleDoorOpenRatio]]&lt;br /&gt;
*[[setVehicleDoorState]]&lt;br /&gt;
*[[setVehicleDoorsUndamageable]]&lt;br /&gt;
*[[setVehicleEngineState]]&lt;br /&gt;
*[[setVehicleFuelTankExplodable]]&lt;br /&gt;
*[[setVehicleGravity]]&lt;br /&gt;
*[[setVehicleHeadLightColor]]&lt;br /&gt;
*[[setVehicleLandingGearDown]]&lt;br /&gt;
*[[setVehicleLightState]]&lt;br /&gt;
*[[setVehicleLocked]]&lt;br /&gt;
*[[setVehicleNitroActivated]]&lt;br /&gt;
*[[setVehicleNitroCount]]&lt;br /&gt;
*[[setVehicleNitroLevel]]&lt;br /&gt;
*[[setVehicleOverrideLights]]&lt;br /&gt;
*[[setVehiclePaintjob]]&lt;br /&gt;
*[[setVehiclePanelState]]&lt;br /&gt;
*[[setVehiclePlateText]]&lt;br /&gt;
*[[setVehicleSirens]]&lt;br /&gt;
*[[setVehicleSirensOn]]&lt;br /&gt;
*[[setVehicleTurretPosition]]&lt;br /&gt;
*[[setVehicleTaxiLightOn]]&lt;br /&gt;
*[[setVehicleTurnVelocity]]&lt;br /&gt;
*[[setVehicleWheelStates]]&lt;br /&gt;
*[[setTrainDerailable]]&lt;br /&gt;
*[[setTrainDerailed]]&lt;br /&gt;
*[[setTrainDirection]]&lt;br /&gt;
*[[setTrainSpeed]]&lt;br /&gt;
{{New items|3.0151|1.6|&lt;br /&gt;
*[[isVehicleWindowOpen]]&lt;br /&gt;
*[[getTrainTrack]]&lt;br /&gt;
*[[setTrainTrack]]&lt;br /&gt;
*[[setVehicleWindowOpen]]&lt;br /&gt;
|}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&amp;diff=45931</id>
		<title>Template:Client vehicle functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&amp;diff=45931"/>
		<updated>2015-09-11T22:10:27Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[addVehicleUpgrade]]&lt;br /&gt;
*[[attachTrailerToVehicle]]&lt;br /&gt;
*[[blowVehicle]]&lt;br /&gt;
*[[createVehicle]]&lt;br /&gt;
*[[detachTrailerFromVehicle]]&lt;br /&gt;
*[[fixVehicle]]&lt;br /&gt;
*[[getHeliBladeCollisionsEnabled]]&lt;br /&gt;
*[[getHelicopterRotorSpeed]]&lt;br /&gt;
*[[getOriginalHandling]]&lt;br /&gt;
*[[getTrainDirection]]&lt;br /&gt;
*[[getTrainSpeed]]&lt;br /&gt;
*[[getVehicleAdjustableProperty]]&lt;br /&gt;
*[[getVehicleColor]]&lt;br /&gt;
*[[getVehicleCompatibleUpgrades]]&lt;br /&gt;
*[[getVehicleComponents]]&lt;br /&gt;
*[[getVehicleComponentPosition]]&lt;br /&gt;
*[[getVehicleComponentRotation]]&lt;br /&gt;
*[[getVehicleComponentVisible]]&lt;br /&gt;
*[[getVehicleController]]&lt;br /&gt;
*[[getVehicleDoorOpenRatio]]&lt;br /&gt;
*[[getVehicleDoorState]]&lt;br /&gt;
*[[getVehicleEngineState]]&lt;br /&gt;
*[[getVehicleGravity]]&lt;br /&gt;
*[[getVehicleHandling]]&lt;br /&gt;
*[[getVehicleHeadLightColor]]&lt;br /&gt;
*[[getVehicleLandingGearDown]]&lt;br /&gt;
*[[getVehicleLightState]]&lt;br /&gt;
*[[getVehicleMaxPassengers]]&lt;br /&gt;
*[[getVehicleModelFromName]]&lt;br /&gt;
*[[getVehicleName]]&lt;br /&gt;
*[[getVehicleNameFromModel]]&lt;br /&gt;
*[[getVehicleNitroCount]]&lt;br /&gt;
*[[getVehicleNitroLevel]]&lt;br /&gt;
*[[getVehicleOccupant]]&lt;br /&gt;
*[[getVehicleOccupants]]&lt;br /&gt;
*[[getVehicleCurrentGear]]&lt;br /&gt;
*[[getVehicleOverrideLights]]&lt;br /&gt;
*[[getVehiclePaintjob]]&lt;br /&gt;
*[[getVehiclePanelState]]&lt;br /&gt;
*[[getVehiclePlateText]]&lt;br /&gt;
*[[getVehicleSirens]]&lt;br /&gt;
*[[getVehicleSirensOn]]&lt;br /&gt;
*[[getVehicleSirenParams]]&lt;br /&gt;
*[[getVehicleTowedByVehicle]]&lt;br /&gt;
*[[getVehicleTowingVehicle]]&lt;br /&gt;
*[[getVehicleTurnVelocity]]&lt;br /&gt;
*[[getVehicleTurretPosition]]&lt;br /&gt;
*[[getVehicleType]]&lt;br /&gt;
*[[getVehicleUpgradeOnSlot]]&lt;br /&gt;
*[[getVehicleUpgrades]]&lt;br /&gt;
*[[getVehicleUpgradeSlotName]]&lt;br /&gt;
*[[getVehicleVariant]]&lt;br /&gt;
*[[getVehicleWheelStates]]&lt;br /&gt;
*[[isTrainChainEngine]]&lt;br /&gt;
*[[isTrainDerailable]]&lt;br /&gt;
*[[isTrainDerailed]]&lt;br /&gt;
*[[isVehicleBlown]]&lt;br /&gt;
*[[isVehicleDamageProof]]&lt;br /&gt;
*[[isVehicleFuelTankExplodable]]&lt;br /&gt;
*[[isVehicleLocked]]&lt;br /&gt;
*[[isVehicleNitroRecharging]]&lt;br /&gt;
*[[isVehicleNitroActivated]]&lt;br /&gt;
*[[isVehicleOnGround]]&lt;br /&gt;
*[[isVehicleTaxiLightOn]]&lt;br /&gt;
*[[removeVehicleUpgrade]]&lt;br /&gt;
*[[resetVehicleComponentPosition]]&lt;br /&gt;
*[[resetVehicleComponentRotation]]&lt;br /&gt;
*[[setHeliBladeCollisionsEnabled]]&lt;br /&gt;
*[[setHelicopterRotorSpeed]]&lt;br /&gt;
*[[setVehicleAdjustableProperty]]&lt;br /&gt;
*[[setVehicleColor]]&lt;br /&gt;
*[[setVehicleComponentPosition]]&lt;br /&gt;
*[[setVehicleComponentRotation]]&lt;br /&gt;
*[[setVehicleComponentVisible]]&lt;br /&gt;
*[[setVehicleDamageProof]]&lt;br /&gt;
*[[setVehicleDirtLevel]]&lt;br /&gt;
*[[setVehicleDoorOpenRatio]]&lt;br /&gt;
*[[setVehicleDoorState]]&lt;br /&gt;
*[[setVehicleDoorsUndamageable]]&lt;br /&gt;
*[[setVehicleEngineState]]&lt;br /&gt;
*[[setVehicleFuelTankExplodable]]&lt;br /&gt;
*[[setVehicleGravity]]&lt;br /&gt;
*[[setVehicleHeadLightColor]]&lt;br /&gt;
*[[setVehicleLandingGearDown]]&lt;br /&gt;
*[[setVehicleLightState]]&lt;br /&gt;
*[[setVehicleLocked]]&lt;br /&gt;
*[[setVehicleNitroActivated]]&lt;br /&gt;
*[[setVehicleNitroCount]]&lt;br /&gt;
*[[setVehicleNitroLevel]]&lt;br /&gt;
*[[setVehicleOverrideLights]]&lt;br /&gt;
*[[setVehiclePaintjob]]&lt;br /&gt;
*[[setVehiclePanelState]]&lt;br /&gt;
*[[setVehiclePlateText]]&lt;br /&gt;
*[[setVehicleSirens]]&lt;br /&gt;
*[[setVehicleSirensOn]]&lt;br /&gt;
*[[setVehicleTurretPosition]]&lt;br /&gt;
*[[setVehicleTaxiLightOn]]&lt;br /&gt;
*[[setVehicleTurnVelocity]]&lt;br /&gt;
*[[setVehicleWheelStates]]&lt;br /&gt;
*[[setTrainDerailable]]&lt;br /&gt;
*[[setTrainDerailed]]&lt;br /&gt;
*[[setTrainDirection]]&lt;br /&gt;
*[[setTrainSpeed]]&lt;br /&gt;
{{New items|3.0151|1.6|&lt;br /&gt;
*[[isVehicleWindowOpen]]&lt;br /&gt;
*[[getTrainTrack]]&lt;br /&gt;
*[[setTrainTrack]]&lt;br /&gt;
|}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleWindowOpen&amp;diff=45930</id>
		<title>IsVehicleWindowOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleWindowOpen&amp;diff=45930"/>
		<updated>2015-09-11T21:31:15Z</updated>

		<summary type="html">&lt;p&gt;Emiliano Castro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.6|7405|This function gets the vehicle window state.}}&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 isVehicleWindowOpen ( vehicle theVehicle, int window )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required arguments ===&lt;br /&gt;
* '''theVehicle:''' The vehicle that you wish to get the window state.&lt;br /&gt;
* '''window:''' An [[int|integer]] representing a vehicle window. It can be:&lt;br /&gt;
** '''0:''' motorbike shield&lt;br /&gt;
** '''1:''' rear window&lt;br /&gt;
** '''2:''' right front window&lt;br /&gt;
** '''3:''' right back window&lt;br /&gt;
** '''4:''' left front (driver) window&lt;br /&gt;
** '''5:''' left back window&lt;br /&gt;
** '''6:''' windshield&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
This function returns a boolean which represents window open state.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
With this example, you can use /Window_vehicle to open, or close if it is open, the window of the local player's current seat.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table = { 4, 2, 5, 3 }&lt;br /&gt;
&lt;br /&gt;
addCommandHandler (&amp;quot;Window_vehicle&amp;quot;, function (  )&lt;br /&gt;
  if ( isPedInVehicle ( localPlayer ) ) then&lt;br /&gt;
 local vehicle = getPedOccupiedVehicle( localPlayer ) &lt;br /&gt;
 local window = getPedOccupiedVehicleSeat( localPlayer )&lt;br /&gt;
 setVehicleWindowOpen( vehicle, table[window], not isVehicleWindowOpen( vehicle, table[window] ) )&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;
{{Client vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Emiliano Castro</name></author>
	</entry>
</feed>