meta.xml

From GTA Network Wiki
Jump to: navigation, search

meta.xml

Every resource must have this file. It defines information about the resource.

Tags

Tag Value Type Description
<info> Basic information about this resource. All of these are optional. These parameters can be retrieved from any resource.
name String Full name of the resource.
description String A brief description of your resource.
author String Name of the resource author(s).
version String Resource version.
type 'script' or 'gamemode' or 'map' What type of resource it is.
gamemodes Comma delimited list of compatible gamemodes. Only used if the resource is a map.
async bool Whether the resource should run in a single thread or run asynchroniously.
shadowcopy bool Whether compiled .dll files should be loaded in from the filesystem, or copied first. Set this to true to be able to update .dll files while debugging resources.
NOTE: when using shadowcopy, the system may fail to load dependant .dll's, as it no longer knows the original directory of the loaded assembly.
<script> Links a script file with your resource.
src Path Relative path to your file.
lang 'javascript' or 'csharp' or 'vbasic' or 'compiled' Represents the language used in the script.
<file> Represents a file that must be downloaded to the client.
src Path Relative path to your file.
<assembly> Declares a .NET reference to be used for your scripts.
ref Path Relative path to your assembly
<include> List of resources that this resource depends on, and must be started before this one.
resource String Name of the resource.
<map> Represents a .map file
src Path Relative path to your .map file
dimension UInt The dimension in which your map will be loaded.
<export> Used to export functions or events for other resources to use. You can only export methods located inside classes that inherit Script.
class String The class name in which this function or event is found. (Optional if you only have one class)
function String Name of the function to export.
event String Name of the event to export.
<acl> Additional rules to add to server's ACL. These may include commands that you dont wish everyone to have access to.
src Path Relative path to the acl.xml file.
<config> Represents a custom XML config file to be loaded by a resource with API.LoadConfig
src Path Relative path to your config file.
<settings> Declares a list of settings that the server administrator can easily change. You can also put these in a separate file, and then reference it with the src attribute.
<setting> Represents each setting.
name Name of the setting, which will be used to retrieve it in scripts.
value Value of the setting.
default If the value cannot be found, or if it's invalid, this one will be used.
description brief setting description for the server administrator.

Example

This meta.xml file is a mix of various meta.xml files found in the example resources.

<meta>
    <info name="Door Manager" description="Helper resource to control the game's doors." author="Guadmaz" version="1.0" shadowcopy="true" />

    <script src="doormanager.cs" type="server" lang="csharp" />

    <export function="registerDoor" class="DoorManager" />
    <export function="removeDoor" class="DoorManager" />
    <export function="setDoorState" class="DoorManager" />
    <export function="getCloseDoor" class="DoorManager" />
    <export function="getAllCloseDoors" class="DoorManager" />
    <export function="refreshDoorState" class="DoorManager" />
    <export function="transitionDoor" class="DoorManager" />

    <export function="setDebug" class="DoorManager" />

    <file src="skeletor.png" />

    <assembly ref="System.Xml.Serialization.dll" />
    <assembly ref="System.Xml.dll" />

    <include resource="scoreboard" />

    <settings>
        <setting name="votelength" value="60000" default="60000" description="Vote length in milliseconds" />
        <setting name="votecooldown" value="60000" default="60000" description="Cool down between votes." />

        <setting name="enablevotemap" value="true" default="true" description="Sets whether /votemap command is enabled." />
        <setting name="enablevotekick" value="true" default="true" description="Sets whether /votekick command is enabled." />
    </settings>
</meta>