samp.directory
← Scripts and libraries

RaihanPrnwd/omp-aegis

Authoritative 4-layer server-side anti-cheat include & filterscript for open.mp & SA:MP, powered by Pawn.RakNet, weapon-config, ColAndreas, and optional SKY.

Filterscript★ 1updated 2 days agoMITPawnsampctl
Open on GitHub

Install with sampctl

sampctl package install RaihanPrnwd/omp-aegis

Run this in your project folder. sampctl downloads the package and what it depends on.

README.md

omp-aegis

Authoritative 4-Layer Server-Side Anti-Cheat Include & Filterscript for open.mp and SA:MP.

omp-aegis combines pre-engine RakNet packet/RPC filtering (Pawn.RakNet), 100% server-side combat and health/armour validation (samp-weapon-config), 3D world collision raycasting (ColAndreas), and optional C++-level packet rate limiting & sync freezing (SKY on SA:MP 0.3.7/0.3.DL) into a single drop-in Pawn library with ALS native & callback chaining.


Table of Contents


Architecture Overview

flowchart TD
    Client["Client Packet / RPC"] --> L1["Layer 1: Pawn.RakNet Pre-Engine Firewall\n(20 Packet & RPC Handlers + Quarantine Gate)"]
    L1 -->|Drop crasher / flood / spoof| Drop["Packet Dropped (return 0)"]
    L1 -->|Clean packet| L2["Layer 2: samp-weapon-config Combat Authority\n(Server-Side HP/Armour + OnRejectedHit + Aimbot Cone)"]
    L2 --> L3["Layer 3: Authoritative State & Physics\n(ALS Native Hooks + 13-Slot Inventory + Grace Windows)"]
    L3 --> L4["Layer 4: ColAndreas 3D Collision Raycasts\n(Wallshot, Noclip, Ground-Height Airbreak, Water-Walk)"]
    L4 -->|Violation| Strike["Strike Counter + Decay Window"]
    Strike --> CB["OnAegisCheatDetected()"]
    CB -->|return 1| Action["Action Engine\n(WARN / REVERT / KICK / BAN + Instant Quarantine + SKY Freeze)"]
    CB -->|return 0| Custom["Handled by Gamemode"]

Why 4 Layers?

  1. Pre-Engine Packet Firewall (katursis/Pawn.RakNet) — Inspects 10 sync packets (200, 203, 204, 205, 206, 207, 209, 210, 211, 212) and 10 RPCs (23, 26, 53, 61, 62, 96, 106, 128, 129, 131, 154) before open.mp/SA:MP broadcasts them to other players. Uses an isolated @aegis handler namespace so it never collides with weapon-config's @default handlers.
  2. Server-Side Combat Authority (oscar-broman/samp-weapon-config) — Health, armour, and damage are enforced 100% server-side (making classic HP/Armour/Godmode hacks structurally impossible). All OnRejectedHit and OnInvalidWeaponDamage violations pipe directly into Aegis strikes alongside camera-vector Aimbot cone validation.
  3. 3D Collision Verification (Pottus/ColAndreas) — Replaces guesswork with true San Andreas map geometry raycasts: dual-ray anti-wallshot, dual-ray anti-noclip, real ground-elevation airbreak/fly detection, water-volume swim-in-air detection, and ground-vehicle drive-on-water checks.
  4. Optional C++ Hardening (oscar-broman/SKY on SA:MP 0.3.7/0.3.DL) — Automatically enables C++ invalid-packet timeouts, global packet rate limits, sync bug patches, stealth-knife disabling, and FreezeSyncPacket(playerid, E_ALL_SYNC, true) cheater quarantine when <SKY> is included.

Features & 26 Protection Modules

IDEnum ConstantDisplay NamePrimary LayerDefault ActionDefault StrikesDetection Mechanism
0AEGIS_CHEAT_MONEYMoney HackRakNet + StateREVERT2ID_STATS_UPDATE (205) + authoritative ALS money hooks
1AEGIS_CHEAT_HEALTH_SPOOFHealth Spoofweapon-configWARN3Server-side HP enforced by weapon-config
2AEGIS_CHEAT_ARMOUR_SPOOFArmour SpoofRakNet + WCWARN3ID_PLAYER_SYNC armour vs WC_GetPlayerArmour
3AEGIS_CHEAT_WEAPONWeapon HackRakNet + State + WCKICK1All 13 slots inspected in ID_WEAPONS_UPDATE (204), GetPlayerWeapon, & HIT_INVALID_WEAPON; auto-credits police shotgun, caddy golf club & aircraft parachute
4AEGIS_CHEAT_AMMOAmmo HackRakNet + StateKICK3Per-slot server ammo tracking in ID_WEAPONS_UPDATE (204) + frozen/infinite ammo shot counter
5AEGIS_CHEAT_RAPID_FIRERapid Fireweapon-config + ShotKICK3SHOOTING_RATE_TOO_FAST / HIT_RATE_TOO_FAST + per-weapon min inter-shot interval floor
6AEGIS_CHEAT_SILENT_AIMSilent Aim / Invalid HitRakNet + WC + ShotKICK3Remote bullet origin check (ID_BULLET_SYNC), HIT_TOO_FAR_FROM_SHOT, HIT_OUT_OF_RANGE, HIT_MULTIPLE_PLAYERS, HIT_UNSTREAMED, & hit offset bounds
7AEGIS_CHEAT_AIMBOTAimbot / ProAim ConeRakNet + ShotKICK4Dot product between ID_AIM_SYNC camFrontVec and normalized vector to hit player (dist >= 8.0m, dot < 0.65)
8AEGIS_CHEAT_DAMAGE_SPOOFDamage Spoofweapon-configKICK2OnInvalidWeaponDamage (WC_INVALID_DAMAGE, WC_INVALID_DISTANCE) & HIT_INVALID_DAMAGE / HIT_NOT_SPAWNED
9AEGIS_CHEAT_TELEPORTTeleport HackPhysics + ALSKICK2Scaled 2D displacement delta (on-foot & in-vehicle) with server-teleport/spawn/interior grace windows
10AEGIS_CHEAT_AIRBREAKAirbreak / Fly HackColAndreas + PhysicsKICK3CA_IsPlayerOnSurface + 40m ground raycast height + CA_IsPlayerInWater swim-in-air verification
11AEGIS_CHEAT_SPEED_HACKSpeed HackPhysics + ALSKICK3Separate velocity caps for on-foot, ground vehicles, and aircraft with SetPlayerVelocity / SetVehicleVelocity grace
12AEGIS_CHEAT_JETPACKJetpack HackRakNet + StateKICK1Instant packet block in ID_PLAYER_SYNC (207) + GetPlayerSpecialAction fallback
13AEGIS_CHEAT_VEHICLE_REPAIRVehicle Repair HackState + ALSREVERT2Server vehicle HP cache with RepairVehicle, SetVehicleHealth, & OnEnterExitModShop awareness
14AEGIS_CHEAT_VEHICLE_JACKVehicle Jack / WarpRakNet + StateKICK2RPC_EnterVehicle (26) distance check + OnPlayerStateChange entry authorization
15AEGIS_CHEAT_CAR_TROLLCar Troll / MagnetRakNet + CallbackREVERT2Pre-engine ID_UNOCCUPIED_SYNC (209) velocity/spin blocker + RPC_DamageVehicle (106) remote damage blocker
16AEGIS_CHEAT_TRAILER_TROLLTrailer Troll / CrasherRakNetKICK1ID_TRAILER_SYNC (210) velocity, angular velocity, quaternion & ID validation
17AEGIS_CHEAT_INVISIBLEInvisibility / Ghost SyncRakNetKICK2Invalid surfingVehicleId detection in ID_PLAYER_SYNC (207)
18AEGIS_CHEAT_FAKE_KILLFake Kill / Death FloodRakNetKICK2RPC_Death (53) burst filter drops spoofed deaths before OnPlayerDeath or killfeed triggers
19AEGIS_CHEAT_DIALOG_SPOOFDialog SpoofRakNetKICK1Authoritative outgoing RPC_ShowPlayerDialog (61) ID matched against incoming RPC_DialogResponse (62)
20AEGIS_CHEAT_PACKET_FLOODPacket / RPC FloodRakNet (+ SKY)KICK2Sliding 1-second packet (180/s) & RPC (45/s) rate limiter
21AEGIS_CHEAT_CRASHERCrasher / Malformed PacketRakNetBAN1NaN/Inf/OOB floats, deformed quaternions, surf offset crashers, seat/trailer/train crashers, invalid weapons, & SCM tuning crashers (RPC 96)
22AEGIS_CHEAT_SPECTATE_HACKSpectate HackRakNetKICK1Blocks unauthorized ID_SPECTATOR_SYNC (212) when server spectating flag is false
23AEGIS_CHEAT_WALLSHOTWallshot / Shoot-ThroughColAndreasKICK3Dual-ray (chest + head) CA_RayCastLine validation on OnPlayerWeaponShot
24AEGIS_CHEAT_NOCLIPNoclip / Wall-WalkColAndreasKICK3Dual-height CA_RayCastLine between previous & current player positions
25AEGIS_CHEAT_WATER_WALKWater Walk / Drive-On-WaterColAndreasKICK3Downward WATER_OBJECT raycast under moving non-boat / non-amphibious ground vehicles

Platform & Plugin Compatibility

Dependencyopen.mpSA:MP 0.3.7 / 0.3.DLRequirement
openmultiplayer/omp-stdlib or a_sampRequiredRequiredCore stdlib
katursis/Pawn.RakNetRequiredRequiredBinary plugin in plugins/ + Pawn.RakNet.inc
Pottus/ColAndreasRequiredRequiredBinary plugin in plugins/ + scriptfiles/colandreas/ColAndreas.cadb
oscar-broman/samp-weapon-configRequiredRequiredweapon-config.inc
oscar-broman/SKYDo not includeOptional (Recommended)SA:MP-only C++ plugin; auto-activated when #include <SKY> is present

Important Runtime Note for open.mp: oscar-broman/SKY is a C++ memory-patching plugin built specifically for SA:MP 0.3.7 / 0.3.DL (samp-server). Do not include <SKY> when deploying on omp-server, otherwise the server will fail to load the .amx with Run time error 19. On open.mp, omp-aegis automatically runs its pure Pawn.RakNet quarantine and packet rate limiter with zero SKY dependency.


Installation

Method 1: sampctl (Recommended)

sampctl package install RaihanPrnwd/omp-aegis

Or add to your pawn.json:

{
  "dependencies": [
    "openmultiplayer/omp-stdlib",
    "katursis/Pawn.RakNet",
    "Pottus/ColAndreas",
    "oscar-broman/samp-weapon-config",
    "RaihanPrnwd/omp-aegis"
  ]
}

Method 2: Manual Setup

  1. Download or clone this repository and place include/omp_aegis.inc into your server's include/ (or qawno/include/) folder.
  2. Install the required dependency includes (Pawn.RakNet.inc, colandreas.inc, weapon-config.inc, and optionally SKY.inc on SA:MP 0.3.7/0.3.DL).
  3. Install the required binary plugins into your server's plugins/ directory:
    • pawnraknet.dll / pawnraknet.so
    • ColAndreas.dll / ColAndreas_static.so
    • Place ColAndreas.cadb inside scriptfiles/colandreas/ColAndreas.cadb
    • (SA:MP 0.3.7/0.3.DL only, optional) SKY.dll / SKY.so
  4. Register the plugins in your server config:
    • open.mp (config.json):
      "pawn": {
        "legacy_plugins": [
          "pawnraknet",
          "ColAndreas"
        ],
        "main_scripts": [
          "aegis_example"
        ]
      }
      
    • SA:MP (server.cfg):
      plugins pawnraknet ColAndreas SKY
      gamemode0 aegis_example 1
      

Quick Start

Gamemode Integration (Recommended)

Including <omp_aegis> directly in your gamemode is the strongest setup because all ALS native hooks (GivePlayerMoney, GivePlayerWeapon, SetPlayerPos, PutPlayerInVehicle, RepairVehicle, etc.) intercept your gamemode's calls automatically with zero false positives.

See the full runnable example at examples/gamemode_example.pwn.

#include <open.mp>
#include <Pawn.RakNet>
#include <colandreas>
#include <weapon-config>

// Optional: override thresholds before including omp_aegis
#define AEGIS_MAX_PING              (350)
#define AEGIS_DEFAULT_GRACE_MS      (2000)

#include <omp_aegis>

public OnGameModeInit()
{
    Aegis_SetCbugAllowed(false);
    Aegis_SetCheatAction(AEGIS_CHEAT_CRASHER, AEGIS_ACTION_BAN);
    Aegis_SetCheatMaxStrikes(AEGIS_CHEAT_WALLSHOT, 3);
    return 1;
}

public OnAegisCheatDetected(playerid, AEGIS_CHEAT:cheat, strikes, maxStrikes, const details[])
{
    new name[MAX_PLAYER_NAME], cheatName[32];
    GetPlayerName(playerid, name, sizeof(name));
    Aegis_GetCheatName(cheat, cheatName, sizeof(cheatName));

    printf("[Aegis] %s (%d) | %s (%d/%d) | %s", name, playerid, cheatName, strikes, maxStrikes, details);

    // Return 1 to let Aegis apply its configured action (WARN/REVERT/KICK/BAN + quarantine).
    // Return 0 to suppress Aegis's automatic action and handle it yourself.
    return 1;
}

Standalone Filterscript

If you want to drop Aegis onto an existing server without recompiling your gamemode, compile and load filterscripts/omp_aegis_fs.pwn:

"pawn": {
  "side_scripts": [
    "omp_aegis_fs"
  ]
}

Note: In standalone filterscript mode, gamemode calls to GivePlayerMoney / GivePlayerWeapon cross AMX boundaries and cannot be ALS-hooked automatically, so omp_aegis_fs.pwn defaults MONEY, WEAPON, and AMMO to AEGIS_ACTION_WARN while keeping all RakNet crashers, combat checks, Aimbot/Silent Aim, Wallshot, Noclip, Airbreak, Teleport, Speed, Jetpack, Car Troll, and Dialog Spoof protections fully active.


Compile-Time Configuration

Define any of these macros before #include <omp_aegis> to tune sensitivity for your server:

MacroDefaultDescription
AEGIS_MAX_PING350Skip latency-sensitive behavioral checks when ping exceeds this value (ms)
AEGIS_DEFAULT_GRACE_MS2000Default grace window after server teleports, spawns, and state changes (ms)
AEGIS_SYNC_INTERVAL_MS200Minimum interval between periodic physics checks in OnPlayerUpdate (ms)
AEGIS_STRIKE_DECAY_MS30000Time window after which accumulated strikes reset to 0 (ms)
AEGIS_KICK_DELAY_MS150Deferred kick/ban delay so client messages arrive before disconnect (ms)
AEGIS_ONFOOT_MAX_SPEED0.75Max allowed horizontal on-foot velocity magnitude
AEGIS_VEH_MAX_SPEED2.85Max allowed ground vehicle 3D velocity magnitude
AEGIS_AIRCRAFT_MAX_SPEED3.90Max allowed aircraft 3D velocity magnitude
AEGIS_TELEPORT_ONFOOT_DIST35.0Max on-foot 2D displacement per second before flagging teleport
AEGIS_TELEPORT_VEH_DIST110.0Max vehicle 2D displacement per second before flagging teleport
AEGIS_CAR_TROLL_MAX_DIST22.0Max unoccupied vehicle displacement per update
AEGIS_CAR_TROLL_MAX_VEL1.65Max unoccupied vehicle velocity magnitude
AEGIS_CAR_TROLL_MAX_ANGVEL5.0Max unoccupied/trailer angular velocity magnitude
AEGIS_AIM_MIN_DOT0.65Minimum camera-to-target dot product (~49.5 deg cone) at >= 8m
AEGIS_MAX_PACKETS_PER_SEC180Max incoming sync packets per second per player
AEGIS_MAX_RPCS_PER_SEC45Max monitored incoming RPCs per second per player
AEGIS_FAKE_KILL_WINDOW_MS4000Rapid death burst window for fake-kill detection (ms)
AEGIS_COL_WORLD_ZERO_ONLY1Restrict ColAndreas raycasts to virtualWorld == 0 (0 = all worlds)
AEGIS_COL_AIRBREAK_HEIGHT4.5Height above ground (m) required before flagging 3D airbreak
AEGIS_COL_WALLSHOT_MIN_DIST6.0Minimum shooter-to-target distance (m) for wallshot raycasts
AEGIS_COL_WALLSHOT_MARGIN1.75Distance margin before target (m) to prevent corner-peek false positives
AEGIS_SKY_INVALID_THRESHOLD5SKY invalid packets threshold before C++ timeout
AEGIS_SKY_INVALID_TIMEOUT_MS30000SKY invalid packet timeout duration (ms)
AEGIS_SKY_RATE_LIMIT_MAX180SKY global packet rate limit cap
AEGIS_SKY_RATE_LIMIT_WINDOW_MS1000SKY global packet rate limit window (ms)
AEGIS_SKY_DISABLE_SYNC_BUGS1Enable SKY sync bug patches (1 = on)
AEGIS_SKY_ALLOW_KNIFE_SYNC0Allow stealth-knife sync (0 = blocked)

Callback Reference

forward OnAegisCheatDetected(playerid, AEGIS_CHEAT:cheat, strikes, maxStrikes, const details[]);
ParameterTypeDescription
playeridintID of the flagged player
cheatAEGIS_CHEATDetection enum (AEGIS_CHEAT_MONEY .. AEGIS_CHEAT_WATER_WALK)
strikesintCurrent strike count within the decay window
maxStrikesintConfigured strike threshold for this cheat
detailsconst[]Diagnostic evidence string (e.g., wallshot obj=4550 wallDist=12.4 targetDist=31.0)
Returnint1 = allow Aegis action; 0 = suppress Aegis action (custom handling)

Public API Reference

Policy Management

Aegis_SetCheatEnabled(AEGIS_CHEAT:cheat, bool:enabled);
bool:Aegis_IsCheatEnabled(AEGIS_CHEAT:cheat);

Aegis_SetCheatAction(AEGIS_CHEAT:cheat, AEGIS_ACTION:action);
AEGIS_ACTION:Aegis_GetCheatAction(AEGIS_CHEAT:cheat);
// Actions: AEGIS_ACTION_NONE, AEGIS_ACTION_WARN, AEGIS_ACTION_REVERT, AEGIS_ACTION_KICK, AEGIS_ACTION_BAN

Aegis_SetCheatMaxStrikes(AEGIS_CHEAT:cheat, strikes);
Aegis_GetCheatMaxStrikes(AEGIS_CHEAT:cheat);

Aegis_GetCheatName(AEGIS_CHEAT:cheat, output[], size = sizeof(output));

Player Control & Inspection

Aegis_SetPlayerExempt(playerid, bool:exempt);          // Whitelist admins or minigame players
bool:Aegis_IsPlayerExempt(playerid);

Aegis_QuarantinePlayer(playerid, bool:toggle);         // Drop all sync packets (+ SKY FreezeSyncPacket)
bool:Aegis_IsPlayerQuarantined(playerid);

Aegis_SetPlayerGrace(playerid, ms);                    // Temporary sync grace window
Aegis_GetPlayerStrikes(playerid, AEGIS_CHEAT:cheat);
Aegis_ResetPlayerStrikes(playerid);
Aegis_ResetPlayer(playerid);
Aegis_GetPlayerMoney(playerid);                        // Authoritative server-side balance

Subsystem Bridges

Aegis_SetCbugAllowed(bool:allowed, playerid = INVALID_PLAYER_ID);  // weapon-config C-bug bridge
bool:Aegis_IsColAndreasReady();                                    // true if CA_Init() succeeded
bool:Aegis_IsSkyActive();                                          // true if compiled with <SKY>
Aegis_ConfigureSky(invalidThreshold, invalidTimeoutMs, rateMax, rateWindowMs, bool:disableSyncBugs = true, bool:allowKnifeSync = false);

Filterscript Commands & Remote Bridges

Built-In RCON Admin Commands (omp_aegis_fs.pwn)

CommandDescription
/aegisList available anti-cheat admin commands
/aegisstatusShow active status of RakNet, weapon-config, ColAndreas, and SKY
/aegisexempt <playerid>Toggle anti-cheat exemption for a player
/aegisquarantine <playerid>Toggle instant sync quarantine for a player
/aegistoggle <0-25>Enable or disable a specific cheat module at runtime
/aegiscbug <0|1>Block (0) or allow (1) C-bug globally

Cross-AMX Remote Bridges (CallRemoteFunction)

// From your gamemode when running omp_aegis_fs as a filterscript:
CallRemoteFunction("AegisFS_ExemptPlayer", "ii", playerid, 1);
CallRemoteFunction("AegisFS_GrantGrace", "ii", playerid, 2500);
CallRemoteFunction("AegisFS_QuarantinePlayer", "ii", playerid, 1);
CallRemoteFunction("AegisFS_SetCheatEnabled", "ii", _:AEGIS_CHEAT_WALLSHOT, 1);

Repository Structure

Read the rest on GitHub

anti-cheatanticheatcolandreasgame-servergta-saopenmpopenmp-includepawnpawn-raknetsampsamp-includesampctlskyweapon-config

This page is built from what GitHub publishes about the repository. samp.directory does not host the code. Report a problem with this listing

RaihanPrnwd/omp-aegis: SA-MP Filterscript | samp.directory