Porting a Plugin from AMXX 1.8.2 to 1.10

June 4, 2026 Daemon666 8 min read 14 Aufrufe

An AMXX 1.8.2 plugin will usually keep running on 1.10 without a recompile — but "usually" is not "always", and if you have the source you should port it properly rather than ship a decade-old binary against a modern stack. Porting means recompiling under the 1.10 compiler, resolving the new warnings and errors it raises, and deciding which newer natives to adopt. This guide walks the concrete changes, in the order you hit them.

1. Recompile before you change anything

Start by compiling the untouched source with the 1.10 compiler and reading every warning. The 1.10 compiler is stricter than 1.8.2's: things that were silent in 2013 are warnings now, and a few are hard errors. Do not "fix" anything until you have the full list — see compiling .sma to .amxx for the toolchain. Compile against the 1.10 includes, not the old ones sitting next to the source.

2. Fix tag-mismatch warnings

The most common flood of new warnings is float/integer tag mismatches. 1.8.2 let many slide; 1.10 flags them, and some of them were real bugs the whole time:

// 1.8.2 tolerated this; 1.10 warns
new Float:speed = 250            // tag mismatch: int assigned to Float

// correct
new Float:speed = 250.0

Fix them properly — add the .0, use float() where you convert deliberately — rather than suppressing. A tag mismatch on a pev_health or a damage value is exactly the kind of latent bug that produced weird behaviour on the old server.

3. Add #pragma semicolon and clean the obvious

If the plugin does not already have it, add strict pragmas at the top so the compiler enforces consistency the old code never had:

#pragma semicolon 1
#include <amxmodx>

This surfaces missing semicolons that the lenient old parser accepted. Fix them; they are free correctness.

4. Replace removed and deprecated modules

The big structural change between eras is the database layer. The old dbi module and its dbi_* natives are gone in the modern line — a 1.8.2 plugin that talks to MySQL through dbi will not compile. Port it to the sqlx module, and while you are in there, move blocking queries to the threaded API:

// old (dbi) - no longer available
// new (sqlx), threaded so it never freezes the server
#include <sqlx>

new Handle:g_tuple
public plugin_init()
{
    g_tuple = SQL_MakeDbTuple("127.0.0.1", "user", "pass", "db")
}

The full threaded pattern is in SQLx threaded queries. This is usually the largest single piece of a real port.

5. Adopt 1.9+ natives — and set amxx_min

1.9 added natives that do not exist in 1.8.2, most visibly client_print_color for coloured chat. Adopting them is a genuine improvement, but it changes your minimum version. If you use a 1.9+ native, the plugin no longer runs on a 1.8.2 server, so record that in its metadata (amxx_min = 1.9):

// 1.9+ only - coloured chat without ^x03 message hacks
client_print_color(0, print_team_default, "^3[CSB]^1 Welcome to the server")

If you need the plugin to keep running on 1.8.2 servers, do not adopt these — keep the old ^x03/^x04 colour codes inside a normal client_print. It is a deliberate trade, not a free upgrade.

6. Modernise menus if you are already touching them

Old plugins use show_menu with a keys bitmask and register_menucmd. That still compiles, so do not rewrite it just to rewrite it — but if the menu is buggy or you are extending it, port it to the new menu API, which handles paging and access for free.

Common errors during a port

  • undefined symbol "dbi_..." — the dbi module is gone. Port the database code to sqlx.
  • undefined symbol "client_print_color" — you compiled against 1.8.2 includes, or copied a 1.9+ native into a plugin you intend to keep 1.8.2-compatible. Decide the target version and compile against the matching includes.
  • Compiles clean but shows bad load on the server — a version mismatch between the compiled plugin and the running AMXX. See plugins bad load after 1.9.
  • Behaviour changed after port — a tag mismatch you "fixed" by casting rather than correcting, or a ReGameDLL/stock difference now that the server stack is newer. Test the actual feature, not just that it loads.
  • Flood of warnings you are tempted to ignore — don't. Each one is the compiler telling you 1.8.2 was lenient about something. The point of the port is to resolve them.

Verification

A port is done when three things hold: the plugin compiles with no warnings under 1.10, it loads as running in amxx plugins, and every feature works when exercised in-game — not just that it started. Test the database path especially, since that is where the port did the most surgery. If you are upgrading the whole server rather than a single plugin, pair this with upgrading AMX Mod X 1.8.2 to 1.10, and debug any runtime faults with the AMXX debugging guide.

Mitwirkende: Daemon666 ✦
Teilen: