diff --git a/src/features/aim.c b/src/features/aim.c index 0be2e06..ac215d1 100644 --- a/src/features/aim.c +++ b/src/features/aim.c @@ -267,6 +267,7 @@ void aimbot(usercmd_t* cmd) { bool should_run_aimbot = true; bool should_autoshoot = g_settings.aimbot_autoshoot; + bool fire_button_pressed = (cmd->buttons & IN_ATTACK) != 0; switch (0) { case 0: @@ -341,12 +342,14 @@ void aimbot(usercmd_t* cmd) { } if (should_autoshoot && can_fire) { - if (g_settings.aimbot_rage_mode) { - cmd->buttons |= IN_ATTACK; - } else { - float aim_error = sqrtf(delta.x * delta.x + delta.y * delta.y); - if (aim_error < 5.0f) { + if (!g_settings.aimbot_require_key || fire_button_pressed) { + if (g_settings.aimbot_rage_mode) { cmd->buttons |= IN_ATTACK; + } else { + float aim_error = sqrtf(delta.x * delta.x + delta.y * delta.y); + if (aim_error < 5.0f) { + cmd->buttons |= IN_ATTACK; + } } } } diff --git a/src/include/settings.h b/src/include/settings.h index 9d44055..bc6cb76 100644 --- a/src/include/settings.h +++ b/src/include/settings.h @@ -29,6 +29,7 @@ typedef struct { float aimbot_smooth; bool aimbot_silent; bool aimbot_autoshoot; + bool aimbot_require_key; bool aimbot_norecoil; bool aimbot_recoil_comp; bool aimbot_friendly_fire; diff --git a/src/menu.c b/src/menu.c index 0bfa01c..33b60d6 100644 --- a/src/menu.c +++ b/src/menu.c @@ -199,6 +199,26 @@ extern "C" void menu_render(void) { } ImGui::Checkbox("Auto Shoot", &g_settings.aimbot_autoshoot); + + if (g_settings.aimbot_autoshoot) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?"); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("Auto Shoot automatically fires when aim is on target"); + ImGui::EndTooltip(); + } + + ImGui::Indent(20); + ImGui::Checkbox("Require Fire Button", &g_settings.aimbot_require_key); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("When enabled, auto-shoot will only fire if you're also pressing the fire button"); + ImGui::EndTooltip(); + } + ImGui::Unindent(20); + } + ImGui::Checkbox("Silent Aim", &g_settings.aimbot_silent); ImGui::Checkbox("No Recoil", &g_settings.aimbot_norecoil); ImGui::Checkbox("Recoil Compensation", &g_settings.aimbot_recoil_comp); diff --git a/src/settings.c b/src/settings.c index 1e8ddae..af7a166 100644 --- a/src/settings.c +++ b/src/settings.c @@ -152,6 +152,7 @@ void settings_reset(void) { g_settings.aimbot_friendly_fire = false; g_settings.aimbot_rage_mode = false; g_settings.aimbot_team_attack = false; + g_settings.aimbot_require_key = false; g_settings.bhop = false; g_settings.autostrafe = false;