From 0b0664e4cfb356dcda4f1bf338e11e6f26db1ad1 Mon Sep 17 00:00:00 2001 From: Wizzard <25581244+Wizzard@users.noreply.toomuchslop.com> Date: Wed, 20 Sep 2023 23:43:31 -0400 Subject: [PATCH] More advanced antiaim, also added fakeduck --- src/features/anti_aim.c | 53 +++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/src/features/anti_aim.c b/src/features/anti_aim.c index 90c84f6..bc43af5 100644 --- a/src/features/anti_aim.c +++ b/src/features/anti_aim.c @@ -29,29 +29,52 @@ void anti_aim(usercmd_t* cmd) { return; } - vec3_t random_angles; - i_engine->GetViewAngles(random_angles); - - random_angles.x = random_float(-89.0f, 89.0f); - random_angles.y = random_float(-180.0f, 180.0f); - random_angles.z = 0.0f; - char logMsg[128]; - snprintf(logMsg, sizeof(logMsg), "echo \"Generated random angles: [%f, %f, %f]\"", random_angles.x, random_angles.y, random_angles.z); - i_engine->pfnClientCmd(logMsg); + vec3_t view_angles; + i_engine->GetViewAngles(view_angles); + + static bool lbyBreak = false; + if (lbyBreak) { + view_angles.y += 120.0f; + } + lbyBreak = !lbyBreak; + + static bool flipPitch = false; + if (flipPitch) { + view_angles.x = 89.0f; + } else { + view_angles.x = -89.0f; + } + flipPitch = !flipPitch; + + view_angles.y += 30.0f; + + // This shit busted right now + if (CVAR_ON(movement_fakeduck) && cmd->forwardmove == 0.0f && cmd->sidemove == 0.0f) { + static int duckCounter = 0; + if (duckCounter < 5) { + cmd->buttons |= IN_DUCK; + } else if (duckCounter < 10) { + cmd->buttons &= ~IN_DUCK; + } else { + duckCounter = 0; + } + duckCounter++; + } + + if (view_angles.y > 180.0f) view_angles.y -= 360.0f; + if (view_angles.y < -180.0f) view_angles.y += 360.0f; if (CVAR_ON(movement_antiaim_view)) { - i_engine->SetViewAngles(random_angles); + i_engine->SetViewAngles(view_angles); i_engine->pfnClientCmd("echo \"Set view angles directly using movement_antiaim_view.\""); } else { - vec_copy(cmd->viewangles, random_angles); + vec_copy(cmd->viewangles, view_angles); i_engine->pfnClientCmd("echo \"Set view angles silently.\""); } static float last_log_time = 0.0f; if (cmd->msec - last_log_time >= 5000.0f) { - i_engine->pfnClientCmd("echo \"Anti-Aim has adjusted view angles.\""); + i_engine->pfnClientCmd("echo \"Advanced Anti-Aim has adjusted view angles.\""); last_log_time = cmd->msec; } -} - - +} \ No newline at end of file