/*
* CSB Bhop Script Detection
* Copyright (C) 2026 counter-strike-boost.com
*
* Flags scripted bunnyhopping by watching FL_ONGROUND transitions and +jump
* presses in PlayerPreThink: a run of frame-perfect jumps (jumping on the
* first ground frame every time) is not humanly repeatable, so it is logged.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version. It is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See for details.
*/
#include
#include
new const PLUGIN[] = "CSB Bhop Script Detection"
new const VERSION[] = "1.0.0"
new const AUTHOR[] = "counter-strike-boost.com"
new g_pEnabled, g_pPerfect, g_pAction
new bool:g_bOnGround[33]
new bool:g_bJumpHeld[33]
new g_iGroundFrames[33]
new g_iPerfect[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pEnabled = register_cvar("csb_bhop_enabled", "1")
g_pPerfect = register_cvar("csb_bhop_perfect", "12")
g_pAction = register_cvar("csb_bhop_action", "0")
register_forward(FM_PlayerPreThink, "fwPreThink")
}
public client_putinserver(id)
{
g_bOnGround[id] = false
g_bJumpHeld[id] = false
g_iGroundFrames[id] = 0
g_iPerfect[id] = 0
}
public fwPreThink(id)
{
if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id) || is_user_bot(id))
return FMRES_IGNORED
new bool:onGround = (pev(id, pev_flags) & FL_ONGROUND) != 0
new bool:jump = (pev(id, pev_button) & IN_JUMP) != 0
if (onGround)
{
// count how long we've been standing since we landed
if (!g_bOnGround[id])
g_iGroundFrames[id] = 0
else
g_iGroundFrames[id]++
// rising edge of the jump button while grounded
if (jump && !g_bJumpHeld[id])
{
if (g_iGroundFrames[id] <= 1)
{
g_iPerfect[id]++
if (g_iPerfect[id] >= get_pcvar_num(g_pPerfect))
flag(id)
}
else
{
g_iPerfect[id] = 0
}
}
}
g_bOnGround[id] = onGround
g_bJumpHeld[id] = jump
return FMRES_IGNORED
}
flag(id)
{
g_iPerfect[id] = 0
new name[32], authid[35]
get_user_name(id, name, charsmax(name))
get_user_authid(id, authid, charsmax(authid))
log_amx("[CSB Bhop] frame-perfect bunnyhop pattern from %s <%s>", name, authid)
if (get_pcvar_num(g_pAction) == 1)
{
server_cmd("kick #%d ^"CSB: scripted bunnyhopping^"", get_user_userid(id))
server_exec()
}
else
{
client_print(0, print_chat, "[CSB] %s is suspected of scripted bunnyhopping.", name)
}
}