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.
Установка через sampctl
sampctl package install RaihanPrnwd/omp-aegis
Выполните в папке проекта. sampctl скачает пакет и его зависимости.
Зависит от 4 пакетов
- openmultiplayer/omp-stdlib★ 54
- katursis/Pawn.RakNet★ 186
- pottus/colandreasнет в этом каталоге
- oscar-broman/samp-weapon-config★ 116
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
- Features & 26 Protection Modules
- Platform & Plugin Compatibility
- Installation
- Quick Start
- Compile-Time Configuration
- Callback Reference
- Public API Reference
- Filterscript Commands & Remote Bridges
- Repository Structure
- Compiling & Self-Check
- Security Scope & Limitations
- Credits & License
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?
- 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@aegishandler namespace so it never collides withweapon-config's@defaulthandlers. - 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). AllOnRejectedHitandOnInvalidWeaponDamageviolations pipe directly into Aegis strikes alongside camera-vector Aimbot cone validation. - 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. - Optional C++ Hardening (
oscar-broman/SKYon SA:MP 0.3.7/0.3.DL) — Automatically enables C++ invalid-packet timeouts, global packet rate limits, sync bug patches, stealth-knife disabling, andFreezeSyncPacket(playerid, E_ALL_SYNC, true)cheater quarantine when<SKY>is included.
Features & 26 Protection Modules
| ID | Enum Constant | Display Name | Primary Layer | Default Action | Default Strikes | Detection Mechanism |
|---|---|---|---|---|---|---|
| 0 | AEGIS_CHEAT_MONEY | Money Hack | RakNet + State | REVERT | 2 | ID_STATS_UPDATE (205) + authoritative ALS money hooks |
| 1 | AEGIS_CHEAT_HEALTH_SPOOF | Health Spoof | weapon-config | WARN | 3 | Server-side HP enforced by weapon-config |
| 2 | AEGIS_CHEAT_ARMOUR_SPOOF | Armour Spoof | RakNet + WC | WARN | 3 | ID_PLAYER_SYNC armour vs WC_GetPlayerArmour |
| 3 | AEGIS_CHEAT_WEAPON | Weapon Hack | RakNet + State + WC | KICK | 1 | All 13 slots inspected in ID_WEAPONS_UPDATE (204), GetPlayerWeapon, & HIT_INVALID_WEAPON; auto-credits police shotgun, caddy golf club & aircraft parachute |
| 4 | AEGIS_CHEAT_AMMO | Ammo Hack | RakNet + State | KICK | 3 | Per-slot server ammo tracking in ID_WEAPONS_UPDATE (204) + frozen/infinite ammo shot counter |
| 5 | AEGIS_CHEAT_RAPID_FIRE | Rapid Fire | weapon-config + Shot | KICK | 3 | SHOOTING_RATE_TOO_FAST / HIT_RATE_TOO_FAST + per-weapon min inter-shot interval floor |
| 6 | AEGIS_CHEAT_SILENT_AIM | Silent Aim / Invalid Hit | RakNet + WC + Shot | KICK | 3 | Remote bullet origin check (ID_BULLET_SYNC), HIT_TOO_FAR_FROM_SHOT, HIT_OUT_OF_RANGE, HIT_MULTIPLE_PLAYERS, HIT_UNSTREAMED, & hit offset bounds |
| 7 | AEGIS_CHEAT_AIMBOT | Aimbot / ProAim Cone | RakNet + Shot | KICK | 4 | Dot product between ID_AIM_SYNC camFrontVec and normalized vector to hit player (dist >= 8.0m, dot < 0.65) |
| 8 | AEGIS_CHEAT_DAMAGE_SPOOF | Damage Spoof | weapon-config | KICK | 2 | OnInvalidWeaponDamage (WC_INVALID_DAMAGE, WC_INVALID_DISTANCE) & HIT_INVALID_DAMAGE / HIT_NOT_SPAWNED |
| 9 | AEGIS_CHEAT_TELEPORT | Teleport Hack | Physics + ALS | KICK | 2 | Scaled 2D displacement delta (on-foot & in-vehicle) with server-teleport/spawn/interior grace windows |
| 10 | AEGIS_CHEAT_AIRBREAK | Airbreak / Fly Hack | ColAndreas + Physics | KICK | 3 | CA_IsPlayerOnSurface + 40m ground raycast height + CA_IsPlayerInWater swim-in-air verification |
| 11 | AEGIS_CHEAT_SPEED_HACK | Speed Hack | Physics + ALS | KICK | 3 | Separate velocity caps for on-foot, ground vehicles, and aircraft with SetPlayerVelocity / SetVehicleVelocity grace |
| 12 | AEGIS_CHEAT_JETPACK | Jetpack Hack | RakNet + State | KICK | 1 | Instant packet block in ID_PLAYER_SYNC (207) + GetPlayerSpecialAction fallback |
| 13 | AEGIS_CHEAT_VEHICLE_REPAIR | Vehicle Repair Hack | State + ALS | REVERT | 2 | Server vehicle HP cache with RepairVehicle, SetVehicleHealth, & OnEnterExitModShop awareness |
| 14 | AEGIS_CHEAT_VEHICLE_JACK | Vehicle Jack / Warp | RakNet + State | KICK | 2 | RPC_EnterVehicle (26) distance check + OnPlayerStateChange entry authorization |
| 15 | AEGIS_CHEAT_CAR_TROLL | Car Troll / Magnet | RakNet + Callback | REVERT | 2 | Pre-engine ID_UNOCCUPIED_SYNC (209) velocity/spin blocker + RPC_DamageVehicle (106) remote damage blocker |
| 16 | AEGIS_CHEAT_TRAILER_TROLL | Trailer Troll / Crasher | RakNet | KICK | 1 | ID_TRAILER_SYNC (210) velocity, angular velocity, quaternion & ID validation |
| 17 | AEGIS_CHEAT_INVISIBLE | Invisibility / Ghost Sync | RakNet | KICK | 2 | Invalid surfingVehicleId detection in ID_PLAYER_SYNC (207) |
| 18 | AEGIS_CHEAT_FAKE_KILL | Fake Kill / Death Flood | RakNet | KICK | 2 | RPC_Death (53) burst filter drops spoofed deaths before OnPlayerDeath or killfeed triggers |
| 19 | AEGIS_CHEAT_DIALOG_SPOOF | Dialog Spoof | RakNet | KICK | 1 | Authoritative outgoing RPC_ShowPlayerDialog (61) ID matched against incoming RPC_DialogResponse (62) |
| 20 | AEGIS_CHEAT_PACKET_FLOOD | Packet / RPC Flood | RakNet (+ SKY) | KICK | 2 | Sliding 1-second packet (180/s) & RPC (45/s) rate limiter |
| 21 | AEGIS_CHEAT_CRASHER | Crasher / Malformed Packet | RakNet | BAN | 1 | NaN/Inf/OOB floats, deformed quaternions, surf offset crashers, seat/trailer/train crashers, invalid weapons, & SCM tuning crashers (RPC 96) |
| 22 | AEGIS_CHEAT_SPECTATE_HACK | Spectate Hack | RakNet | KICK | 1 | Blocks unauthorized ID_SPECTATOR_SYNC (212) when server spectating flag is false |
| 23 | AEGIS_CHEAT_WALLSHOT | Wallshot / Shoot-Through | ColAndreas | KICK | 3 | Dual-ray (chest + head) CA_RayCastLine validation on OnPlayerWeaponShot |
| 24 | AEGIS_CHEAT_NOCLIP | Noclip / Wall-Walk | ColAndreas | KICK | 3 | Dual-height CA_RayCastLine between previous & current player positions |
| 25 | AEGIS_CHEAT_WATER_WALK | Water Walk / Drive-On-Water | ColAndreas | KICK | 3 | Downward WATER_OBJECT raycast under moving non-boat / non-amphibious ground vehicles |
Platform & Plugin Compatibility
| Dependency | open.mp | SA:MP 0.3.7 / 0.3.DL | Requirement |
|---|---|---|---|
openmultiplayer/omp-stdlib or a_samp | Required | Required | Core stdlib |
katursis/Pawn.RakNet | Required | Required | Binary plugin in plugins/ + Pawn.RakNet.inc |
Pottus/ColAndreas | Required | Required | Binary plugin in plugins/ + scriptfiles/colandreas/ColAndreas.cadb |
oscar-broman/samp-weapon-config | Required | Required | weapon-config.inc |
oscar-broman/SKY | Do not include | Optional (Recommended) | SA:MP-only C++ plugin; auto-activated when #include <SKY> is present |
Important Runtime Note for open.mp:
oscar-broman/SKYis a C++ memory-patching plugin built specifically for SA:MP 0.3.7 / 0.3.DL (samp-server). Do not include<SKY>when deploying onomp-server, otherwise the server will fail to load the.amxwithRun time error 19. On open.mp,omp-aegisautomatically runs its purePawn.RakNetquarantine 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
- Download or clone this repository and place
include/omp_aegis.incinto your server'sinclude/(orqawno/include/) folder. - Install the required dependency includes (
Pawn.RakNet.inc,colandreas.inc,weapon-config.inc, and optionallySKY.incon SA:MP 0.3.7/0.3.DL). - Install the required binary plugins into your server's
plugins/directory:pawnraknet.dll/pawnraknet.soColAndreas.dll/ColAndreas_static.so- Place
ColAndreas.cadbinsidescriptfiles/colandreas/ColAndreas.cadb - (SA:MP 0.3.7/0.3.DL only, optional)
SKY.dll/SKY.so
- 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
- open.mp (
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/GivePlayerWeaponcross AMX boundaries and cannot be ALS-hooked automatically, soomp_aegis_fs.pwndefaultsMONEY,WEAPON, andAMMOtoAEGIS_ACTION_WARNwhile 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:
| Macro | Default | Description |
|---|---|---|
AEGIS_MAX_PING | 350 | Skip latency-sensitive behavioral checks when ping exceeds this value (ms) |
AEGIS_DEFAULT_GRACE_MS | 2000 | Default grace window after server teleports, spawns, and state changes (ms) |
AEGIS_SYNC_INTERVAL_MS | 200 | Minimum interval between periodic physics checks in OnPlayerUpdate (ms) |
AEGIS_STRIKE_DECAY_MS | 30000 | Time window after which accumulated strikes reset to 0 (ms) |
AEGIS_KICK_DELAY_MS | 150 | Deferred kick/ban delay so client messages arrive before disconnect (ms) |
AEGIS_ONFOOT_MAX_SPEED | 0.75 | Max allowed horizontal on-foot velocity magnitude |
AEGIS_VEH_MAX_SPEED | 2.85 | Max allowed ground vehicle 3D velocity magnitude |
AEGIS_AIRCRAFT_MAX_SPEED | 3.90 | Max allowed aircraft 3D velocity magnitude |
AEGIS_TELEPORT_ONFOOT_DIST | 35.0 | Max on-foot 2D displacement per second before flagging teleport |
AEGIS_TELEPORT_VEH_DIST | 110.0 | Max vehicle 2D displacement per second before flagging teleport |
AEGIS_CAR_TROLL_MAX_DIST | 22.0 | Max unoccupied vehicle displacement per update |
AEGIS_CAR_TROLL_MAX_VEL | 1.65 | Max unoccupied vehicle velocity magnitude |
AEGIS_CAR_TROLL_MAX_ANGVEL | 5.0 | Max unoccupied/trailer angular velocity magnitude |
AEGIS_AIM_MIN_DOT | 0.65 | Minimum camera-to-target dot product (~49.5 deg cone) at >= 8m |
AEGIS_MAX_PACKETS_PER_SEC | 180 | Max incoming sync packets per second per player |
AEGIS_MAX_RPCS_PER_SEC | 45 | Max monitored incoming RPCs per second per player |
AEGIS_FAKE_KILL_WINDOW_MS | 4000 | Rapid death burst window for fake-kill detection (ms) |
AEGIS_COL_WORLD_ZERO_ONLY | 1 | Restrict ColAndreas raycasts to virtualWorld == 0 (0 = all worlds) |
AEGIS_COL_AIRBREAK_HEIGHT | 4.5 | Height above ground (m) required before flagging 3D airbreak |
AEGIS_COL_WALLSHOT_MIN_DIST | 6.0 | Minimum shooter-to-target distance (m) for wallshot raycasts |
AEGIS_COL_WALLSHOT_MARGIN | 1.75 | Distance margin before target (m) to prevent corner-peek false positives |
AEGIS_SKY_INVALID_THRESHOLD | 5 | SKY invalid packets threshold before C++ timeout |
AEGIS_SKY_INVALID_TIMEOUT_MS | 30000 | SKY invalid packet timeout duration (ms) |
AEGIS_SKY_RATE_LIMIT_MAX | 180 | SKY global packet rate limit cap |
AEGIS_SKY_RATE_LIMIT_WINDOW_MS | 1000 | SKY global packet rate limit window (ms) |
AEGIS_SKY_DISABLE_SYNC_BUGS | 1 | Enable SKY sync bug patches (1 = on) |
AEGIS_SKY_ALLOW_KNIFE_SYNC | 0 | Allow stealth-knife sync (0 = blocked) |
Callback Reference
forward OnAegisCheatDetected(playerid, AEGIS_CHEAT:cheat, strikes, maxStrikes, const details[]);
| Parameter | Type | Description |
|---|---|---|
playerid | int | ID of the flagged player |
cheat | AEGIS_CHEAT | Detection enum (AEGIS_CHEAT_MONEY .. AEGIS_CHEAT_WATER_WALK) |
strikes | int | Current strike count within the decay window |
maxStrikes | int | Configured strike threshold for this cheat |
details | const[] | Diagnostic evidence string (e.g., wallshot obj=4550 wallDist=12.4 targetDist=31.0) |
| Return | int | 1 = 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)
| Command | Description |
|---|---|
/aegis | List available anti-cheat admin commands |
/aegisstatus | Show 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
anti-cheatanticheatcolandreasgame-servergta-saopenmpopenmp-includepawnpawn-raknetsampsamp-includesampctlskyweapon-config
Страница собрана из того, что GitHub публикует о репозитории. samp.directory не хранит этот код. Сообщить о проблеме с этой записью