--- title: "How to Install ReAPI (AMXX Module) on ReHLDS" excerpt: "Install the ReAPI module for AMX Mod X on a ReHLDS + ReGameDLL server, compile plugins against it, and fix the 'native not found' errors." category: "installation" tags: "reapi, amxmodx" image: "" read_time: "8 min read" ---

ReAPI is an AMX Mod X module that exposes the internals of ReHLDS and ReGameDLL_CS to Pawn plugins as proper hooks — RegisterHookChain() — instead of the entity-poking and message-intercepting tricks plugins used for fifteen years. A ReAPI hook on RG_CBasePlayer_TakeDamage is faster, cleaner, and can change the outcome of the call, which Ham Sandwich cannot always do.

Hard prerequisite: ReAPI needs ReGameDLL_CS. It hooks functions that only exist there. It will not give you game hooks on a stock cs.so, and installing it on a Valve game DLL is the source of most "ReAPI natives don't work" reports.

1. Confirm the stack below it

In the server console, all four must answer:

version
regamedll_version
meta version
amxx version

version must show a ReHLDS version: line, and the others must print their versions. Anything that does not is a layer you have to install first: ReHLDS, ReGameDLL, Metamod-r, AMX Mod X.

2. Get a build for your AMXX version

Download the ReAPI release from the project's GitHub releases page. The archive contains builds for both AMXX 1.8.2 and 1.9/1.10 — take the one matching your AMXX. A ReAPI built for 1.9/1.10 dropped into a 1.8.2 install fails to load: amxx modules shows it as newer, and the log has a line like this, naming the core function 1.8.2 does not have (the misspelling is 1.8.2's own):

Module requested a not exisitng function (file "...reapi_amxx_i386.so") (func "...")

See that error.

3. Install the module and the includes

cd /home/steam/hlds/cstrike/addons/amxmodx

# the module
cp /path/to/reapi/modules/reapi_amxx_i386.so modules/
chmod 644 modules/reapi_amxx_i386.so

# the includes, so you can compile plugins against it
cp /path/to/reapi/scripting/include/*.inc scripting/include/

The includes matter as much as the module. ReAPI ships reapi.inc plus a set of supporting includes (reapi_engine.inc, reapi_gamedll.inc, hook-chain constants, entity offsets). Copy all of them, not just reapi.inc, or your compiles will fail on undefined symbols like RG_CBasePlayer_Spawn.

4. Enable it

ReAPI is auto-loaded when a plugin requires it, but list it explicitly in configs/modules.ini so you can see it in amxx modules even with no plugins using it yet:

fun
engine
fakemeta
cstrike
csx
hamsandwich
reapi

Restart the server. A map change does not load new modules.

5. Verify

amxx modules
Currently loaded modules:
      name        version   author    status
 [ 7] ReAPI       5.x       s1lent    running
7 modules, 7 correct

"N correct" must equal "N modules". A ReAPI line showing error means the module loaded but could not find ReGameDLL — go back and check regamedll_version.

6. A minimal ReAPI plugin

This is the shape of every ReAPI plugin. It blocks fall damage — something that used to take a Ham Sandwich hook and a bit of guesswork:

#include <amxmodx>
#include <reapi>

public plugin_init()
{
    register_plugin("No Fall Damage", "1.0", "you")
    RegisterHookChain(RG_CBasePlayer_TakeDamage, "OnTakeDamage_Pre", false)
}

public OnTakeDamage_Pre(const id, inflictor, attacker, Float:damage, damageBits)
{
    if (damageBits & DMG_FALL)
    {
        SetHookChainReturn(ATYPE_INTEGER, 0)
        return HC_SUPERCEDE
    }
    return HC_CONTINUE
}

Compile it against your ReAPI includes:

cd /home/steam/hlds/cstrike/addons/amxmodx/scripting
./amxxpc nofalldamage.sma -o compiled/nofalldamage.amxx
cp compiled/nofalldamage.amxx ../plugins/

Add nofalldamage.amxx to configs/plugins.ini, change the map, and check amxx plugins.

Key concepts

Common errors

Verification checklist

  1. regamedll_version answers.
  2. amxx modules shows ReAPI running, and N modules, N correct.
  3. A trivial ReAPI plugin compiles and loads.
  4. Its hook actually fires in game — jump off something high with the fall-damage plugin loaded and take zero damage.

That last one is the only test that proves the whole chain — module, ReGameDLL, and hook registration — is genuinely wired together.