From 92d388116cc19ef728d66ac67eaa4f584e63d895 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 17:30:29 +0100 Subject: Silent aim: exact usercmd angle + fire, restore rendered view - new top-level Silent aim feature (Active + Bind, default Mouse3) - reuses the shared aim-target selection (bone checklist, nearest selected point, world-only MASK_VISIBLE vischeck) - writes the exact target angle into cmd->viewangles, sets IN_ATTACK for the shot, then immediately restores engine view angles to the player's input view (g_cam_view) so the camera stays where it was - shares the vischeck/bone selection with the aimbot; independent of the aimbot/triggerbot binds - config [silentaim] active/bind --- src/menu.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index 585695c..11ed222 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -62,6 +62,7 @@ static FeatureState g_abh{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 +static FeatureState g_silentaim{true, 602}; // default Mouse3 // Aimbot bone checklist. Head defaults on (v1 behaviour). enum { @@ -117,6 +118,9 @@ static MenuNode g_aimbot_smooth_node{NODE_VALUE, "Smoothness", false, 0, {}, nul static MenuNode g_triggerbot_feat{NODE_FEATURE, "Triggerbot", false, 1, {}, nullptr, nullptr, nullptr}; static MenuNode g_triggerbot_active{NODE_TOGGLE, "Active", false, 0, {}, &g_triggerbot.active, nullptr, nullptr}; static MenuNode g_triggerbot_bind{NODE_BIND, "Bind", false, 0, {}, nullptr, &g_triggerbot.bind, nullptr}; +static MenuNode g_silentaim_feat{NODE_FEATURE, "Silent aim", false, 1, {}, nullptr, nullptr, nullptr}; +static MenuNode g_silentaim_active{NODE_TOGGLE, "Active", false, 0, {}, &g_silentaim.active, nullptr, nullptr}; +static MenuNode g_silentaim_bind{NODE_BIND, "Bind", false, 0, {}, nullptr, &g_silentaim.bind, nullptr}; static MenuNode *g_visible[32]; // flattened visible nodes for arrow navigation static int g_visible_count = 0; @@ -142,6 +146,9 @@ static void build_tree() { g_triggerbot_feat.children[0] = &g_triggerbot_active; g_triggerbot_feat.children[1] = &g_triggerbot_bind; g_triggerbot_feat.child_count = 2; + g_silentaim_feat.children[0] = &g_silentaim_active; + g_silentaim_feat.children[1] = &g_silentaim_bind; + g_silentaim_feat.child_count = 2; for (int i = 0; i < ESP_OPT_COUNT; i++) g_esp_feat.children[i + 1] = &g_esp_opt_nodes[i]; g_esp_feat.child_count = ESP_OPT_COUNT + 1; @@ -150,7 +157,8 @@ static void build_tree() { g_root.children[2] = &g_esp_feat; g_root.children[3] = &g_aimbot_feat; g_root.children[4] = &g_triggerbot_feat; - g_root.child_count = 5; + g_root.children[5] = &g_silentaim_feat; + g_root.child_count = 6; } static int g_depth[32]; // depth of each visible row (for indentation) @@ -224,6 +232,8 @@ static void config_save() { g_aim_bones[AIM_BONE_LLEG], g_aim_bones[AIM_BONE_RLEG]); fprintf(f, "[triggerbot]\nactive=%d\nbind=%d\n", g_triggerbot.active, g_triggerbot.bind); + fprintf(f, "[silentaim]\nactive=%d\nbind=%d\n", g_silentaim.active, + g_silentaim.bind); fprintf(f, "[esp]\nactive=%d\nbind=%d\nneutral=%d\nhealthbar=%d\n" "healthnum=%d\nname=%d\nskeleton=%d\nbox=%d\n", g_esp.active, g_esp.bind, g_esp_opt[ESP_OPT_SHOW_NEUTRAL], @@ -253,6 +263,8 @@ static void config_load() { cur = &g_aimbot; else if (strstr(line, "[triggerbot]")) cur = &g_triggerbot; + else if (strstr(line, "[silentaim]")) + cur = &g_silentaim; else cur = nullptr; in_esp = (cur == &g_esp); @@ -413,9 +425,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). bool feature_active(int feature) { - static FeatureState *feats[5] = {&g_bhop, &g_abh, &g_esp, &g_aimbot, - &g_triggerbot}; - if (feature < 0 || feature > 4) + static FeatureState *feats[6] = {&g_bhop, &g_abh, &g_esp, + &g_aimbot, &g_triggerbot, + &g_silentaim}; + if (feature < 0 || feature > 5) return false; FeatureState *f = feats[feature]; if (!f->active) @@ -492,7 +505,8 @@ static void menu_handle_input() { MenuNode *n = g_visible[g_selected]; if (n->bind_ptr) { // clear same bind from other features - FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot, &g_triggerbot}; + FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot, &g_triggerbot, + &g_silentaim}; for (auto *f : features) if (&f->bind != n->bind_ptr && f->bind == i) f->bind = 0; @@ -707,11 +721,11 @@ void outer_draw() { draw_text(270, 10 + i * 20, "[press key]"); else { /* stable name for current bind */ - static char bn[4][32]; + static char bn[5][32]; static FeatureState *feats[] = {&g_bhop, &g_abh, &g_aimbot, - &g_triggerbot}; + &g_triggerbot, &g_silentaim}; int fi = 0; - for (int k = 0; k < 4; k++) + for (int k = 0; k < 5; k++) if (n->bind_ptr == &feats[k]->bind) fi = k; snprintf(bn[fi], 32, "[%s]", scancode_name(*n->bind_ptr)); -- cgit v1.2.3