How to Compile an AMXX Plugin Online (.sma to .amxx)
Compile AMX Mod X plugins online for free: turn a .sma into .amxx for your AMXX version, add custom includes, install the plugin and fix common compile errors.
In this guide 6 sections
An AMX Mod X plugin comes as source code (.sma), but the server can only load the compiled file (.amxx). Compiling turns one into the other. You can do it in your browser with the XCSTRIKE compiler: no AMX Mod X on your PC, no command line, and it uses the official amxxpc compiler. This guide shows how, and how to fix the errors you'll most likely see.
Quick steps#
- Open the AMXX compiler.
- Pick the AMXX version your server runs.
- Upload or paste your
.sma. - If the plugin needs extra
.incfiles, add them under Custom includes. - Click Compile plugin, then Download the
.amxx. - Put it in
addons/amxmodx/plugins/and add its name toplugins.ini.
The full instructions for each step are below.
AMXX compilerCompile .sma to .amxx online, for AMX Mod X 1.8.2 to 1.10.OpenFind your server's AMX Mod X version#
Compile for the same version your server runs. A plugin built with 1.10 can fail to load on a 1.8.2 server. To check, type in the server console:
amxx version| Version | When to pick it |
|---|---|
| 1.10 | Current version; the right choice for almost every server today |
| 1.9 | Servers that haven't moved to 1.10 yet |
| 1.8.3 / 1.8.2 | Old servers that were never updated, with old plugins |
Not on AMX Mod X 1.10 yet? See how to install AMX Mod X.
Compile a plugin#
1Choose the version
On the compiler page, in AMXX version, pick the one from
amxx version.2Add your source code
Drop the
.smafile on the page, click browse to pick it, or paste the code into the editor. In Output file name, write the plugin's file name ending in.sma, with no spaces (for examplemy_plugin.sma); the download gets the same name ending in.amxx.3Add custom includes (if needed)
Look at the
#includelines at the top of the.sma. Includes that come with AMX Mod X (amxmodx,amxmisc,cstrike,fun,fakemeta,hamsandwich,engine…) are already there. Anything else, such asreapior a VIP API, you must add: under Custom includes, click Add include and upload each.incfile.4Compile
Click Compile plugin. In a few seconds the log shows the result:
- Success: a Download button appears with your
.amxx. - Errors: the log lists them with line numbers. See [Common errors](#common-errors) below.
- Success: a Download button appears with your
5Download it right away
Click Download and save the
.amxx. Download links expire after 1 hour.
The compiler is free and needs no account. A .sma can be up to 512 KB, with up to 8 custom includes of 64 KB each, and you can compile 30 times per hour.
Install the compiled plugin#
1Upload the file
Put the
.amxxhere on your server:cstrike/addons/amxmodx/plugins/my_plugin.amxx2Turn it on
Add its name on a new line at the end of:
addons/amxmodx/configs/plugins.iniinimy_plugin.amxx3Load it
Change the map or restart the server. Check it with:
bashamxx pluginsIt should be in the list as
running.
A plugin can compile fine and still fail on the server if it needs a module that isn't on (for example ReAPI or a database module). The compiler only builds the file; the server must have what the plugin uses. If it shows bad load, see CS 1.6 server errors.
Common errors#
The compiler log shows the error code and the line. These are the ones people hit most:
fatal error 100: cannot read from file: "…"#
An #include wasn't found. The .inc isn't part of AMX Mod X (add it under Custom includes), the name is spelled wrong, or it belongs to a newer AMX Mod X than the version you picked.
error 017: undefined symbol "…"#
Something is used but never defined. Check spelling and upper/lower case (Pawn is case sensitive). For natives, the include that defines them must be there: cs_set_user_money needs #include <cstrike>, and fun natives need #include <fun>.
error 001: expected token: ";", but found "…"#
Usually a missing ; or bracket on the line before the one in the error. Look at the previous line first.
error 010: invalid function or declaration#
Code is outside a function, or a { or } is missing or doubled earlier in the file. Check that every { has its }.
error 021: symbol already defined: "…"#
Two functions or variables have the same name, or the same code was pasted twice. It also happens when a custom include defines something a standard include already has.
error 088: number of arguments does not match definition#
A function is called with too many or too few arguments. Some natives changed between AMX Mod X 1.8.2 and 1.10, so code written for one version can fail on another: check that you picked the right version.
warning 213: tag mismatch#
A decimal number (Float) is mixed with a whole number without converting it. Use float() and floatround(). It's only a warning, but the plugin may behave wrongly in game.
warning 217: loose indentation#
Tabs and spaces are mixed. Harmless; you can ignore it, or add #pragma tabsize 0 at the top of the file.
Errors stop the build: there's no .amxx until you fix them. Warnings still produce a file, but read them; they often point at real bugs.
FAQ#
How do I compile a .sma to .amxx?#
Open the XCSTRIKE AMXX compiler, pick your server's AMX Mod X version, upload the .sma, click Compile plugin and download the .amxx.
Do I need AMX Mod X installed on my PC?#
No. Compiling happens on the XCSTRIKE server; you only need a browser.
Is it free?#
Yes, with no account. The limit is 30 builds per hour.
Can I compile SourceMod or CS2 plugins here?#
Not with this one: it's for AMX Mod X (CS 1.6). For SourceMod there's the SourceMod compiler, and for CS2 the CounterStrikeSharp compiler.
Is there a ready plugin so I don't have to compile?#
Often, yes. The plugin library has plugins already compiled for each AMX Mod X version:
Plugin libraryAMX Mod X, SourceMod and CS2 plugins, compiled for your version.Open