/*
* CSB Ladder Speed
* Copyright (C) 2026 counter-strike-boost.com
*
* Changes climbing speed on ladders. In PlayerPreThink the plugin detects ladder
* movement (the engine puts the player into MOVETYPE_FLY while on a ladder) and
* scales the current velocity by a configurable multiplier, so players climb
* faster (or slower). An optional "ladder jump" pushes the player off the ladder
* along their aim when they press jump, useful for surf/KZ style maps.
*
* 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 Ladder Speed"
new const VERSION[] = "1.0.0"
new const AUTHOR[] = "counter-strike-boost.com"
#if !defined MOVETYPE_FLY
#define MOVETYPE_FLY 5
#endif
#if !defined IN_JUMP
#define IN_JUMP 2
#endif
new g_pEnabled, g_pMult, g_pLadderJump, g_pJumpPush
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pEnabled = register_cvar("csb_ladder_enabled", "1")
g_pMult = register_cvar("csb_ladder_mult", "1.6")
g_pLadderJump = register_cvar("csb_ladder_jump", "1")
g_pJumpPush = register_cvar("csb_ladder_push", "300")
register_forward(FM_PlayerPreThink, "fwPreThink")
}
public fwPreThink(id)
{
if (!get_pcvar_num(g_pEnabled) || !is_user_alive(id))
return FMRES_IGNORED
if (pev(id, pev_movetype) != MOVETYPE_FLY)
return FMRES_IGNORED
static Float:fVel[3]
pev(id, pev_velocity, fVel)
new btn = pev(id, pev_button)
if (get_pcvar_num(g_pLadderJump) && (btn & IN_JUMP))
{
static Float:fAng[3], Float:fFwd[3]
pev(id, pev_v_angle, fAng)
angle_vector(fAng, ANGLEVECTOR_FORWARD, fFwd)
new Float:push = get_pcvar_float(g_pJumpPush)
fVel[0] = fFwd[0] * push
fVel[1] = fFwd[1] * push
fVel[2] = fFwd[2] * push * 0.5 + 120.0
set_pev(id, pev_velocity, fVel)
return FMRES_IGNORED
}
new Float:mult = get_pcvar_float(g_pMult)
if (mult < 0.1)
mult = 1.0
fVel[0] *= mult
fVel[1] *= mult
fVel[2] *= mult
set_pev(id, pev_velocity, fVel)
return FMRES_IGNORED
}