M MY Multiplayer: Wiki

Resource structure

Folder layout of a MY Multiplayer (MYMP) resource, meta.xml manifest syntax, supported tags and file glob patterns.

In MY Multiplayer (MYMP), a resource is a folder inside the server's resources/ directory containing a meta.xml manifest. The server loads and starts the resources requested with ensure in server.cfg.

Folder layout

main.lua
meta.xml

The meta.xml manifest

meta.xml declares a resource's metadata, server and client scripts, client-side asset files, exported functions, maps, custom models and dependencies.

<meta>
    <!-- About the resource -->
    <info name="Shop" author="MYMP" version="1.0.0" />

    <!-- Scripts -->
    <script src="server/*.lua" type="server" />
    <script src="client/**/*.lua" type="client" />

    <!-- Files sent to the clients -->
    <file src="images/*.png" />

    <!-- Functions other resources call -->
    <export function="getPrice" type="server" />

    <!-- Resources started before this one -->
    <include resource="accounts" />
</meta>

Supported meta.xml tags

Tag Description
<info> Stores arbitrary metadata attributes (such as name, author, version), read by getResourceInfo.
<script src type> Declares a Lua script. type is server (the default), client or shared.
<file src> Declares a static asset sent to clients (images, fonts, sounds, etc.).
<export function type> Exposes a function other resources call via exports. type works as in <script>.
<include resource> Starts another resource before this one. If that resource is missing, this one does not start.
<map src> Loads a map file with the resource.
<dlc src> Loads a content pack (DLC).
<model name type file col parent> Registers a new model; type is object, vehicle, ped or weapon.
<ui src> Sets the resource's web interface (NUI) HTML page.
<download_priority_group> Controls the download order between resources.

Path patterns in src

The src attribute in <script> and <file> accepts glob patterns such as *.lua and **/*.lua. Matching files are loaded in alphabetical order, skipping any files already listed by an earlier entry in the same meta.xml. A pattern that matches nothing is logged.

Next steps

  • To split a resource's code into reusable modules without listing them in meta.xml, see Modules and import.
  • To configure which resources start with the server, see server.cfg.