Unknown ❤ RESPAWN.ZAFEST.RO | VIP FREE | FREE FOR ALL ❤ 0/32
Romania XPlayZM.CSBlackDevil.COM # Zombie Plague UltimateX [ Respawn + FDL + VIP 22-12PM + POINTS] ® 18/32
Server bewerben

Add install-amxx-modules/en.md

Browse Source
Daemon666 committed parent 443cd853bb commit 36af6df2360f7ed49e52fb1ca3eebae2aec4a9ac
1 changed file with 115 additions and 0 deletions
+115 -0 install-amxx-modules/en.md A
@@ -0,0 +1,115 @@
1 +---
2 +title: "How to Install and Enable AMX Mod X Modules (modules.ini)"
3 +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."
4 +category: "installation"
5 +tags: "amxmodx, modules"
6 +image: ""
7 +read_time: "8 min read"
8 +---
9 +<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>
10 +
11 +<h2>Where modules live</h2>
12 +<pre>cstrike/addons/amxmodx/
13 +├── modules/ &lt;-- the .so / .dll files
14 +│ ├── cstrike_amxx_i386.so
15 +│ ├── fakemeta_amxx_i386.so
16 +│ ├── hamsandwich_amxx_i386.so
17 +│ └── …
18 +└── configs/
19 + └── modules.ini &lt;-- which ones to load</pre>
20 +
21 +<h2>How modules actually get loaded</h2>
22 +<p>Two mechanisms, and understanding both saves you a lot of confusion:</p>
23 +<ol>
24 +<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>
25 +<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>
26 +</ol>
27 +<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>
28 +
29 +<h2>modules.ini format</h2>
30 +<pre>; AMX Mod X modules
31 +; one per line, no extension, no path
32 +fun
33 +engine
34 +fakemeta
35 +geoip
36 +sockets
37 +regex
38 +nvault
39 +cstrike
40 +csx
41 +hamsandwich
42 +;mysql
43 +;sqlite</pre>
44 +<p>Rules:</p>
45 +<ul>
46 +<li>Write the <strong>short name</strong> — <code>cstrike</code>, not <code>cstrike_amxx_i386.so</code>. AMXX appends the platform suffix itself.</li>
47 +<li><code>;</code> comments a line out.</li>
48 +<li>Order does not matter.</li>
49 +<li>Listing a module whose file is missing gives <code>Module failed to load</code> at startup, which is noisy but not fatal.</li>
50 +</ul>
51 +
52 +<h2>Installing a third-party module</h2>
53 +<p>The procedure is the same whether it is ReAPI, Orpheu, or something from a forum:</p>
54 +<ol>
55 +<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>
56 +<li>Copy it into <code>modules/</code>:
57 +<pre>cp reapi_amxx_i386.so /home/steam/hlds/cstrike/addons/amxmodx/modules/
58 +chmod 644 /home/steam/hlds/cstrike/addons/amxmodx/modules/reapi_amxx_i386.so</pre></li>
59 +<li>Copy its <code>.inc</code> include file into <code>scripting/include/</code> so you can compile plugins against it:
60 +<pre>cp reapi.inc /home/steam/hlds/cstrike/addons/amxmodx/scripting/include/</pre></li>
61 +<li>Optionally add its short name to <code>modules.ini</code>.</li>
62 +<li>Restart the server (modules are loaded at startup — a map change is not enough).</li>
63 +</ol>
64 +
65 +<h2>Verify with amxx modules</h2>
66 +<pre>amxx modules</pre>
67 +<p>Output looks like:</p>
68 +<pre>Currently loaded modules:
69 + name version author status
70 + [ 1] Fun 1.9.0.5258 AMXX Dev Team running
71 + [ 2] Engine 1.9.0.5258 AMXX Dev Team running
72 + [ 3] FakeMeta 1.9.0.5258 AMXX Dev Team running
73 + [ 4] CStrike 1.9.0.5258 AMXX Dev Team running
74 + [ 5] Ham Sandwich 1.9.0.5258 AMXX Dev Team running
75 + [ 6] ReAPI 5.x s1lent running
76 +6 modules, 6 correct</pre>
77 +<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>
78 +
79 +<h2>The 32-bit rule</h2>
80 +<p>Every module is 32-bit, because the whole server is 32-bit:</p>
81 +<pre>file addons/amxmodx/modules/cstrike_amxx_i386.so
82 +# ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV)</pre>
83 +<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>
84 +
85 +<h2>Which modules you actually need</h2>
86 +<table>
87 +<thead><tr><th>Module</th><th>Use it for</th></tr></thead>
88 +<tbody>
89 +<tr><td><code>cstrike</code></td><td>CS-specific natives: money, team, weapons, models</td></tr>
90 +<tr><td><code>fakemeta</code></td><td>Direct engine/entity access; almost every serious plugin uses it</td></tr>
91 +<tr><td><code>hamsandwich</code></td><td>Hooking game-DLL functions (<code>Ham_Spawn</code>, <code>Ham_TakeDamage</code>)</td></tr>
92 +<tr><td><code>csx</code></td><td>Stats (rank, HP left, hits) — required by most stats plugins</td></tr>
93 +<tr><td><code>fun</code></td><td>Simple gameplay natives: health, gravity, godmode</td></tr>
94 +<tr><td><code>nvault</code></td><td>Flat-file key/value storage; used by shops and saved settings</td></tr>
95 +<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>
96 +<tr><td><code>geoip</code></td><td>Country lookup from an IP</td></tr>
97 +<tr><td><code>reapi</code></td><td>ReGameDLL hooks — <a href="/tutorials/install-reapi">requires ReGameDLL</a></td></tr>
98 +</tbody>
99 +</table>
100 +
101 +<h2>Common errors</h2>
102 +<ul>
103 +<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>
104 +<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>
105 +<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>
106 +<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>
107 +<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>
108 +</ul>
109 +
110 +<h2>Verification</h2>
111 +<ol>
112 +<li><code>amxx modules</code> ends with <em>N modules, N correct</em>.</li>
113 +<li><code>amxx plugins</code> shows nothing in <code>bad load</code>.</li>
114 +<li><code>addons/amxmodx/logs/error_*.log</code> has no <code>Module</code> lines after a restart.</li>
115 +</ol>
0 116