<?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=Diki</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=Diki"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Diki"/>
	<updated>2026-06-02T07:50:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Meta.xml&amp;diff=49947</id>
		<title>Meta.xml</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Meta.xml&amp;diff=49947"/>
		<updated>2016-12-21T07:30:02Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* Example */&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;
** '''gamemodes:''' The gamemodes to be compatible with the resource. It must be the name of the gamemode resource, not the gamemode name. If you want it to be compatible with multiple gamemodes, it must be in a comma-separated list without spaces. (e.g. gamemodes=&amp;quot;test1,test2&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;
&amp;lt;!--&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;gt;&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:syntaxhighlight |&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info author=&amp;quot;Slothman&amp;quot; type=&amp;quot;ROLEPLAY&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;cgamemodelient&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;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;camera.png&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>Diki</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IT/Resource:Admin&amp;diff=49946</id>
		<title>IT/Resource:Admin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IT/Resource:Admin&amp;diff=49946"/>
		<updated>2016-12-21T07:24:25Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* Login */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{IT/Risorsa}}&lt;br /&gt;
[[Category:IT/Concetti di scripting]]&lt;br /&gt;
{{IT/MainP}}&lt;br /&gt;
Un breve tutorial su come ottenere i privilegi da admin ed installare la resource '''admin''' sul proprio server.&lt;br /&gt;
&lt;br /&gt;
'''Nota:''' Il server non dovrebbe essere avviato durante le operazioni sottostanti.&lt;br /&gt;
&lt;br /&gt;
==accounts.xml==&lt;br /&gt;
Per prima cosa apri il file '''accounts.xml''' dislocato in '''&amp;lt;SERVER&amp;gt;\mods\deathmatch\''' ed aggiungi un nodo con le informazioni del tuo account, come nell'esempio.&lt;br /&gt;
[[Image:admin_accounts.png|thumb|none|420x115px|Esempio 1: accounts.xml]]&lt;br /&gt;
&lt;br /&gt;
==acl.xml==&lt;br /&gt;
Poi apri il file '''acl.xml''', nella stessa cartella, e aggiungiti come oggetto al gruppo Admin usando la sintassi ''user.*'', dove ''*'' è il tuo Nickname come nell'esempio.&lt;br /&gt;
[[Image:admin_acl.png|thumb|none|420x157px|Esempio 2: acl.xml]]&lt;br /&gt;
&lt;br /&gt;
==mtaserver.conf==&lt;br /&gt;
Adesso apri il file '''mtaserver.conf''' e vai fino in fondo, accertati che la resource '''admin''' sia presente nella lista di quelle che vengono avviate con il server.&lt;br /&gt;
'''Nota:''' L'attributo '''protected=&amp;quot;1&amp;quot;''' indica che la risorsa non può essere fermata.&lt;br /&gt;
[[Image:admin_mtaserver.png|thumb|none|420x60px|Esempio 3: mtaserver.conf]]&lt;br /&gt;
&lt;br /&gt;
==Login==&lt;br /&gt;
Server By Om Diki Oii &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;/login [username] &amp;lt;password&amp;gt;&amp;lt;/syntaxhighlight&amp;gt; (rimuovi lo slash iniziale se esegui il comando da console). Se ti viene richiesto di premere il tasto '''p''' hai fatto tutto correttamente, congratulazioni!&lt;br /&gt;
&lt;br /&gt;
[[en:Resource:Admin]]&lt;/div&gt;</summary>
		<author><name>Diki</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Mapmanager&amp;diff=49945</id>
		<title>Resource:Mapmanager</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Mapmanager&amp;diff=49945"/>
		<updated>2016-12-21T07:21:36Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* A simple tutorial */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
The map manager is a resource included in the MTA DM server suite. It offers commands, functions and events for the gamemodes to dynamically manage their maps. For example, when a race server needs to load different tracks for each race, instead of having all of them in the same resource as the main script, they can be stored in separate resources and then loaded simply with the &amp;quot;changeGamemodeMap&amp;quot; function when a new race starts. &lt;br /&gt;
&lt;br /&gt;
Specifically, the map manager lists gamemodes/maps and manages gamemode/map loading. It applies certain map settings affecting the game world and sets ASE game type and map name rule values as well. It includes a web listing which auto updates and highlights the current mode/map combination.&lt;br /&gt;
&lt;br /&gt;
==A simple tutorial==&lt;br /&gt;
In this section we are going to continue the basic gamemode we created in the [[ROLEPLAY|ROLEPLAY]]. We will add a simple map resource that only contains the spawnpoint data for the players, and load the data in the main script when the player needs to spawn.&lt;br /&gt;
&lt;br /&gt;
First of all, we make a folder under /Your MTA Server/mods/deathmatch/resources/, and name it &amp;quot;mymap&amp;quot;. Then under /mymap/ directory, create a text file and name it &amp;quot;meta.xml&amp;quot;, which is required for every resource.&lt;br /&gt;
&lt;br /&gt;
Enter the following codes in the ''meta.xml'' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;info type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;ROLEPLAY&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;map src=&amp;quot;mymap.map&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that this resource is &amp;quot;linked&amp;quot; to the main resource with the ''roleplay=&amp;quot;&amp;quot;'' tag, which contains the name of the main resource. In the ''map'' tag, it indicates the name of the .map file which contains the actual map data.&lt;br /&gt;
&lt;br /&gt;
Now let's create another text file under /mymap/ and name it &amp;quot;mymap.map&amp;quot;, and enter the following codes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map&amp;gt;&lt;br /&gt;
   &amp;lt;spawnpoint id=&amp;quot;spawnpoint1&amp;quot; posX=&amp;quot;1959.5487060547&amp;quot; posY=&amp;quot;-1714.4613037109&amp;quot; posZ=&amp;quot;18&amp;quot; rot=&amp;quot;63.350006103516&amp;quot; model=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that &amp;quot;spawnpoint&amp;quot; is the type of the element, used in [[getElementsByType]] function; likewise, &amp;quot;id&amp;quot; is used in [[getElementByID]] function. &lt;br /&gt;
&lt;br /&gt;
To load the map data, the main script needs access to the map resource itself. Now let's edit the script.lua file in &amp;quot;myserver&amp;quot; resource. Enter the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function loadMap(startedMap)&lt;br /&gt;
	mapRoot = getResourceRootElement(startedMap)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onGamemodeMapStart&amp;quot;, getRootElement(), loadMap)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Basically, the &amp;quot;onGamemodeMapStart&amp;quot; event gives us the handle of the map (&amp;quot;startedMap&amp;quot;), which we used to extract the handle of the resource containing the map (&amp;quot;mapRoot&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
With the resource handle, we can extract the spawnpoint information from it. Look at the joinHandler() function in script.lua, instead of specifying x, y and z, we can use the map data as the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	local spawn = getElementsByType(&amp;quot;spawnpoint&amp;quot;, mapRoot)&lt;br /&gt;
	local x,y,z,r&lt;br /&gt;
	for key, value in pairs(spawn) do&lt;br /&gt;
		x = getElementData(value, &amp;quot;posX&amp;quot;)&lt;br /&gt;
		y = getElementData(value, &amp;quot;posY&amp;quot;)&lt;br /&gt;
		z = getElementData(value, &amp;quot;posZ&amp;quot;)&lt;br /&gt;
		r = getElementData(value, &amp;quot;rot&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	spawnPlayer(source, x, y, z)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now you may start the gamemode in the server console with the following command:&lt;br /&gt;
&lt;br /&gt;
'''gamemode myserver mymap'''&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
To use the map manager, your resources must first be marked as either gamemodes or maps.&lt;br /&gt;
&lt;br /&gt;
You have to tag the '''gamemode resource''' with the correct type in its info tag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;info description=&amp;quot;A gamemode&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Map resources''' also need the ''type=&amp;quot;map&amp;quot;'' tag, plus a ''gamemodes'' tag listing the gamemode resources they're compatible with in a comma-separated list ''without spaces''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;info description=&amp;quot;A gamemode map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;ctv,koth&amp;quot; /&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There can be only one gamemode and one gamemode map loaded at once.&lt;br /&gt;
&lt;br /&gt;
==Optional resource attributes==&lt;br /&gt;
These attributes all go in the corresponding resource's info tag.&lt;br /&gt;
&lt;br /&gt;
'''name:''' A friendly name for your gamemode or map, to be displayed in the start messages or map listings instead of the filename.&lt;br /&gt;
&lt;br /&gt;
==Commands==&lt;br /&gt;
'''changemap newmap [newgamemode]''' (changes the gamemode map to a new one, optionally changing the gamemode as well)&lt;br /&gt;
&lt;br /&gt;
'''changemode newgamemode [newmap]''' (changes to a new gamemode, optionally starting a map with it)&lt;br /&gt;
&lt;br /&gt;
'''gamemode newgamemode [newmap]''' (same as previous one)&lt;br /&gt;
&lt;br /&gt;
'''stopmode''' (stops the current mode and mode map)&lt;br /&gt;
&lt;br /&gt;
'''stopmap''' (stops the current mode map)&lt;br /&gt;
&lt;br /&gt;
'''maps [gamemode]''' (lists all maps in the server, optionally all maps compatible with a gamemode)&lt;br /&gt;
&lt;br /&gt;
'''gamemodes''' (lists all gamemodes)&lt;br /&gt;
&lt;br /&gt;
==Settings==&lt;br /&gt;
'''*mapmanager.color''' [hex color string] (changes the mapmanager's output messages' color) (default: #E1AA5A)&lt;br /&gt;
&lt;br /&gt;
'''*mapmanager.messages''' [boolean] (whether map/gm changes are enabled) (default: true)&lt;br /&gt;
&lt;br /&gt;
'''*mapmanager.ASE''' [boolean] (whether the manager will set ASE gametype / mapname) (default: true)&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool changeGamemode ( resource newGamemode, [ resource mapToLoadWith ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Changes the gamemode to a new one, optionally specifying an initial map for it (will load without a map by default).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool changeGamemodeMap ( resource newMap, [ resource gamemodeToChangeTo ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Changes the GM map to a new one, optionally specifying a gamemode to change to before loading it (will load with the current gamemode by default).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getGamemodes ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns a table of all gamemode resource pointers.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getGamemodesCompatibleWithMap ( resource theMap )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns a table of compatible gamemode resource pointers.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getMaps ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns a table of all map resource pointers.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getMapsCompatibleWithGamemode ( [ resource theGamemode ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns a table of compatible map resource pointers. If the gamemode is left blank, it returns all maps which aren't compatible with any gamemode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;resource getRunningGamemode ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns the currently running gamemode's resource pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;resource getRunningGamemodeMap ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Returns the currently running GM map's resource pointer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isGamemode ( resource theGamemode )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Determines if a resource is a gamemode or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isGamemodeCompatibleWithMap ( resource theGamemode, resource theMap )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Determines if a gamemode is compatible with a map or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMap ( resource theMap )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Determines if a resource is a map or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isMapCompatibleWithGamemode ( resource theMap, resource theGamemode )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Determines if a map is compatible with a gamemode or not.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool stopGamemode ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Stops the current gamemode and its map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool stopGamemodeMap ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Stop the current GM map.&lt;br /&gt;
Determines if a map is compatible with a gamemode or not.&lt;br /&gt;
&lt;br /&gt;
==Fired events==&lt;br /&gt;
''(For all these events, &amp;quot;source&amp;quot; is the resource's root element.)''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onGamemodeStart ( resource startedGamemode )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Fired before a gamemode starts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onGamemodeStop ( resource stoppedGamemode )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Fired before a gamemode is stopped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onGamemodeMapStart ( resource startedMap )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Fired before a GM map starts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;onGamemodeMapStop ( resource stoppedMap )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Fired before a GM map is stopped.&lt;br /&gt;
&lt;br /&gt;
==Supported map settings==&lt;br /&gt;
The following settings from the [[settings system|registry]] are applied by the map manager when a map is started:&lt;br /&gt;
&amp;lt;br&amp;gt;'''gamespeed''' [number]: The map's game speed.&lt;br /&gt;
&amp;lt;br&amp;gt;'''gravity''' [number]: The map's gravity.&lt;br /&gt;
&amp;lt;br&amp;gt;'''time''' [string of the form '''hh:mm''']: The map's time.&lt;br /&gt;
&amp;lt;br&amp;gt;'''weather''' [number]: The map's weather ID.&lt;br /&gt;
&amp;lt;br&amp;gt;'''waveheight''' [number]: The map's wave height.&lt;br /&gt;
&amp;lt;br&amp;gt;'''locked_time''' [boolean]: Whether the set time will be frozen by the manager or not.&lt;br /&gt;
&amp;lt;br&amp;gt;'''minplayers''' [number]: The required minimum number of players to start the map.&lt;br /&gt;
&amp;lt;br&amp;gt;'''maxplayers''' [number]: The allowed maximum number of players to start the map.&lt;br /&gt;
&lt;br /&gt;
[[it:Map manager]]&lt;br /&gt;
[[ru:Resource:Mapmanager]]&lt;/div&gt;</summary>
		<author><name>Diki</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetServerName&amp;diff=49944</id>
		<title>GetServerName</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetServerName&amp;diff=49944"/>
		<updated>2016-12-21T07:18:20Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function retrieves the server's name.&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 getServerName ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
A string containing the server's name.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a console command that outputs the server's name to the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputServerName (Zone Gaming )&lt;br /&gt;
	outputChatBox ( getServerName( ) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Add console command 'getServerName'&lt;br /&gt;
addCommandHandler ( &amp;quot;getServerName&amp;quot;, outputServerName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>Diki</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OutputServerLog&amp;diff=49943</id>
		<title>OutputServerLog</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OutputServerLog&amp;diff=49943"/>
		<updated>2016-12-21T07:17:23Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This outputs a line of text to the server's log. This could be useful for debugging.&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 outputServerLog ( string text )              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''text:''' The text to be output to the log.&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 name=&amp;quot;Zone Gaming &amp;quot; class=&amp;quot;Zone Gaming&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
'''Example 1:''' This example outputs client logins to the server log.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function logClientLogin ( previous_account, current_account )&lt;br /&gt;
	outputServerLog ( &amp;quot;Client &amp;quot; .. getPlayerName ( source ) .. &amp;quot; logged in as &amp;quot; .. getAccountName ( current_account ) )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientLogin&amp;quot;, getRootElement(), logClientLogin )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example outputs the clients position to the server&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function outputPosition(source)&lt;br /&gt;
	local x,y,z = getElementPosition(source)&lt;br /&gt;
	outputServerLog(tostring(x) .. &amp;quot;,&amp;quot; .. tostring(y) .. &amp;quot;,&amp;quot; .. tostring(z))&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;op&amp;quot;,outputPosition)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server functions}}&lt;/div&gt;</summary>
		<author><name>Diki</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:See_also/Server_event&amp;diff=49942</id>
		<title>Template:See also/Server event</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:See_also/Server_event&amp;diff=49942"/>
		<updated>2016-12-21T07:13:11Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* {{{1}}} */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==See Also==&lt;br /&gt;
==={{{1}}}===&lt;br /&gt;
{{{{{1}}}}}&lt;br /&gt;
&lt;br /&gt;
===Event functions===&lt;br /&gt;
{{Event functions}}&lt;/div&gt;</summary>
		<author><name>Diki</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerJoin&amp;diff=49941</id>
		<title>OnPlayerJoin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerJoin&amp;diff=49941"/>
		<updated>2016-12-21T07:12:03Z</updated>

		<summary type="html">&lt;p&gt;Diki: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player joins the server.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The source of this event is the [[player]] who joined.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the joined client's name and sends him a welcome message including his name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- we register greetPlayer as a handler for the event&lt;br /&gt;
function greetPlayer ( )&lt;br /&gt;
	-- we store the player's name&lt;br /&gt;
	local joinedPlayerName = getPlayerName ( (INDONESIA)Zone Gaming Roleplay )&lt;br /&gt;
	local serverName = getServerName( )&lt;br /&gt;
	-- and send him a greeting&lt;br /&gt;
	outputChatBox ( &amp;quot;Welcome &amp;quot; .. Object&amp;quot;Weabadmin&amp;quot;&amp;gt;&amp;lt;VirusMTASA .. &amp;quot; to &amp;quot;.. (INDONESIA)Zone Gaming Roleplay ..&amp;quot;!&amp;quot; , source, 255, 255, 255 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), greetPlayer )&lt;br /&gt;
&amp;lt;/1&amp;gt;&lt;br /&gt;
This example sets random color to every player who joins.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create a table to save the color&lt;br /&gt;
ChatColors = {1}&lt;br /&gt;
&lt;br /&gt;
-- sets colors when player join&lt;br /&gt;
function onJoin (2)&lt;br /&gt;
        -- create a table to add rgb values. Index will be the player element&lt;br /&gt;
	ChatColors[source] = {math.random (50, 255), math.random (50, 255), math.random (50, 255)}&lt;br /&gt;
end&lt;br /&gt;
-- checks if player has sent a message&lt;br /&gt;
function onChat ( message, messageType )&lt;br /&gt;
	if messageType == 0 then&lt;br /&gt;
                -- use the table to get the saved rgb values&lt;br /&gt;
		outputChatBox ( getPlayerName ( source ) .. &amp;quot;: #E0D0B0&amp;quot; .. message, getRootElement(), ChatColors[source][1], ChatColors[source][2], ChatColors[source][3], true )&lt;br /&gt;
		cancelEvent()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), onJoin)&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerChat&amp;quot;, getRootElement(), onChat )&lt;br /&gt;
&amp;lt;3&amp;gt;&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 rediercts any player joins to the server automatically to any other server, add the script for admin group.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function Redirect()&lt;br /&gt;
redirectPlayer (source, &amp;quot;server ip&amp;quot;, &amp;quot;server port&amp;quot;)&lt;br /&gt;
end    --End function&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), Redirect)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Diki</name></author>
	</entry>
</feed>