How to install gamemodes and filterscripts on SA-MP — complete guide

Learn how to install gamemodes (.amx) and filterscripts on your SA-MP server, configure server.cfg, compile Pawn, and fix the most common load errors.

Customizing a SA-MP (San Andreas Multiplayer) server starts with picking and installing the gamemode — the main script that defines the game mode — and the filterscripts, which add modular features like admin commands, anti-cheat, or special events. Without this part configured correctly, the server boots empty (running the default grandlarc) or simply shuts down right after the boot.

This tutorial covers the full workflow: organizing the folder structure, compiling .pwn files into .amx, editing server.cfg correctly, loading required plugins, and diagnosing the errors that show up in server_log.txt. It’s aimed at server owners who already have SA-MP installed and want to deploy a custom gamemode.

Estimated time: 25–40 minutes, depending on whether you need to compile from scratch or use pre-compiled .amx files.

Prerequisites

Before you start

You need a SA-MP 0.3.7 or 0.3.DL server already installed, with access to the filesystem (FTP, SFTP, or web panel) and permission to edit server.cfg and restart the server. Have the gamemode package ready (.pwn, .amx, includes, plugins).

Root folder /samp03/
Gamemodes gamemodes/
Filterscripts filterscripts/
Config server.cfg

Basic knowledge of Pawn helps you read compilation errors, but it’s not required if you’re going to use already-compiled .amx gamemodes.

SA-MP folder structure

Before copying any file, it’s worth understanding where each thing lives. The server’s root folder (samp03 on Linux, usually samp-server on Windows) has a fixed structure that the executable expects:

  • gamemodes/.amx files of the game modes (only one runs at a time)
  • filterscripts/.amx files of auxiliary scripts
  • plugins/ — native libraries (.so on Linux, .dll on Windows) such as sscanf, streamer, mysql
  • scriptfiles/ — files read/written at runtime (logs, JSON, SQLite databases, gamemode configs)
  • pawno/ (optional) — folder with the Pawn compiler and includes (.inc)
  • server.cfg — main server configuration
  • server_log.txt — log generated at runtime (essential for debugging)

The .pwn files (source code) can sit inside gamemodes/ or filterscripts/ during development, but the executable only loads the compiled .amx.

Installing a gamemode

Most public gamemodes ship as a .zip or .rar package containing the .pwn, the already-compiled .amx, specific includes, and sometimes a scriptfiles/ folder with default configs.

01

Upload the gamemode’s .amx file to the server’s gamemodes/ folder:

scp my-gamemode.amx user@your-server:/samp03/gamemodes/

If the package includes a scriptfiles/ folder, copy its contents into the server’s scriptfiles/ (don’t replace the entire folder — merge).

02

If the gamemode uses its own includes (.inc files), place them inside pawno/include/:

scp includes/*.inc user@your-server:/samp03/pawno/include/

Includes are only needed if you plan to recompile the .pwn. To run the already-compiled .amx, they can be ignored.

03

Open server.cfg and locate the gamemode0 line:

nano /samp03/server.cfg

Replace the value with the name of the .amx WITHOUT the extension. For example, if the file is lvdm-edit.amx, the line should read:

gamemode0 lvdm-edit 1

The 1 at the end is the number of rounds before the server moves on to the next gamemode (if there’s a gamemode1, gamemode2, etc). For a single gamemode, leave it as 1.

04

Restart the server to load the new gamemode:

cd /samp03
./samp03svr

On managed panels, use the restart button. Watch the output — any missing plugin or include error appears in the first few seconds.

Compiling a gamemode from .pwn

When you need to edit the gamemode (change commands, tweak the economy, fix bugs), the workflow is to edit the .pwn, recompile to produce a new .amx, and replace the file on the server.

01

Edit the .pwn file locally in any text editor (VS Code, Notepad++, Sublime). Pawn is a C-like language — comments with //, blocks with {}, semicolons at the end of statements.

02

Compile using pawncc (shipped with the SA-MP compiler package):

./pawncc my-gamemode.pwn -o my-gamemode.amx

On Windows, use pawncc.exe. If the .pwn lives in gamemodes/, run the command inside that folder — the compiler looks for includes under pawno/include/ automatically when the standard structure is respected.

03

Check the output. A successful compilation ends with:

Header size:           1234 bytes
Code size:            56789 bytes
Data size:           123456 bytes
Stack/heap size:      16384 bytes
Total requirements:  197853 bytes

Warnings (lines starting with warning) do not prevent the .amx from being generated, but it’s recommended to resolve them. Errors (error) block the compilation.

Tag mismatch is a warning, not an error

Warnings like tag mismatch indicate that you’re passing a value of a different type than expected (e.g., passing Float: where the function expects an integer). The .amx is still produced, but runtime behavior may be unexpected — fix them before deploy.

Installing filterscripts

Filterscripts follow the same pattern as the gamemode, with two differences: they live in filterscripts/ and the server can load several of them simultaneously.

01

Upload the filterscript’s .amx to the correct folder:

scp anti-flood.amx user@your-server:/samp03/filterscripts/
scp admin-cmds.amx user@your-server:/samp03/filterscripts/
02

Edit server.cfg and add the filterscript names to the filterscripts line, separated by spaces and WITHOUT extension:

filterscripts anti-flood admin-cmds gl_actions

Order matters — if admin-cmds depends on a public function exposed by gl_actions, put gl_actions first.

03

Restart the server. In server_log.txt, each loaded filterscript produces a line:

Filterscript 'anti-flood.amx' loaded.
Filterscript 'admin-cmds.amx' loaded.

If a filterscript fails to load, the line is preceded by an error showing which native or plugin is missing.

Configuring required plugins

Many modern gamemodes and filterscripts depend on external plugins — compiled libraries that extend what Pawn can do. The most common ones are sscanf2 (command parsing), streamer (unlimited objects/checkpoints), mysql (database), and crashdetect (debugging).

01

Upload the plugin files to the plugins/ folder:

scp sscanf.so streamer.so user@your-server:/samp03/plugins/

On Windows, use .dll instead of .so. The architecture (32-bit vs 64-bit) must match the server executable — the default SA-MP 0.3.7 is 32-bit.

02

List the plugins on the plugins line of server.cfg, separated by spaces and WITHOUT extension:

plugins sscanf streamer crashdetect

Order here is less critical than with filterscripts, but some plugins (like crashdetect) prefer to be loaded first so they can capture errors from the others.

crashdetect is your best friend

In development environments, always load the crashdetect plugin. It turns silent crashes into stack traces inside server_log.txt, showing exactly which line of the gamemode caused the issue. In production it’s optional, but still recommended.

Verification

To confirm everything came up correctly, run two checks:

tail -f /samp03/server_log.txt

You should see, in order: plugin loads, gamemode load (Loaded 1 gamemodes.), each filterscript loading, and finally Number of vehicle models: NN indicating the server is ready.

Then open SA-MP on the client and connect to the server’s IP. If the gamemode actually loaded, you’ll see its custom name (and not Grand Larceny) in the player list and the spawn messages.

Troubleshooting

”Failed to load gamemode” error

Shows up when the .amx isn’t inside gamemodes/ or the name in server.cfg is wrong. Check that the file exists (ls gamemodes/) and that the gamemode0 line points to the correct name without extension.

”Plugin failed to load” error

Common cause: the plugin’s architecture doesn’t match the executable (32-bit vs 64-bit) or the plugin was compiled for a different SA-MP version. Download the version compatible with your server — 0.3.7-R2 and 0.3.DL require different plugin builds.

Server restarts in a loop

This is usually a filterscript that crashes inside OnFilterScriptInit. Comment out all filterscripts in server.cfg, restart, and add them back one at a time until you find the culprit. Use crashdetect to capture the stack trace.

”Symbol already defined” when compiling

You included the same .inc twice or have a duplicate function between the gamemode and an include. Search for the symbol name across the .pwn and the includes — only one definition can exist.

Next steps

With the gamemode and filterscripts running, a few directions are worth investing in:

  • Set up automatic backups of scriptfiles/ (where the gamemode’s persistent data lives)
  • Implement a database layer with the MySQL plugin to scale beyond .ini files
  • Configure RCON with a strong password and restrict access by IP
  • Monitor CPU and memory usage — poorly optimized gamemodes can consume 100% of a core under load
  • Study ALS hooks to extend filterscripts without modifying the original gamemode

If you’re running SA-MP in production and want low latency for Brazilian players, Hostini’s game hosting ships with servers in São Paulo, edge DDoS protection, and a panel to manage plugins without needing SSH.

Frequently asked questions

What is the difference between a gamemode and a filterscript in SA-MP?

The gamemode defines the server's main logic (game mode, rules, spawns, economy) and only one can be active at a time. Filterscripts are auxiliary scripts loaded in parallel, used for modular features like anti-flood, admin commands, or events. A server can run many filterscripts simultaneously.

Can I use a .amx gamemode without having the original .pwn?

Yes. The SA-MP server only executes the .amx (compiled bytecode). The .pwn is the source code and is only needed if you want to edit and recompile. For public gamemodes it's common to have both in the package — keep the .pwn outside gamemodes/ to avoid confusion.

Why does my server crash right after starting with a new filterscript?

Common causes are missing plugins (SKY plugin, sscanf, MySQL), includes incompatible with the compiler version, or the filterscript depending on functions exported by a gamemode that doesn't expose them. Read server_log.txt line by line — the error always appears before the crash.

Do I need to recompile the gamemode every time I change server.cfg?

No. server.cfg is read as plain text by the SA-MP executable at boot. You only need to recompile when editing the .pwn of a gamemode or filterscript. Changes to RCON, hostname, max players, and plugin lists do not require recompilation.

In which order are filterscripts loaded?

They load in the order listed on the filterscripts line in server.cfg, separated by spaces. Order matters when one filterscript depends on public variables or hooks from another — put dependencies before dependents. Filterscripts always load after the gamemode.

How do I find out which Pawn compiler version a gamemode expects?

Check the .pwn header — modern gamemodes usually declare #include <a_samp> matching their target version. SA-MP 0.3.7 uses Pawn 3.2.3664; 0.3.DL uses 3.10.x. Compiling with the wrong version produces errors like tag mismatch or symbol already defined.

Topics:
Next steps VPS, dedicated or managed panel for FiveM, SAMP, MTA, Tibia and more.Host your game server with Hostini →
Was this tutorial helpful?
Chat on WhatsApp