Running a SA-MP or open.mp server

Installing SA-MP or open.mp on Linux, the server.cfg keys that matter, gamemodes, filterscripts, plugins, listing, and RCON safety.

Game servers10 min read

On this page
  1. SA-MP and open.mp
  2. Installing on Linux
  3. server.cfg and its keys
  4. Gamemodes and filterscripts
  5. Plugins
  6. How your server gets listed
  7. The RCON password
  8. Related

SA-MP (San Andreas Multiplayer) and open.mp (open multiplayer) both run multiplayer servers for GTA San Andreas, and they run the same content: the same compiled Pawn gamemodes, the same filterscripts, the same plugins. If you know one, you know most of the other.

The short version of the difference: SA-MP is the original and is no longer developed, open.mp is an open-source server built to be compatible with it and is where the work is happening now. Start new servers on open.mp.

SA-MP and open.mp

SA-MP is closed source, its last release is 0.3.7, and nothing has shipped for it in years. Its Linux server binary is samp03svr, and its settings live in a flat text file called server.cfg.

open.mp is a reimplementation of the server. It is open source, it accepts existing SA-MP clients, and it loads existing SA-MP gamemodes, filterscripts, and plugins. Its Linux binary is omp-server, and its settings live in config.json. Releases are published on its GitHub releases page.

Moving an existing server across is mostly a matter of dropping the new binary into a copy of the old directory: gamemodes/, filterscripts/, plugins/, and scriptfiles/ carry over as they are. open.mp understands the legacy server.cfg well enough to start from it and write out the equivalent config.json, so do this on a copy first, start it once, and read what it produced. That generated file is the authoritative list of settings for the version you are running, which is why this page describes server.cfg keys in full and then points you at the file rather than reproducing a JSON key list that may not match your build.

SA-MPsamp03svrClosed source, lastrelease 0.3.7.Settings inserver.cfg.open.mpomp-serverOpen source, stilldeveloped. Settingsin config.json.server.cfgconfig.jsonopen.mp writes it on its first startThe same on both, carried over as it isgamemodes/filterscripts/plugins/scriptfiles/SA-MP clients
Two servers, one body of content. The binary and the settings file differ, and open.mp writes its config.json from a legacy server.cfg; the gamemodes, filterscripts, plugins and scriptfiles move across as they are. Illustration.

Installing on Linux

Both servers are 32-bit binaries. That is deliberate rather than an oversight: SA-MP plugins are 32-bit native code, and the server has to match them. On a 64-bit distro you therefore need the 32-bit C and C++ runtimes.

  1. Install the 32-bit runtime

    On Debian and Ubuntu:

    Shell
    sudo dpkg --add-architecture i386
    sudo apt update
    sudo apt install -y curl tar ca-certificates lib32gcc-s1 lib32stdc++6

    On RHEL, AlmaLinux, and Rocky:

    Shell
    sudo dnf install -y curl tar glibc.i686 libstdc++.i686

    If you skip this, the server fails to start with a message saying the file does not exist, about a file that is plainly there. That is what a missing 32-bit loader looks like, and it is the single most common first-run problem.

  2. Create a user for the server

    Never run a game server as root. A Pawn gamemode can write files through plugins, and it will do so with whatever rights the server process has.

    Shell
    sudo useradd -m -d /home/samp -s /bin/bash samp
    sudo -u samp -i
  3. Unpack the server

    Download the Linux archive for your chosen server into the account's home directory, then extract it:

    Shell
    mkdir -p ~/server && cd ~/server
    tar -xzf ~/open.mp-*.tar.gz
    chmod +x ./omp-server

    A SA-MP package contains samp03svr, an announce helper, a sample server.cfg, and the gamemodes/, filterscripts/, plugins/, and scriptfiles/ directories. An open.mp package has the same shape with omp-server in place of samp03svr.

    Confirm the architecture before you go further, since it decides which runtime packages you needed above:

    Shell
    file omp-server

    ELF 32-bit in the answer means the i386 libraries are the right ones.

  4. Set the RCON password before the first start

    Change the remote console password away from its shipped value now, not later. The reason is in the last section of this page.

    On SA-MP that is rcon_password in server.cfg. On open.mp there is no server.cfg in a fresh download: set the RCON password in config.json, or in the server.cfg you brought across from an existing SA-MP install before you convert it.

    Either way the password sits in that file in plain text, so restrict it to the server's own account. On open.mp:

    Shell
    chmod 600 config.json

    On SA-MP the same, against server.cfg.

  5. Run it in the foreground once

    Shell
    ./omp-server

    Read the whole output. This first run tells you three things at once: whether the 32-bit runtime is in place, whether every plugin loaded, and whether your gamemode was found and started. Fix anything it complains about before you put it behind a service unit, because the log is much harder to read once the server is restarting itself.

  6. Check what it bound

    Shell
    sudo ss -lunp | grep -E 'omp-server|samp03svr'

    You should see exactly one UDP socket, on your game port. There is no second port to find, which is covered below.

server.cfg and its keys

server.cfg is one setting per line, a key and its value separated by a space, no quotes and no sections. A line starting with echo prints text to the log, which is what the shipped first line does.

KeyWhat it does
hostnameThe server name shown in the browser.
portThe UDP port. 7777 by default. Game traffic and queries both use it.
bindWhich local address to listen on. Leave it unset to listen on all of them.
maxplayersSlot count.
passwordA password players must enter to join. Empty means public. This is not the RCON password.
rcon_passwordThe remote console password. Change it before the first start.
rconTurns the remote console on or off.
gamemode0The gamemode to load, by filename without .amx, followed by how many times it runs before the rotation advances. gamemode0 grandlarc 1. Add gamemode1 and upwards for a rotation.
filterscriptsSpace-separated list of filterscript names, without .amx.
pluginsSpace-separated list of plugin files loaded from plugins/. .so files on Linux, .dll on Windows.
announceWhether to announce this server to the master list so it appears in the browser.
queryWhether the server answers queries at all. 0 hides it from the browser and from every stats site.
lanmodeRestricts the server to a local network. 0 for anything on the internet.
weburlA website address shown alongside the server in the browser.
maxnpcHow many NPC slots are allowed.
languageThe language string shown in the listing.
logtimeformatTimestamp format for server_log.txt.
onfoot_rate, incar_rate, weapon_rateHow often, in milliseconds, the server syncs players on foot, in vehicles, and firing. Lower is smoother and costs more bandwidth and CPU on both ends.
stream_distanceHow far away, in game units, objects and players are streamed in to a client.
stream_rateHow often, in milliseconds, streaming is recalculated.

The sync and streaming values are the ones people change without measuring. Halving onfoot_rate roughly doubles the outbound traffic for player sync, and on a full server that is a real number. Change one, watch your bandwidth and your server's CPU, then decide.

On open.mp the same settings live in config.json, grouped rather than flat. Start the server once and read the file it writes: every setting is present with its default, so the file is a better reference than any list, and it matches the build you actually have.

Gamemodes and filterscripts

A gamemode is the server. It defines spawns, classes, money, jobs, vehicles, the lot. Exactly one runs at a time, named in gamemode0. Public gamemodes exist for roleplay, freeroam, racing, and deathmatch, and most established servers run something heavily modified.

A filterscript is a smaller script that runs alongside the gamemode and can be loaded and unloaded while the server is running. That is the whole point of them: an admin system, a mapping, or a mini-game can be reloaded without dropping every player. They are listed in filterscripts.

Both are written in Pawn, compiled from .pwn source to .amx bytecode. The server loads .amx only, so the compiler is part of your workflow, not an optional extra. Gamemodes go in gamemodes/, filterscripts in filterscripts/, and names in the config carry no file extension.

Anything a script saves at runtime, bans, accounts, logs, ends up in scriptfiles/. Back that directory up along with your database. It is small, and it is the part that is not reproducible.

From the remote console you can load and unload a filterscript by name with loadfs and unloadfs, and restart the gamemode with gmx. A gmx reconnects every player, so it is a restart from their point of view, not a reload.

Plugins

Plugins are native code that give Pawn abilities the language does not have on its own: database access, an entity streamer that raises the engine's limits on objects and pickups, sockets, and so on. They are loaded from plugins/ and listed in the plugins key.

Three things to know:

  • A plugin must be built for the same architecture as the server, which means 32-bit, and for the same platform, which means .so on Linux. A Windows .dll will not load, and neither will a 64-bit build.
  • Plugins load before the gamemode. If one fails, you see it in server_log.txt at the top of the run, and the gamemode may then fail with confusing errors about missing functions. Always read the log from the first line, not the last.
  • A plugin runs inside the server process with the full rights of the user the server runs as. Take them from their own project, not from a forum attachment, and this is another reason the server does not run as root.

How your server gets listed

This is where SA-MP differs from most modern game servers, and it works in your favour.

There is no separate query port. The game traffic and the query protocol that answers "what is your name, how many players do you have, what is your ping" share the same UDP socket on the same port. Open UDP 7777, or whatever you set port to, and you have opened everything. Add the rule under Port rules.

Two separate things have to be true for a player to find you:

  1. The server announces itself to a master list, controlled by announce. The master list is what fills the browser with addresses. SA-MP and open.mp each run their own, so which list your server appears on depends on which server you run, and which browser your players use decides which list they see.
  2. The server answers queries, controlled by query. Having got an address from the list, the browser asks the server directly for its name, its player count, and its ping, and it is that reply that fills the row.

Because they are separate, the symptoms tell you which one is wrong. A server that never appears in the browser at all has an announce problem. A server that appears but shows as offline, or with no player count, is answering the master list but not the queries: either query is off, or something between the internet and the server is dropping the query packets while letting game packets through.

Your serverGame and querieson one port, UDP7777Master listSA-MP and open.mpeach run theirownA player's browserFills each rowfrom the server'sreplyannounceAddressesqueryNever in the browserAn announce problem.Listed, but offline or with no player countquery is off, or query packets are dropped whilegame packets get through.
Listing takes two separate exchanges. Announce puts your address on the master list; query is the browser asking your server directly, on the game port, for the details in its row. Which one fails decides the symptom. Illustration.

The RCON password

RCON is complete control of the running server. Anyone holding the password can kick and ban any player, load and unload filterscripts, restart the gamemode, shut the server down, and run whatever administrative commands your gamemode has registered. Many gamemodes wire their in-game admin powers to RCON login, so in practice the RCON password is also the highest admin account in your game.

Treat it accordingly:

  • Make it long and random, and use it nowhere else. The password travels over the same UDP channel as the game, without encryption, so assume it can be observed and that it can be guessed at speed.
  • Rotate it when someone with access leaves. There is no per-person RCON account to revoke, there is one password, and everyone who has ever had it still has it.
  • Keep the file readable only by the server user. server.cfg on SA-MP and config.json on open.mp both hold the password in plain text, so set the mode to 600 and check the ownership. Anything else with a shell on the machine, including a badly configured web panel, can otherwise read it.
  • Watch the log. Failed RCON logins are recorded in server_log.txt with the address that tried. On a public server there will be a steady stream of them, which is normal. What matters is spotting a success you did not expect, so know what your own logins look like.
  • Turn it off if you do not use it. If you administer entirely in game, the rcon key removes the surface completely. Test that your admin path still works before you rely on that.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.