# How to Add Resources and Scripts to a GTA Connected Server

Add a resource to a GTA Connected server: the resources folder, meta.xml with Lua, JavaScript or Squirrel scripts, the server.xml entry and live start commands.

Updated 2026-10-07. https://gamezservers.com/guides/how-to-add-resources-to-a-gta-connected-server

To add a resource to a GTA Connected server, put its folder inside the server's `resources` folder, make sure the folder contains a valid `meta.xml`, then add `<resource src="foldername" />` to the `<resources>` block in `server.xml` and restart. You can also start it without a restart by typing `start foldername` in the server console. A resource without a `meta.xml`, or one that is not listed in `server.xml`, never loads, and those two mistakes cause most "my script does nothing" questions.

Resources are how a GTAC server becomes anything other than plain freeroam: a deathmatch mode, a race system, a roleplay framework or a single admin command. This guide covers how they are built, how to install someone else's, and how to write a tiny one of your own.

![Cars on a GTA San Andreas street](https://gamezservers.com/games/sa-mp/shot-2.webp)

## What a resource is

A resource is a folder (or a tar archive) in `resources/` that holds scripts and any files they need: images, audio, maps or extra data. Several resources can run at once and they can depend on each other. A typical layout:

```
resources/
  freeroam/
    meta.xml
    ...
  myadmin/
    meta.xml
    server.js
    client.js
```

The server ships with `freeroam`, which is why a fresh server already lets players spawn and drive around.

## The meta.xml file

Every resource needs a `meta.xml` in its root. It tells the server what the resource is and which scripts to run where. The full set of node types from the official wiki:

```xml
<meta>
  <info author="" type="" version="" description="" />
  <script src="" type="" language="" />
  <dependency src="" />
  <map src="" type="" />
  <file src="" type="" />
</meta>
```

| Node | Purpose |
| --- | --- |
| `info` | Author, type, version and description |
| `script` | A script file, where it runs and in which language |
| `dependency` | Another resource that must load first |
| `map` | A map file for the resource |
| `file` | Any other file, for the client or the server |

On a `script` node:

- `src` is the path to the file, relative to the resource folder.
- `type` is `server` for code that runs on the server, or `client` for code that downloads to and runs on each player's game.
- `language` is `lua`, `javascript` or `squirrel`. You can mix languages inside one resource.

## Installing a resource someone else wrote

Community resources come from the GTA Connected forum and GitHub. The steps are the same for all of them:

1. **Check the game.** A resource written for GTA IV usually calls functions or models that do not exist in Vice City. Read its description first.
2. **Upload the folder** into `resources/` with SFTP or your file manager. The folder name is the resource name, so keep it short with no spaces.
3. **Open its meta.xml** and confirm it is at the top of the folder, not one level down (a common result of unzipping a GitHub download, which creates `resources/thing-main/thing/meta.xml`).
4. **Check dependencies.** If `meta.xml` has `dependency` lines, those resources must also be in the folder.
5. **Add it to server.xml:**

```xml
<resources>
  <resource src="freeroam" />
  <resource src="myadmin" />
</resources>
```

6. **Restart the server** and read the console. A broken script prints its error and line number while the resource loads.

## Starting, stopping and reloading without a restart

The server console accepts resource commands, so you can test changes while players stay connected:

| Command | What it does |
| --- | --- |
| `start name` | Starts a resource |
| `stop name` | Stops it |
| `restart name` | Stops and starts it again |
| `refresh name` | Reloads it |

Use these while developing. Once a resource works, make sure it is in `server.xml`, because anything started by hand is gone after the next server restart.

## Writing a tiny resource

A minimal server side JavaScript resource. Create `resources/hello/meta.xml`:

```xml
<meta>
  <info author="you" type="script" version="1.0.0" description="Hello command" />
  <script src="server.js" type="server" language="javascript" />
</meta>
```

Then `resources/hello/server.js`:

```javascript
addCommandHandler('hello', function(command, text, client)
{
    console.log(client.name + ' said hello');
});
```

Run `start hello` in the console, type `/hello` in game, and the line appears in the server console. On the server side, command handlers receive the command, the text after it and the client who typed it. The [GTA Connected wiki](https://wiki.gtaconnected.com/) lists every function and event per game.

![The GTA San Andreas city skyline](https://gamezservers.com/games/sa-mp/cover.jpg)

## How client files reach players

Client scripts and `file` entries download to players when they join. GTAC serves them through its built in HTTP server on `httpport` (22000 by default, TCP). If that port is blocked, players hang while downloading resources. For a busy server you can set `httpurl` in `server.xml` to a web host or CDN that holds the same files, which takes the load off the game server.

Script files themselves are sent over the game connection and are not cached on the player's side, so client code stays fresh after every change.

## Common problems

| Symptom | Fix |
| --- | --- |
| Resource never appears in the console | Not listed in `server.xml`, or the folder name does not match `src` |
| "meta.xml not found" style errors | The folder is nested one level too deep |
| Script errors about missing functions | The resource was written for a different GTA |
| Players stuck loading resources | TCP on `httpport` is closed |
| Works after `start`, gone after restart | Add it to `server.xml` |

If players cannot reach the server at all, that is a different problem: see our [GTA Connected connection fix guide](https://gamezservers.com/guides/gta-connected-cant-connect-to-server).

## Doing this on a hosted server

On a [GamezServers GTA Connected server](https://gamezservers.com/games/grand-theft-auto-connected), the `resources` folder and `server.xml` are in the file manager, and SFTP makes uploading a whole resource folder one drag. The live console accepts `start`, `stop` and `restart`, so you can test a script without kicking anyone, and both ports are already open, which removes the stuck download problem. Take a one click backup before you install a big roleplay framework, so you can roll back if it breaks your setup. New to GTAC? Start with our [GTA Connected setup guide](https://gamezservers.com/guides/how-to-host-a-gta-connected-server).

## FAQ

### Which scripting languages does GTA Connected support?

Lua, JavaScript and Squirrel. Set the `language` attribute on each `script` node in `meta.xml`.

### Do I need to restart the server to add a resource?

No. Type `start name` in the console to run it right away. Add it to `server.xml` too, or it will not start after the next restart.

### Where do client scripts go?

In the same resource folder, listed in `meta.xml` with `type="client"`. Players download them when they join.

### Can I use SA-MP Pawn scripts on GTA Connected?

No. GTAC resources are Lua, JavaScript or Squirrel. Pawn gamemodes need SA-MP or open.mp.
