# Resource structure

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

- **Platform**: MY Multiplayer (MYMP) — Lua 5.4
- **Sections**: Documentation › Getting started
- **Language**: English
- **URL**: https://wiki.mymp.gg/en/docs/resources

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](https://wiki.mymp.gg/en/docs/server-config.md).

## Folder layout

```text
resources/
└── shop/
    ├── meta.xml
    ├── server/main.lua
    ├── client/ui.lua
    ├── images/logo.png
    └── modules/          see "Modules and import"
```

## 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.

```xml
<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](https://wiki.mymp.gg/en/docs/globals.md). `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](https://wiki.mymp.gg/en/docs/modules.md).
- To configure which resources start with the server, see [server.cfg](https://wiki.mymp.gg/en/docs/server-config.md).
