Promover servidor
11 lines 5.5 KiB Markdown Source Rendered Raw Permalink History
---
title: "Fix: 'Plugin failed to load: Invalid Plugin' (AMX Mod X)"
excerpt: "What 'Invalid Plugin' means in AMX Mod X, the version and architecture mismatch between .amxx and your AMXX build, corrupted uploads, wrong compiler, and reading amxx plugins status."
category: "errors"
tags: "amxmodx, plugins"
image: ""
read_time: "8 min read"
---
<p>AMX Mod X loads your plugin list and one line reports:</p><blockquote>Plugin failed to load: Invalid Plugin</blockquote><p>and <code>amxx plugins</code> shows it as <code>bad load</code>. "Invalid Plugin" specifically means AMX Mod X could not recognise the <code>.amxx</code> as a plugin it can run &mdash; the file is corrupt, compiled for the wrong AMXX version, or not a real <code>.amxx</code> at all. This is distinct from a plugin that loads but errors at runtime. Here is how to pin it down.</p><h2>1. Read the exact status</h2><p>Get the per-plugin verdict from the server console:</p><pre>amxx plugins</pre><p>Each plugin shows <code>running</code>, <code>paused</code>, <code>bad load</code>, or <code>debug</code>. "Invalid Plugin" corresponds to <code>bad load</code> with an invalid-format reason. Note which plugin and pair it with the load line in the AMXX log under <code>addons/amxmodx/logs/</code>, which often adds a more specific reason such as a bad file magic or version.</p><h2>2. Check the file is a real, complete .amxx</h2><p>A truncated or corrupted upload &mdash; interrupted transfer, or FTP in ASCII mode mangling a binary &mdash; produces an invalid plugin. Confirm the file has real size and is binary:</p><pre>ls -l addons/amxmodx/plugins/myplugin.amxx</pre><p>A near-zero-byte file, or a file that opens as text/HTML (you accidentally saved a web page), is invalid. Re-upload in <strong>binary</strong> mode. If you compiled it yourself, make sure you copied the <code>.amxx</code> output, not the <code>.sma</code> source &mdash; a <code>.sma</code> renamed to <code>.amxx</code> is invalid because it is Pawn text, not compiled bytecode.</p><h2>3. Match the plugin's AMXX version to your server</h2><p>A plugin compiled for a newer AMX Mod X than you run can be rejected as invalid, and one compiled for a much older branch may also fail. The safe path is to compile against the version you run &mdash; <strong>1.9</strong> is the stable default. If you downloaded a precompiled <code>.amxx</code> that will not load, recompile the <code>.sma</code> with the matching compiler. On this platform the <a href="/plugins/">plugin directory</a> compiles source on demand against pinned 1.8.2 / 1.9 / 1.10 toolchains, which sidesteps the mismatch entirely.</p><h2>4. Rule out an architecture/format mismatch</h2><p>The <code>.amxx</code> format carries a version tag AMX Mod X checks on load. If someone hand-edited the file, or it was produced by an incompatible or unofficial compiler, the tag will not match and it loads as invalid. Recompile from clean source with the official <code>amxxpc</code> for your target version rather than trusting a mystery binary.</p><h2>5. Confirm the line in plugins.ini is right</h2><p>The plugin is listed in <code>addons/amxmodx/configs/plugins.ini</code>. A line pointing at a filename that does not exist, or a stray path, produces a load failure too. Keep it to the bare filename:</p><pre>myplugin.amxx
; not a path, not myplugin.sma, not a commented mess
</pre><p>Plugins load only at map change, so after fixing the file or the line, change the map (or restart) to reload &mdash; editing on a live map changes nothing until then, as covered in <a href="/tutorials/update-plugins-live-server">updating plugins on a live server</a>.</p><h2>6. Compile against the version you run</h2><p>The cleanest way to avoid "Invalid Plugin" for good is to never ship a binary compiled for a version you do not run. If you maintain your own plugins, keep a copy of the <code>amxxpc</code> compiler that matches your server &mdash; 1.8.2, 1.9 or 1.10 &mdash; and compile there. A plugin that uses a native introduced in 1.9 (for example the coloured chat natives) will not even compile on 1.8.2, and a 1.10-compiled binary can be rejected by a 1.8.2 loader as an invalid format. Pin one AMXX version across your whole server and compile everything against it; mixing compilers is the fastest route back to this error.</p><h2>Common errors</h2><ul><li><strong><code>bad load</code> / Invalid Plugin</strong> &mdash; wrong AMXX version or a corrupt file. Recompile against your version, re-upload in binary.</li><li><strong>Renamed <code>.sma</code> to <code>.amxx</code></strong> &mdash; that is source, not bytecode. Compile it first.</li><li><strong>File is tiny or opens as text</strong> &mdash; a truncated or ASCII-mangled upload. Transfer in binary mode.</li><li><strong>Precompiled download will not load</strong> &mdash; it targets a different AMXX branch. Recompile the <code>.sma</code>.</li><li><strong>Fixed the file but nothing changed</strong> &mdash; plugins reload at map change; change the map.</li></ul><h2>Verification</h2><p>After recompiling/re-uploading and changing the map, re-check:</p><pre>amxx plugins</pre><p>The plugin should now read <code>running</code> instead of <code>bad load</code>. Cross-check the AMXX log for the load line &mdash; a clean load with no invalid-format entry confirms the fix. If it loads but then throws runtime errors, that is a different layer (a missing module or a code bug); a plugin that needs a module you lack shows as <code>bad load</code> for a different reason, addressed in the module-load troubleshooting. Test the plugin's actual feature in-game to be sure it is genuinely working, not merely listed.</p>