Initial release 1.0.0
Browse Source1.0.0 - Initial release.
4 changed files
with 189 additions and 0 deletions
A
CHANGELOG.md
+3 -0
A
README.md
+1 -0
A
addons/amxmodx/scripting/csb_bhop_enable.sma
+128 -0
A
csb.json
+57 -0
CHANGELOG.md
A
| @@ -0,0 +1,3 @@ | ||
| 1 | +## 1.0.0 (2026-04-01) | |
| 2 | + | |
| 3 | +1.0.0 - Initial release. |
README.md
A
| @@ -0,0 +1 @@ | ||
| 1 | +<p><strong>CSB Bunny Hop</strong> gives you server-side auto bhop without a client-side script. While a player holds <code>+jump</code>, the plugin catches the frame they land in a <code>PlayerPreThink</code> hook, sets the jump velocity and clears <code>FL_ONGROUND</code> so the engine never applies the usual landing friction — the result is a clean, chainable hop.</p><p>It ships with a horizontal <strong>speed cap</strong> (<code>csb_bhop_maxspeed</code>, 0 = uncapped) so bhop does not turn into a rocket, team/flag gating for VIP-only or surf-style servers, and a per-player <code>/bhop</code> toggle for players who would rather jump manually.</p><p>Inspired by the well-known <em>Auto BunnyHop</em> by ConnorMcLeod. Independent GPL re-implementation; no original code is reused.</p><h2>Features</h2><ul><li>Pure server-side — nothing for the client to install.</li><li>Optional horizontal speed cap.</li><li>Team and/or admin-flag gating.</li><li>Per-player <code>/bhop</code> on/off toggle (can be locked with <code>csb_bhop_allow_toggle</code>).</li></ul><h2>Installation</h2><ol><li>Make sure the <code>fakemeta</code> module is enabled in <code>modules.ini</code> (default).</li><li>Compile, copy <code>csb_bhop_enable.amxx</code> into <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>.</li><li>Change the map.</li></ol><h2>Notes</h2><p>For the smoothest feel also raise <code>sv_enablebunnyhopping 1</code> where your engine supports it; this plugin works regardless, but the engine cvar removes the last bit of speed clamping.</p> |
addons/amxmodx/scripting/csb_bhop_enable.sma
A
| @@ -0,0 +1,128 @@ | ||
| 1 | +/* | |
| 2 | + * CSB Bunny Hop | |
| 3 | + * Copyright (C) 2026 counter-strike-boost.com | |
| 4 | + * | |
| 5 | + * Server-side auto bunny hop. While +jump is held, the plugin re-applies the | |
| 6 | + * jump the instant the player lands: in a PlayerPreThink hook it detects the | |
| 7 | + * ON_GROUND frame, sets the upward jump velocity and clears the ground flag so | |
| 8 | + * the engine never adds the usual landing friction. Includes a horizontal speed | |
| 9 | + * cap, team/flag gating and a per-player /bhop toggle. | |
| 10 | + * | |
| 11 | + * Inspired by the well-known "Auto BunnyHop" plugin by ConnorMcLeod. This is an | |
| 12 | + * independent GPL re-implementation; no original code is reused. | |
| 13 | + * | |
| 14 | + * This program is free software: you can redistribute it and/or modify it under | |
| 15 | + * the terms of the GNU General Public License as published by the Free Software | |
| 16 | + * Foundation, either version 3 of the License, or (at your option) any later | |
| 17 | + * version. See <https://www.gnu.org/licenses/> for details. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +#include <amxmodx> | |
| 21 | +#include <fakemeta> | |
| 22 | + | |
| 23 | +new const PLUGIN[] = "CSB Bunny Hop" | |
| 24 | +new const VERSION[] = "1.0.0" | |
| 25 | +new const AUTHOR[] = "counter-strike-boost.com" | |
| 26 | + | |
| 27 | +new g_pEnabled, g_pFlag, g_pTeam, g_pMaxSpeed, g_pAllowToggle | |
| 28 | + | |
| 29 | +new bool:g_bWantsBhop[33] /* per-player /bhop preference, default on */ | |
| 30 | +new g_iAllowFlags | |
| 31 | + | |
| 32 | +public plugin_init() | |
| 33 | +{ | |
| 34 | + register_plugin(PLUGIN, VERSION, AUTHOR) | |
| 35 | + | |
| 36 | + g_pEnabled = register_cvar("csb_bhop_enabled", "1") | |
| 37 | + g_pFlag = register_cvar("csb_bhop_flag", "") /* empty = everyone */ | |
| 38 | + g_pTeam = register_cvar("csb_bhop_team", "0") /* 0 = any, 1 = T, 2 = CT */ | |
| 39 | + g_pMaxSpeed = register_cvar("csb_bhop_maxspeed", "0") /* 0 = uncapped */ | |
| 40 | + g_pAllowToggle = register_cvar("csb_bhop_allow_toggle", "1") | |
| 41 | + | |
| 42 | + register_clcmd("say /bhop", "cmdToggle") | |
| 43 | + register_clcmd("say_team /bhop", "cmdToggle") | |
| 44 | + | |
| 45 | + register_forward(FM_PlayerPreThink, "fwPreThink") | |
| 46 | +} | |
| 47 | + | |
| 48 | +public plugin_cfg() | |
| 49 | +{ | |
| 50 | + new flagStr[8] | |
| 51 | + get_pcvar_string(g_pFlag, flagStr, charsmax(flagStr)) | |
| 52 | + g_iAllowFlags = read_flags(flagStr) | |
| 53 | +} | |
| 54 | + | |
| 55 | +public client_connect(id) | |
| 56 | +{ | |
| 57 | + g_bWantsBhop[id] = true | |
| 58 | +} | |
| 59 | + | |
| 60 | +bool:isAllowed(id) | |
| 61 | +{ | |
| 62 | + if (g_iAllowFlags != 0 && !(get_user_flags(id) & g_iAllowFlags)) | |
| 63 | + return false | |
| 64 | + | |
| 65 | + new team = get_pcvar_num(g_pTeam) | |
| 66 | + if (team != 0 && get_user_team(id) != team) | |
| 67 | + return false | |
| 68 | + | |
| 69 | + return true | |
| 70 | +} | |
| 71 | + | |
| 72 | +public cmdToggle(id) | |
| 73 | +{ | |
| 74 | + if (!get_pcvar_num(g_pAllowToggle)) | |
| 75 | + { | |
| 76 | + client_print_color(id, print_team_default, "^x04[CSB]^x01 The bunny hop toggle is disabled on this server.") | |
| 77 | + return PLUGIN_HANDLED | |
| 78 | + } | |
| 79 | + | |
| 80 | + g_bWantsBhop[id] = !g_bWantsBhop[id] | |
| 81 | + | |
| 82 | + client_print_color(id, print_team_default, "^x04[CSB]^x01 Auto bunny hop is now^x04 %s^x01 for you.", | |
| 83 | + g_bWantsBhop[id] ? "ON" : "OFF") | |
| 84 | + | |
| 85 | + return PLUGIN_HANDLED | |
| 86 | +} | |
| 87 | + | |
| 88 | +public fwPreThink(id) | |
| 89 | +{ | |
| 90 | + if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id)) | |
| 91 | + return FMRES_IGNORED | |
| 92 | + | |
| 93 | + if (!g_bWantsBhop[id] || !isAllowed(id)) | |
| 94 | + return FMRES_IGNORED | |
| 95 | + | |
| 96 | + new button = pev(id, pev_button) | |
| 97 | + | |
| 98 | + /* only bhop while the player is actively holding jump */ | |
| 99 | + if (!(button & IN_JUMP)) | |
| 100 | + return FMRES_IGNORED | |
| 101 | + | |
| 102 | + new flags = pev(id, pev_flags) | |
| 103 | + | |
| 104 | + if (!(flags & FL_ONGROUND)) | |
| 105 | + return FMRES_IGNORED | |
| 106 | + | |
| 107 | + /* the player is on the ground with jump held: bounce them again */ | |
| 108 | + new Float:velocity[3] | |
| 109 | + pev(id, pev_velocity, velocity) | |
| 110 | + | |
| 111 | + new maxSpeed = get_pcvar_num(g_pMaxSpeed) | |
| 112 | + if (maxSpeed > 0) | |
| 113 | + { | |
| 114 | + new Float:horiz = floatsqroot(velocity[0] * velocity[0] + velocity[1] * velocity[1]) | |
| 115 | + if (horiz > float(maxSpeed) && horiz > 0.0) | |
| 116 | + { | |
| 117 | + new Float:scale = float(maxSpeed) / horiz | |
| 118 | + velocity[0] *= scale | |
| 119 | + velocity[1] *= scale | |
| 120 | + } | |
| 121 | + } | |
| 122 | + | |
| 123 | + velocity[2] = 265.0 | |
| 124 | + set_pev(id, pev_velocity, velocity) | |
| 125 | + set_pev(id, pev_flags, flags & ~FL_ONGROUND) | |
| 126 | + | |
| 127 | + return FMRES_IGNORED | |
| 128 | +} |
csb.json
A
| @@ -0,0 +1,57 @@ | ||
| 1 | +{ | |
| 2 | + "name": "CSB Bunny Hop", | |
| 3 | + "category": "movement", | |
| 4 | + "tags": "bhop, autobhop, jump", | |
| 5 | + "image": "", | |
| 6 | + "original_author": "ConnorMcLeod (Auto BunnyHop)", | |
| 7 | + "original_url": "", | |
| 8 | + "license": "GPL-3.0", | |
| 9 | + "title": "CSB Bunny Hop", | |
| 10 | + "short_desc": "Server-side auto bunny hop with a speed cap, team/flag gating and a per-player /bhop toggle.", | |
| 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. fakemeta must be enabled in modules.ini (default)\n2. Put csb_bhop_enable.amxx in addons/amxmodx/plugins/ and add it to plugins.ini\n3. Change map", | |
| 21 | + "known_conflicts": "Any other auto-bhop plugin - run only one.", | |
| 22 | + "cvars": [ | |
| 23 | + { | |
| 24 | + "name": "csb_bhop_enabled", | |
| 25 | + "default": "1", | |
| 26 | + "description": "Enable or disable auto bunny hop." | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "name": "csb_bhop_flag", | |
| 30 | + "default": "", | |
| 31 | + "description": "Admin flag required (empty = everyone)." | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "name": "csb_bhop_team", | |
| 35 | + "default": "0", | |
| 36 | + "description": "Team allowed to bhop (0 = any, 1 = T, 2 = CT)." | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "name": "csb_bhop_maxspeed", | |
| 40 | + "default": "0", | |
| 41 | + "description": "Horizontal speed cap while bhopping (0 = uncapped)." | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + "name": "csb_bhop_allow_toggle", | |
| 45 | + "default": "1", | |
| 46 | + "description": "Allow players to turn bhop off for themselves with /bhop." | |
| 47 | + } | |
| 48 | + ], | |
| 49 | + "commands": [ | |
| 50 | + { | |
| 51 | + "name": "say /bhop", | |
| 52 | + "access": "", | |
| 53 | + "description": "Toggle auto bunny hop on/off for yourself." | |
| 54 | + } | |
| 55 | + ], | |
| 56 | + "main": "addons/amxmodx/scripting/csb_bhop_enable.sma" | |
| 57 | +} | |
| 0 | 58 |









