Initial release 1.0.0
Browse Source1.0.0 - Initial release.
4 changed files
with 160 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_speedhack_detect.sma
+110 -0
A
csb.json
+46 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2026-02-08) | |
| 2 | + | |
| 3 | +1.0.0 - Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p><strong>CSB Speedhack Detection</strong> watches the one thing a client-side speedhack cannot hide: it makes the client send far more usercmds per second than the engine should ever process. The plugin counts usercmds from the <code>CmdStart</code> forward and, once a second, compares each player's rate to a configurable ceiling. A single spike is ignored; a sustained rate over several strikes is treated as a hack.</p><h2>How it works</h2><ul><li>Every usercmd increments a per-player frame counter.</li><li>A 1-second repeating task reads and clears each counter.</li><li>A count above <code>csb_speed_maxcmds</code> adds a strike; a clean second removes one.</li><li>Reaching <code>csb_speed_strikes</code> logs the player and, with <code>csb_speed_action 1</code>, kicks them.</li></ul><h2>Tuning</h2><p>The default ceiling of 350 usercmds/s sits well above a legitimate 250 fps player but far below what a speedhack produces. Raise it if your community runs uncapped high-fps configs.</p><h2>Installation</h2><ol><li>Enable the <code>fakemeta</code> module in <code>modules.ini</code>.</li><li>Compile <code>csb_speedhack_detect.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change the map.</li></ol> |
addons/amxmodx/scripting/csb_speedhack_detect.sma
A
| @@ -0,0 +1,110 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Speedhack Detection | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * Counts usercmd frames per real second (from CmdStart) and compares them to a | |
| 6 | + * sane ceiling. A speedhack inflates the command rate; sustained excess over | |
| 7 | + * several strikes is logged and optionally kicked. | |
| 8 | + * | |
| 9 | + * This program is free software: you can redistribute it and/or modify it under | |
| 10 | + * the terms of the GNU General Public License as published by the Free Software | |
| 11 | + * Foundation, either version 3 of the License, or (at your option) any later | |
| 12 | + * version. It is distributed in the hope that it will be useful, but WITHOUT | |
| 13 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
| 14 | + * FOR A PARTICULAR PURPOSE. See <https://www.gnu.org/licenses/> for details. | |
| 15 | + */ | |
| 16 | + | |
| 17 | +#include <amxmodx> | |
| 18 | +#include <fakemeta> | |
| 19 | + | |
| 20 | +new const PLUGIN[] = "CSB Speedhack Detection" | |
| 21 | +new const VERSION[] = "1.0.0" | |
| 22 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 23 | + | |
| 24 | +new g_pEnabled, g_pMaxCmds, g_pStrikes, g_pAction | |
| 25 | + | |
| 26 | +new g_iFrames[33] | |
| 27 | +new g_iStrikes[33] | |
| 28 | + | |
| 29 | +public plugin_init() | |
| 30 | +{ | |
| 31 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 32 | + | |
| 33 | + g_pEnabled = register_cvar("csb_speed_enabled", "1") | |
| 34 | + g_pMaxCmds = register_cvar("csb_speed_maxcmds", "350") | |
| 35 | + g_pStrikes = register_cvar("csb_speed_strikes", "3") | |
| 36 | + g_pAction = register_cvar("csb_speed_action", "0") | |
| 37 | + | |
| 38 | + register_forward(FM_CmdStart, "fwCmdStart") | |
| 39 | + set_task(1.0, "taskCheck", 0, _, _, "b") | |
| 40 | +} | |
| 41 | + | |
| 42 | +public client_putinserver(id) | |
| 43 | +{ | |
| 44 | + g_iFrames[id] = 0 | |
| 45 | + g_iStrikes[id] = 0 | |
| 46 | +} | |
| 47 | + | |
| 48 | +public fwCmdStart(id) | |
| 49 | +{ | |
| 50 | + if (id >= 1 && id <= 32) | |
| 51 | + g_iFrames[id]++ | |
| 52 | + | |
| 53 | + return FMRES_IGNORED | |
| 54 | +} | |
| 55 | + | |
| 56 | +public taskCheck() | |
| 57 | +{ | |
| 58 | + if (!get_pcvar_num(g_pEnabled)) | |
| 59 | + return | |
| 60 | + | |
| 61 | + new maxCmds = get_pcvar_num(g_pMaxCmds) | |
| 62 | + new maxStrikes = get_pcvar_num(g_pStrikes) | |
| 63 | + | |
| 64 | + new players[32], num | |
| 65 | + get_players(players, num, "c") // connected humans only | |
| 66 | + | |
| 67 | + for (new i = 0; i < num; i++) | |
| 68 | + { | |
| 69 | + new id = players[i] | |
| 70 | + new frames = g_iFrames[id] | |
| 71 | + g_iFrames[id] = 0 | |
| 72 | + | |
| 73 | + if (frames > maxCmds) | |
| 74 | + { | |
| 75 | + g_iStrikes[id]++ | |
| 76 | + | |
| 77 | + log_amx("[CSB Speed] %d usercmds/s from slot %d (strike %d/%d)", frames, id, g_iStrikes[id], maxStrikes) | |
| 78 | + | |
| 79 | + if (g_iStrikes[id] >= maxStrikes) | |
| 80 | + { | |
| 81 | + punish(id, frames) | |
| 82 | + g_iStrikes[id] = 0 | |
| 83 | + } | |
| 84 | + } | |
| 85 | + else if (g_iStrikes[id] > 0) | |
| 86 | + { | |
| 87 | + // decay: one clean second forgives one strike | |
| 88 | + g_iStrikes[id]-- | |
| 89 | + } | |
| 90 | + } | |
| 91 | +} | |
| 92 | + | |
| 93 | +punish(id, frames) | |
| 94 | +{ | |
| 95 | + new name[32], authid[35] | |
| 96 | + get_user_name(id, name, charsmax(name)) | |
| 97 | + get_user_authid(id, authid, charsmax(authid)) | |
| 98 | + | |
| 99 | + log_amx("[CSB Speed] speedhack confirmed for %s <%s> (%d usercmds/s)", name, authid, frames) | |
| 100 | + | |
| 101 | + if (get_pcvar_num(g_pAction) == 1) | |
| 102 | + { | |
| 103 | + server_cmd("kick #%d ^"CSB: speedhack detected^"", get_user_userid(id)) | |
| 104 | + server_exec() | |
| 105 | + } | |
| 106 | + else | |
| 107 | + { | |
| 108 | + client_print(0, print_chat, "[CSB] %s is suspected of using a speedhack.", name) | |
| 109 | + } | |
| 110 | +} |
csb.json
A
| @@ -0,0 +1,46 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Speedhack Detection", | |
| 3 | + "category": "anticheat", | |
| 4 | + "tags": "speedhack, detection, timing", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Speedhack Detection", | |
| 10 | + "short_desc": "Counts usercmds per real second and flags players whose command rate stays impossibly high.", | |
| 11 | + "version": "1.0.0", | |
| 12 | + "amxx_min": "1.9", | |
| 13 | + "amxx_compile_default": "1.9", | |
| 14 | + "rehlds_ok": true, | |
| 15 | + "hlds_ok": true, | |
| 16 | + "regamedll_required": false, | |
| 17 | + "metamod_flavor": "any", | |
| 18 | + "reapi_required": false, | |
| 19 | + "modules": "fakemeta", | |
| 20 | + "install_notes": "1. Enable the fakemeta module in addons/amxmodx/configs/modules.ini\n2. Put csb_speedhack_detect.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map", | |
| 21 | + "known_conflicts": "Extreme-fps or fps_override setups can approach the ceiling; raise csb_speed_maxcmds to avoid false strikes.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_speed_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Enable speedhack detection." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_speed_maxcmds", | |
| 30 | + "default": "350", | |
| 31 | + "description": "Usercmds per second above which a strike is counted." | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "name": "csb_speed_strikes", | |
| 35 | + "default": "3", | |
| 36 | + "description": "Strikes before the player is punished." | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "name": "csb_speed_action", | |
| 40 | + "default": "0", | |
| 41 | + "description": "0 = log + announce, 1 = kick." | |
| 42 | + } | |
| 43 | + ], | |
| 44 | + "commands": [], | |
| 45 | + "main": "addons/amxmodx/scripting/csb_speedhack_detect.sma" | |
| 46 | +} | |
| 0 | 47 |









