From 293eda2bdce9d732fad168b5b6838bd89ce59fe8 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 14:52:00 +0100 Subject: Melee killbot: 360-degree crowbar silent aim - New feature (default on): while the local player's active weapon is the crowbar, pick the nearest visible hostile NPC within the 75-unit crowbar range, sorted by distance to its collision AABB, and attack it through the normal silent-aim path (usercmd view + IN_ATTACK, movement preserved, rendered view restored at FRAME_RENDER_START). - Prefer the nearest visible hitbox center; fall back to the AABB center / closest point when bones are unavailable. Reuses the existing friendly / neutral and life-state filters and the world-only vischeck. - Detect the active weapon from the client m_hActiveWeapon handle, with the authoritative server m_hActiveWeapon handle as a fallback (client entity index from the low 16 bits). - While the crowbar is active and this feature is on, skip the gun aimbot, triggerbot and silent aim so they do not fight over the usercmd view. - Menu: Melee killbot -> Active; config [melee] active=... --- src/menu.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index 8df67fe..f590d69 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -64,6 +64,7 @@ static bool g_bhop_autostrafe = true; static FeatureState g_abh{true, 0}; static FeatureState g_jumpbug{true, 0}; static bool g_jumpbug_assist = false; +static FeatureState g_melee{true, 0}; static FeatureState g_esp{true, 0}; static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu static FeatureState g_triggerbot{true, 603}; // default Mouse4 @@ -101,6 +102,8 @@ static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, static MenuNode g_jumpbug_feat{NODE_FEATURE, "Jumpbug", false, 1, {}, nullptr, nullptr, nullptr}; static MenuNode g_jumpbug_active{NODE_TOGGLE, "Active", false, 0, {}, &g_jumpbug.active, nullptr, nullptr}; static MenuNode g_jumpbug_assist_node{NODE_TOGGLE, "Assist timing", false, 0, {}, &g_jumpbug_assist, nullptr, nullptr}; +static MenuNode g_melee_feat{NODE_FEATURE, "Melee killbot", false, 1, {}, nullptr, nullptr, nullptr}; +static MenuNode g_melee_active{NODE_TOGGLE, "Active", false, 0, {}, &g_melee.active, nullptr, nullptr}; static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { @@ -156,6 +159,8 @@ static void build_tree() { g_jumpbug_feat.children[0] = &g_jumpbug_active; g_jumpbug_feat.children[1] = &g_jumpbug_assist_node; g_jumpbug_feat.child_count = 2; + g_melee_feat.children[0] = &g_melee_active; + g_melee_feat.child_count = 1; g_esp_feat.children[0] = &g_esp_active; g_aimbot_feat.children[0] = &g_aimbot_active; g_aimbot_feat.children[1] = &g_aimbot_bind; @@ -181,11 +186,12 @@ static void build_tree() { g_root.children[0] = &g_bhop_feat; g_root.children[1] = &g_abh_feat; g_root.children[2] = &g_jumpbug_feat; - g_root.children[3] = &g_esp_feat; - g_root.children[4] = &g_aimbot_feat; - g_root.children[5] = &g_triggerbot_feat; - g_root.children[6] = &g_silentaim_feat; - g_root.child_count = 7; + g_root.children[3] = &g_melee_feat; + g_root.children[4] = &g_esp_feat; + g_root.children[5] = &g_aimbot_feat; + g_root.children[6] = &g_triggerbot_feat; + g_root.children[7] = &g_silentaim_feat; + g_root.child_count = 8; } static int g_depth[48]; // depth of each visible row (for indentation) @@ -309,6 +315,7 @@ static void config_save() { fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); fprintf(f, "[jumpbug]\nactive=%d\nassist=%d\n", g_jumpbug.active, (int)g_jumpbug_assist); + fprintf(f, "[melee]\nactive=%d\n", g_melee.active); fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" "fov=%d\nfov_circle=%d\n" "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" @@ -349,6 +356,8 @@ static void config_load() { cur = &g_abh; else if (strstr(line, "[jumpbug]")) cur = &g_jumpbug; + else if (strstr(line, "[melee]")) + cur = &g_melee; else if (strstr(line, "[esp]")) cur = &g_esp; else if (strstr(line, "[aimbot]")) @@ -537,10 +546,10 @@ static bool key_pressed(int sc) { // feature gate queried from hl2h.cpp do_move(): feature must be Active AND // its bind key held (always-on when unbound). static FeatureState *feature_state(int feature) { - static FeatureState *feats[7] = {&g_bhop, &g_abh, &g_esp, + static FeatureState *feats[8] = {&g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, &g_silentaim, - &g_jumpbug}; - if (feature < 0 || feature > 6) + &g_jumpbug, &g_melee}; + if (feature < 0 || feature > 7) return nullptr; return feats[feature]; } -- cgit v1.2.3