Promote server
115 lines 7.3 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Install and Enable AMX Mod X Modules (modules.ini)"
excerpt: "How AMX Mod X modules load, what modules.ini actually controls, how to add a third-party module, and how to read amxx modules output."
category: "installation"
tags: "amxmodx, modules"
image: ""
read_time: "8 min read"
---
<p>An AMX Mod X <em>module</em> is a native shared library (<code>.so</code> / <code>.dll</code>) that adds natives for Pawn plugins to call. <code>cstrike</code>, <code>fakemeta</code>, <code>hamsandwich</code>, <code>csx</code>, <code>nvault</code>, <code>sqlx</code>, <code>geoip</code>, ReAPI, Orpheu — all modules. A <em>plugin</em> (<code>.amxx</code>) is Pawn bytecode. Modules are the layer below. Confusing the two is why people put <code>.so</code> files in <code>plugins/</code> and then wonder why nothing happens.</p>

<h2>Where modules live</h2>
<pre>cstrike/addons/amxmodx/
├── modules/                     &lt;-- the .so / .dll files
│   ├── cstrike_amxx_i386.so
│   ├── fakemeta_amxx_i386.so
│   ├── hamsandwich_amxx_i386.so
│   └── …
└── configs/
    └── modules.ini              &lt;-- which ones to load</pre>

<h2>How modules actually get loaded</h2>
<p>Two mechanisms, and understanding both saves you a lot of confusion:</p>
<ol>
<li><strong>Explicit</strong> — a line in <code>configs/modules.ini</code> loads that module at startup, whether or not any plugin needs it.</li>
<li><strong>On demand</strong> — when a plugin declares <code>#include &lt;cstrike&gt;</code>, its compiled <code>.amxx</code> records that it requires the <code>cstrike</code> library. AMXX will load the matching module automatically if it can find it in <code>modules/</code>.</li>
</ol>
<p>So a module can load even if it is not in <code>modules.ini</code>. The corollary matters: <strong>a module that is not on disk cannot be auto-loaded</strong>, and you get <code>Module "cstrike" required for plugin "x.amxx"</code> at startup. See <a href="/tutorials/fix-module-cstrike-required">that error</a>.</p>

<h2>modules.ini format</h2>
<pre>; AMX Mod X modules
; one per line, no extension, no path
fun
engine
fakemeta
geoip
sockets
regex
nvault
cstrike
csx
hamsandwich
;mysql
;sqlite</pre>
<p>Rules:</p>
<ul>
<li>Write the <strong>short name</strong> — <code>cstrike</code>, not <code>cstrike_amxx_i386.so</code>. AMXX appends the platform suffix itself.</li>
<li><code>;</code> comments a line out.</li>
<li>Order does not matter.</li>
<li>Listing a module whose file is missing gives <code>Module failed to load</code> at startup, which is noisy but not fatal.</li>
</ul>

<h2>Installing a third-party module</h2>
<p>The procedure is the same whether it is ReAPI, Orpheu, or something from a forum:</p>
<ol>
<li>Get a build for <strong>your AMXX version and platform</strong>. A 1.10 module in a 1.9 install fails with <code>Module was compiled for a newer AMXX version</code>.</li>
<li>Copy it into <code>modules/</code>:
<pre>cp reapi_amxx_i386.so /home/steam/hlds/cstrike/addons/amxmodx/modules/
chmod 644 /home/steam/hlds/cstrike/addons/amxmodx/modules/reapi_amxx_i386.so</pre></li>
<li>Copy its <code>.inc</code> include file into <code>scripting/include/</code> so you can compile plugins against it:
<pre>cp reapi.inc /home/steam/hlds/cstrike/addons/amxmodx/scripting/include/</pre></li>
<li>Optionally add its short name to <code>modules.ini</code>.</li>
<li>Restart the server (modules are loaded at startup — a map change is not enough).</li>
</ol>

<h2>Verify with amxx modules</h2>
<pre>amxx modules</pre>
<p>Output looks like:</p>
<pre>Currently loaded modules:
      name                    version     author              status
 [ 1] Fun                     1.9.0.5258  AMXX Dev Team       running
 [ 2] Engine                  1.9.0.5258  AMXX Dev Team       running
 [ 3] FakeMeta                1.9.0.5258  AMXX Dev Team       running
 [ 4] CStrike                 1.9.0.5258  AMXX Dev Team       running
 [ 5] Ham Sandwich            1.9.0.5258  AMXX Dev Team       running
 [ 6] ReAPI                   5.x         s1lent              running
6 modules, 6 correct</pre>
<p>The last line is what you check. <code>6 modules, 6 correct</code> is healthy. Anything less than "all correct" means at least one module is <code>error</code> or <code>bad load</code>, and the reason will be in <code>addons/amxmodx/logs/</code>.</p>

<h2>The 32-bit rule</h2>
<p>Every module is 32-bit, because the whole server is 32-bit:</p>
<pre>file addons/amxmodx/modules/cstrike_amxx_i386.so
# ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV)</pre>
<p>If you see <code>ELF 64-bit ... x86-64</code>, the server will refuse it with <code>wrong ELF class: ELFCLASS64</code>. There are no 64-bit AMXX modules; if a download gave you one, it is not for CS 1.6. See <a href="/tutorials/fix-wrong-elf-class-elfclass64">that error</a>.</p>

<h2>Which modules you actually need</h2>
<table>
<thead><tr><th>Module</th><th>Use it for</th></tr></thead>
<tbody>
<tr><td><code>cstrike</code></td><td>CS-specific natives: money, team, weapons, models</td></tr>
<tr><td><code>fakemeta</code></td><td>Direct engine/entity access; almost every serious plugin uses it</td></tr>
<tr><td><code>hamsandwich</code></td><td>Hooking game-DLL functions (<code>Ham_Spawn</code>, <code>Ham_TakeDamage</code>)</td></tr>
<tr><td><code>csx</code></td><td>Stats (rank, HP left, hits) — required by most stats plugins</td></tr>
<tr><td><code>fun</code></td><td>Simple gameplay natives: health, gravity, godmode</td></tr>
<tr><td><code>nvault</code></td><td>Flat-file key/value storage; used by shops and saved settings</td></tr>
<tr><td><code>sqlx</code></td><td>Threaded MySQL/SQLite — see <a href="/tutorials/install-mysql-module-amxx">the MySQL module guide</a></td></tr>
<tr><td><code>geoip</code></td><td>Country lookup from an IP</td></tr>
<tr><td><code>reapi</code></td><td>ReGameDLL hooks — <a href="/tutorials/install-reapi">requires ReGameDLL</a></td></tr>
</tbody>
</table>

<h2>Common errors</h2>
<ul>
<li><strong><code>Module failed to load</code></strong> — file missing, wrong architecture, or built for a different AMXX. See <a href="/tutorials/fix-amxx-module-failed-to-load">the full fix</a>.</li>
<li><strong><code>Module "cstrike" required for plugin "x.amxx"</code></strong> — the <code>.so</code> is not in <code>modules/</code>. You extracted the AMXX base package but not the Counter-Strike addon.</li>
<li><strong><code>Module was compiled for a newer AMXX version</code></strong> — version mismatch. Modules must come from the same AMXX release as the core.</li>
<li><strong>Module listed in <code>modules.ini</code> but not in <code>amxx modules</code></strong> — the name is misspelled, or you added a file extension. Use the short name only.</li>
<li><strong>Module loads but the plugin still says the native is missing</strong> — the plugin was compiled without the module's <code>.inc</code>, or against a different version of it. Recompile with the matching include; see <a href="/tutorials/fix-reapi-native-not-found">native not found after installing ReAPI</a>.</li>
</ul>

<h2>Verification</h2>
<ol>
<li><code>amxx modules</code> ends with <em>N modules, N correct</em>.</li>
<li><code>amxx plugins</code> shows nothing in <code>bad load</code>.</li>
<li><code>addons/amxmodx/logs/error_*.log</code> has no <code>Module</code> lines after a restart.</li>
</ol>