UI.AddCheckbox("Velocity Info")
UI.AddSliderInt("Velocity Info Offset", 0, 300)
function do_velocity_info()
{
const player = Entity.GetLocalPlayer();
if (!player || !Entity.IsAlive(player))
return;
if (!UI.GetValue( "Misc", "JAVASCRIPT", "Script items", "Velocity Info"))
return;
const x = Render.GetScreenSize()[0], y = Render.GetScreenSize()[1] + UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Velocity Info Offset");
const vec = Entity.GetProp(player, "CBasePlayer", "m_vecVelocity[0]");
const velocity = Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]);
Render.String(x / 2, y / 2 + 150, 1, Math.round(velocity).toString(), [255, 255, 255, 255], 4);
Render.String(x / 2 + 1, y / 2 + 185, 1, "u/s", [225, 225, 225, 225], 2);
}
Cheat.RegisterCallback("Draw", "do_velocity_info");