• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] omp-aegis v1.0.0 - 4-Layer Server-Side Anti-Cheat (open.mp & SA:MP)
#1
omp-aegis
Authoritative 4-Layer Server-Side Anti-Cheat Include & Filterscript for open.mp & SA:MP

GitHub Repository | Full Documentation | Version: 1.0.0 | License: MIT



Overview

omp-aegis is a modular, drop-in server-side anti-cheat library (and optional standalone filterscript) built for open.mp and SA:MP 0.3.7 / 0.3.DL.

Instead of relying solely on periodic timers or client-reported stats, it combines four distinct validation layers—pre-engine RakNet packet filtering, server-side combat authority, ALS-hooked state tracking, and 3D world collision raycasting—into a single include with full ALS native and callback chaining.



4-Layer Architecture

  1. Layer 1 — Pre-Engine Packet Firewall (Pawn.RakNet): Inspects 10 sync packets and 10+ RPCs before the server broadcasts them to other players. Drops crashers, floods, and spoofed syncs at the network layer using an isolated @aegis handler namespace so it never conflicts with weapon-config's @default handlers.
  2. Layer 2 — Server-Side Combat Authority (samp-weapon-config): Enforces health, armour, and weapon damage 100% server-side. Routes OnRejectedHit and OnInvalidWeaponDamage violations directly into Aegis strikes alongside camera-vector aimbot cone checks.
  3. Layer 3 — Authoritative State & Physics (ALS Hooks): Hooks core natives (GivePlayerMoney, GivePlayerWeapon, SetPlayerPos, PutPlayerInVehicle, RepairVehicle, etc.) with configurable grace windows and strike decay to minimize false positives.
  4. Layer 4 — 3D Collision Verification (ColAndreas): Uses real San Andreas map geometry raycasts for dual-ray anti-wallshot, dual-height anti-noclip, true ground-elevation airbreak/fly detection, swim-in-air checks, and drive-on-water checks.
  5. Optional Layer (SA:MP 0.3.7 / 0.3.DL only — SKY): Automatically enables C++ invalid-packet timeouts, global packet rate limits, sync bug patches, stealth-knife blocking, and FreezeSyncPacket quarantine when <SKY> is included.



26 Built-In Protection Modules

Combat, Stats & Inventory
  • Money Hack — ID_STATS_UPDATE validation against ALS-tracked server balance.
  • Health & Armour Spoof — Server-side enforcement via weapon-config + ID_PLAYER_SYNC verification.
  • Weapon Hack — All 13 weapon slots verified via ID_WEAPONS_UPDATE, GetPlayerWeapon, and HIT_INVALID_WEAPON (auto-credits police shotgun, caddy golf club, and aircraft parachute).
  • Ammo Hack — Per-slot server ammo tracking + frozen/infinite ammo detection.
  • Rapid Fire — weapon-config fire/hit rate checks + per-weapon minimum inter-shot interval floor.
  • Silent Aim / Invalid Hit — Bullet origin validation (ID_BULLET_SYNC), out-of-range, unstreamed, multi-hit, and hit offset bounds.
  • Aimbot / ProAim Cone — Dot-product validation between ID_AIM_SYNC camera front vector and target vector.
  • Damage Spoof — Invalid damage, distance, and unspawned hit validation via weapon-config.

Movement & 3D World (ColAndreas)
  • Teleport Hack — Scaled 2D displacement delta (on-foot & in-vehicle) with server-teleport/spawn/interior grace windows.
  • Airbreak / Fly Hack — CA_IsPlayerOnSurface, 40m ground raycast elevation, and CA_IsPlayerInWater swim-in-air checks.
  • Speed Hack — Separate velocity caps for on-foot, ground vehicles, and aircraft with velocity-native grace.
  • Jetpack Hack — Instant packet block in ID_PLAYER_SYNC + special action fallback.
  • Wallshot / Shoot-Through — Dual-ray (chest + head) CA_RayCastLine validation on OnPlayerWeaponShot.
  • Noclip / Wall-Walk — Dual-height CA_RayCastLine checks between previous and current player coordinates.
  • Water Walk / Drive-On-Water — Downward WATER_OBJECT raycast under moving non-boat/non-amphibious ground vehicles.

Vehicle & Sync Integrity
  • Vehicle Repair Hack — Server-side vehicle HP cache with mod-shop and native awareness.
  • Vehicle Jack / Warp — RPC_EnterVehicle distance validation + entry authorization.
  • Car Troll / Magnet — Pre-engine ID_UNOCCUPIED_SYNC velocity/spin filter + remote RPC_DamageVehicle protection.
  • Trailer Troll / Crasher — ID_TRAILER_SYNC velocity, angular velocity, quaternion, and ID checks.
  • Invisibility / Ghost Sync — Invalid surfingVehicleId detection in ID_PLAYER_SYNC.
  • Spectate Hack — Blocks unauthorized ID_SPECTATOR_SYNC packets.

Network & Exploits
  • Crasher / Malformed Packet — Blocks NaN/Inf/OOB floats, deformed quaternions, surf-offset crashers, seat/trailer/train crashers, invalid weapons, and SCM tuning crashers (RPC 96).
  • Packet / RPC Flood — Sliding 1-second packet and RPC rate limiter (+ optional SKY C++ limiter).
  • Fake Kill / Death Flood — Drops spoofed RPC_Death bursts before OnPlayerDeath or killfeed triggers.
  • Dialog Spoof — Matches outgoing RPC_ShowPlayerDialog ID against incoming RPC_DialogResponse.



Dependencies

Quote:Important Note for open.mp Users:
Do not include <SKY> when running on omp-server. SKY is a SA:MP-specific memory-patching plugin and will cause Run time error 19 on open.mp. Without SKY, omp-aegis automatically uses its pure Pawn.RakNet quarantine and packet rate limiter.



Installation

Via sampctl (Recommended):
Code:
sampctl package install RaihanPrnwd/omp-aegis

Manual Setup:
Place include/omp_aegis.inc into your include folder, install the dependency includes/plugins, and load pawnraknet and ColAndreas in config.json (legacy_plugins) or server.cfg.



Quick Start (Gamemode Integration)

Including <omp_aegis> directly in your gamemode is recommended so all ALS native hooks track server-side changes automatically:

Code:
#include <open.mp> #include <Pawn.RakNet> #include <colandreas> #include <weapon-config> // Optional: tune compile-time 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 execute Aegis's configured action (WARN / REVERT / KICK / BAN + quarantine).     // Return 0 to suppress the default action and handle it in your gamemode.     return 1; }

A ready-to-use standalone filterscript (filterscripts/omp_aegis_fs.pwn) with RCON admin commands (/aegis, /aegisstatus, /aegisexempt, /aegisquarantine, /aegistoggle, /aegiscbug) and CallRemoteFunction bridges is also included in the repository.



Runtime API Highlights

Code:
// Per-module policy control Aegis_SetCheatEnabled(AEGIS_CHEAT:cheat, bool:enabled); Aegis_SetCheatAction(AEGIS_CHEAT:cheat, AEGIS_ACTION:action); // NONE, WARN, REVERT, KICK, BAN Aegis_SetCheatMaxStrikes(AEGIS_CHEAT:cheat, strikes); Aegis_GetCheatName(AEGIS_CHEAT:cheat, output[], size = sizeof(output)); // Player control & inspection Aegis_SetPlayerExempt(playerid, bool:exempt);      // Whitelist admins or minigames Aegis_QuarantinePlayer(playerid, bool:toggle);      // Drop all sync packets (+ SKY freeze) Aegis_SetPlayerGrace(playerid, ms);                // Temporary sync grace window Aegis_GetPlayerStrikes(playerid, AEGIS_CHEAT:cheat); Aegis_ResetPlayerStrikes(playerid); Aegis_GetPlayerMoney(playerid); // Subsystem bridges Aegis_SetCbugAllowed(bool:allowed, playerid = INVALID_PLAYER_ID); bool:Aegis_IsColAndreasReady(); bool:Aegis_IsSkyActive();

Full compile-time macro list, runnable example, and self-check suite are documented in the README.



Security Scope & Limitations

omp-aegis is strictly a server-side anti-cheat. It covers cheat vectors verifiable through network packets, authoritative server state, combat physics, and 3D map geometry. Purely client-side visual modifications (such as ESP/nametag wallhacks or subtle aim assist staying within natural camera cones) cannot be reliably detected from server packets alone without a dedicated client-side anti-cheat.



Download & Source

Credits
  • open.mp team — open.mp & omp-stdlib
  • katursis — Pawn.RakNet
  • oscar-broman (Slice) — samp-weapon-config & SKY
  • Pottus, Chris420, Slice & contributors — ColAndreas
  Reply


Messages In This Thread
omp-aegis v1.0.0 - 4-Layer Server-Side Anti-Cheat (open.mp & SA:MP) - by Raihanprnwd - 31 minutes ago