Promoveaza serverul
73 lines 6.4 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Install an AMXX Plugin (.amxx) Correctly"
excerpt: "The correct way to install an AMX Mod X plugin: where the .amxx goes, registering it in plugins.ini, config and module dependencies, and why plugins silently fail to load."
category: "installation"
tags: "plugins, amxmodx"
image: ""
read_time: "7 min read"
---
<p>Installing an AMX Mod X plugin is four files-and-folders decisions that people get wrong in predictable ways: the compiled plugin goes in one place, it must be registered in another, its modules must be loaded, and its config must exist. Miss any one and the plugin is silently absent — AMXX does not crash, it just skips what it cannot load. This guide is the correct, boring procedure and the exact console commands that tell you it worked.</p>

<h2>1. Put the .amxx in the plugins directory</h2>
<p>Compiled plugins live in exactly one place:</p>
<pre>cstrike/addons/amxmodx/plugins/</pre>
<p>Copy the <code>.amxx</code> there. If you have the source (<code>.sma</code>), the honest and safer path is to compile it yourself first — see <a href="/tutorials/download-cs16-server-files-safely">sourcing files safely</a>:</p>
<pre>cd cstrike/addons/amxmodx/scripting
./amxxpc myplugin.sma
cp compiled/myplugin.amxx ../plugins/</pre>
<p>On Linux <code>amxxpc</code> is 32-bit; if it will not run, that is a missing i386 library problem, not a plugin problem.</p>

<h2>2. Register it in plugins.ini</h2>
<p>AMXX only loads what is listed in:</p>
<pre>cstrike/addons/amxmodx/configs/plugins.ini</pre>
<p>Add one line with just the filename — no path:</p>
<pre>myplugin.amxx</pre>
<p>A leading <code>;</code> comments the line out. This is the single most common "installed but not loading" cause: the file is in <code>plugins/</code> but was never added here, or the line is still commented.</p>

<h2>3. Provide the modules the plugin needs</h2>
<p>Most plugins depend on modules — <code>cstrike</code>, <code>fun</code>, <code>engine</code>, <code>fakemeta</code>, <code>hamsandwich</code>, <code>sqlx</code>, <code>geoip</code> and so on. If the plugin's source has <code>#include &lt;cstrike&gt;</code>, the <code>cstrike</code> module must be enabled in:</p>
<pre>cstrike/addons/amxmodx/configs/modules.ini</pre>
<p>Modern AMXX auto-loads most bundled modules, but not third-party ones. A plugin that needs a module you do not have fails with <code>Plugin failed to load: Function not found</code>. See <a href="/tutorials/install-amxx-modules">installing AMXX modules</a>.</p>

<h2>4. Create the config the plugin expects</h2>
<p>Plugins register cvars at load; you set them in a config that runs after the plugin exists. The standard file is:</p>
<pre>cstrike/addons/amxmodx/configs/amxx.cfg</pre>
<p>Put the plugin's cvars there, or in <code>cstrike/server.cfg</code>. Do not set a plugin's cvar in <code>server.cfg</code> if the plugin loads later than the cfg executes — for anything AMXX, prefer <code>amxx.cfg</code> or the plugin's own <code>.cfg</code> under <code>configs/</code>.</p>

<h2>5. Reload without a full restart (optional)</h2>
<p>You can load a plugin live for testing:</p>
<pre>amxx plugins
amx_plugins
amxx pause myplugin.amxx
amxx unpause myplugin.amxx</pre>
<p>But a newly-added plugin needs the config re-read at map start, so the reliable way to activate a fresh install is <code>changelevel</code> or a restart. "It works after a map change but not now" is expected, not a bug.</p>

<h2>Common errors</h2>
<ul>
<li><strong><code>Plugin file open error</code></strong> — the filename in <code>plugins.ini</code> does not match a file in <code>plugins/</code>. Check spelling and case; Linux is case-sensitive.</li>
<li><strong><code>bad load</code></strong> next to the plugin in <code>amxx plugins</code> — the <code>.amxx</code> was compiled for a newer AMXX than you run. Recompile the <code>.sma</code> for your version, or <a href="/tutorials/upgrade-amxmodx-1-8-2-to-1-10">upgrade AMXX</a>.</li>
<li><strong><code>Plugin failed to load: Function not found</code></strong> — a required module is missing. The plugin calls a native that lives in a module you did not load.</li>
<li><strong>Plugin shows <code>running</code> but does nothing</strong> — its cvars are unset or set in a cfg that runs before it loads. Move them to <code>amxx.cfg</code> and verify with the cvar name in console.</li>
<li><strong>Access-restricted command "you have no access"</strong> — the plugin needs an admin flag you do not hold. Check your entry in <code>users.ini</code>.</li>
</ul>

<h2>Verification</h2>
<p>Change the map, then in the server console:</p>
<pre>amxx plugins</pre>
<p>Find your plugin's line. It must read <code>running</code>. Anything else — <code>bad load</code>, <code>error</code>, <code>debug</code> — is a real failure, and the reason is printed above in the log at load time. Confirm the plugin's own effect (a menu, a command, a chat line) and check its cvars resolve:</p>
<pre>amx_myplugin_enabled</pre>
<p>If the line loads and the feature responds, the install is complete. To manage plugins in bulk from in-game, pair this with the <a href="/plugins/csb-admin-menu">CSB Admin Menu</a>.</p>

<h2>Where each piece lives — quick reference</h2>
<p>Almost every install problem is a file in the wrong one of these four locations. Keep this table next to you:</p>
<table>
<thead><tr><th>Item</th><th>Path under cstrike/</th><th>Registered in</th></tr></thead>
<tbody>
<tr><td>Compiled plugin</td><td>addons/amxmodx/plugins/*.amxx</td><td>configs/plugins.ini</td></tr>
<tr><td>Plugin source</td><td>addons/amxmodx/scripting/*.sma</td><td>compiled with amxxpc</td></tr>
<tr><td>Module (.so/.dll)</td><td>addons/amxmodx/modules/</td><td>configs/modules.ini</td></tr>
<tr><td>Cvar values</td><td>configs/amxx.cfg</td><td>runs after plugins load</td></tr>
<tr><td>Admin list</td><td>configs/users.ini</td><td>SteamID or name+password</td></tr>
</tbody>
</table>
<p>The mental model that prevents most mistakes: the file in <code>plugins/</code> is what runs, but <code>plugins.ini</code> is what decides <em>whether</em> it runs, <code>modules.ini</code> decides whether it <em>can</em> run, and <code>amxx.cfg</code> decides <em>how</em> it behaves. A plugin needs all four to be right at once, and AMXX will not warn you about the one you missed — it just quietly does less than you expected. When something "does nothing", check them in that order: is it in <code>plugins/</code>, is it listed, are its modules loaded, are its cvars set.</p>