Revision as of 12:43, 26 April 2013

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 "elements". It is written in XML, which is based on HTML and is the parent of XHTML.

Tags

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:

<info /> Information about this resource, possible parameters include (any arbitrary parameters can be used and read using getResourceInfo):

author: The author of this resource

version: The version of this resource

name: The name of this resource

description: A brief description of this resource

type: The type of this resource, that can be "gamemode", "script", "map" or "misc".

<script /> Source code for this resource, possible parameters are:

src: The file name of the source code

type: The type of source code: "client" or "server"

cache: When the script file type is "client", this setting controls whether the file is saved on the players hard drive. Default is "true". Using "false" will mean the file is not saved.

<map /> The map for a gamemode, possible parameters are:

src: .map file name (can be path too eg. "maps/filename.map")

dimension: Dimension in which the map will be loaded (optional)

<file /> 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)

src: client-side file name (can be path too eg. "images/image.png")

download: Whether or not to be sent to the client automatically (optional). Default is "true". Using "false" will mean they are not sent on resource start but could later be used by downloadFile (from version 1.4)

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)

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)

<settings> <setting name="" value=""/> </settings>: 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.

<min_mta_version /> 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 "1.5.6"). See example for example.

<sync_map_element_data /> Controls whether map element data such as "PosX" and "DoubleSided" 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.