Sunucu tanitimi
9 lines 5.7 KiB Markdown Source Rendered Raw Permalink History
---
title: "Fix: 'Native not found' After Installing ReAPI"
excerpt: "Why a plugin using ReAPI reports a missing native at load, how the reapi module, ReHLDS and ReGameDLL must line up, the modules.ini and version traps, and how to confirm the hook chain is available."
category: "errors"
tags: "reapi, natives"
image: ""
read_time: "8 min read"
---
<p>You installed a plugin that uses ReAPI, and on map load AMX Mod X throws <code>Native not found</code> or the plugin shows as <code>bad load</code> in <code>amxx plugins</code>. ReAPI is not self-contained &mdash; it is a thin bridge that exposes ReHLDS and ReGameDLL hooks to Pawn, so a missing native almost always means a piece of that stack is absent or the wrong version, not that the plugin is broken. Here is how the layers fit and how to fix the gap.</p><h2>1. Understand what ReAPI actually needs</h2><p>ReAPI provides natives like <code>RegisterHookChain</code>, <code>set_member</code>, and <code>rg_*</code> functions. Those natives only exist if three things are present and compatible: <strong>ReHLDS</strong> (the engine), <strong>ReGameDLL_CS</strong> (the game logic that defines the hook chains), and the <strong>reapi</strong> AMX Mod X module that binds them. Remove or mismatch any one and the natives the plugin calls do not register, so AMXX reports them as not found. This is why the spec rule is firm: a plugin that <code>#include &lt;reapi&gt;</code> requires ReGameDLL, full stop.</p><h2>2. Confirm the reapi module is loaded</h2><p>The module must be listed and running. Check <code>addons/amxmodx/configs/modules.ini</code> contains the line:</p><pre>reapi</pre><p>Then verify at runtime from the server console:</p><pre>amxx modules</pre><p>The <code>reapi</code> module must read <code>running</code>. If it is missing from the list, the <code>reapi_amxx.so</code> (or <code>.dll</code>) file is not in <code>addons/amxmodx/modules/</code>; if it is listed but <code>bad load</code>, it failed to bind to the game &mdash; which points at the ReGameDLL layer below.</p><h2>3. Verify ReGameDLL is actually the running game DLL</h2><p>ReAPI's game-side natives come from ReGameDLL_CS. If your server still runs the stock <code>cs.so</code> / <code>mp.dll</code>, the reapi module loads but the <code>rg_*</code> natives never appear. Confirm ReGameDLL is installed as covered in <a href="/tutorials/install-regamedll-cs16">the ReGameDLL install guide</a> &mdash; the game library in <code>cstrike/dlls/</code> must be the ReGameDLL build, and the server console at startup prints the ReGameDLL version banner. No banner means you are on stock game logic and every ReAPI game native will be missing.</p><h2>4. Line up the versions</h2><p>ReHLDS, ReGameDLL and the reapi module evolve together. A reapi module newer than your ReGameDLL can reference hook chains the older game DLL does not expose, and the specific native the plugin calls then fails to register. Update all three from the same release window rather than mixing a fresh reapi module onto a two-year-old ReGameDLL. If you cannot update the engine, use a reapi module contemporary with your ReGameDLL. This is the same compatibility discipline described in <a href="/tutorials/fix-regamedll-rehlds-incompatible">the ReGameDLL/ReHLDS incompatibility fix</a>.</p><h2>5. Load order in plugins.ini</h2><p>The reapi module loads from <code>modules.ini</code> before plugins load, so module order is not the issue &mdash; but a plugin that depends on another reapi plugin's registered natives can load first and fail. If your failing plugin calls natives that a companion plugin registers with <code>register_native</code>, that provider must appear earlier in <a href="/tutorials/plugins-ini-load-order">plugins.ini load order</a>. For a plugin that only uses ReAPI's own natives, this does not apply and the cause is one of the layers above.</p><h2>Troubleshooting</h2><ul><li><strong><code>Native not found</code> at load, reapi listed as running</strong> &mdash; ReGameDLL is not the active game DLL, so the game natives never registered. Install ReGameDLL (step 3).</li><li><strong>reapi shows <code>bad load</code> in <code>amxx modules</code></strong> &mdash; the module failed to bind to the game; version mismatch between reapi and ReGameDLL. Align versions (step 4).</li><li><strong>Module file missing entirely</strong> &mdash; <code>reapi_amxx.so</code> is not in the modules folder, or <code>reapi</code> is absent from <code>modules.ini</code>. Add both.</li><li><strong>Some rg_ natives work, one specific native does not</strong> &mdash; your ReGameDLL is older than the reapi module and lacks that hook. Update ReGameDLL.</li><li><strong>Plugin using a companion's native fails</strong> &mdash; provider plugin loads after the consumer. Reorder plugins.ini.</li><li><strong>Runs on ReHLDS box, breaks on another</strong> &mdash; the second box runs stock HLDS/game DLL. ReAPI cannot work there.</li></ul><h2>Verification</h2><p>After correcting the stack, run <code>amxx modules</code> and confirm <code>reapi</code> reads <code>running</code>, then <code>amxx plugins</code> and confirm your plugin reads <code>running</code> rather than <code>bad load</code>. Trigger the plugin's actual behaviour in game &mdash; a hook chain it registers, such as a spawn or damage modification &mdash; and confirm it fires. If the module runs and the plugin loads but a hook still does nothing, the plugin's registration is fine and the ReGameDLL feature it hooks may be disabled in ReGameDLL's own <code>game.cfg</code>. When building your own ReAPI plugin, remember to set <code>reapi_required</code> and <code>regamedll_required</code> so the directory installs the dependencies alongside it &mdash; see the <a href="/plugins/csb-admin-menu">CSB Admin Menu</a> for a maintained example that declares them correctly.</p>