Compare commits
5 Commits
1d94704814
...
51c3b979ea
Author | SHA1 | Date | |
---|---|---|---|
51c3b979ea | |||
6a640a716c | |||
66b4abf888 | |||
5bf0dfce70 | |||
cbea54c5ce |
2
Makefile
2
Makefile
@ -9,7 +9,7 @@ IMGUI_INCLUDES=-I$(IMGUI_DIR)
|
||||
IMGUI_SRCS=$(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp
|
||||
IMGUI_OBJS=$(patsubst %.cpp,%.o,$(IMGUI_SRCS))
|
||||
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/settings.c.o obj/hooks.c.o obj/detour.c.o obj/util.c.o obj/features/movement.c.o obj/features/anti_aim.c.o obj/features/fov.c.o obj/features/namechanger.c.o obj/features/esp.c.o obj/features/chams.c.o obj/features/aim.c.o obj/features/misc.c.o obj/features/thirdperson.c.o obj/game_detection.c.o obj/menu.c.o $(IMGUI_OBJS)
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/settings.c.o obj/hooks.c.o obj/detour.c.o obj/util.c.o obj/features/movement.c.o obj/features/anti_aim.c.o obj/features/fov.c.o obj/features/namechanger.c.o obj/features/esp.c.o obj/features/chams.c.o obj/features/aim.c.o obj/features/misc.c.o obj/features/thirdperson.c.o obj/features/no_recoil.c.o obj/game_detection.c.o obj/menu.c.o $(IMGUI_OBJS)
|
||||
BIN=libhlcheat.so
|
||||
|
||||
.PHONY: clean all inject
|
||||
|
@ -123,10 +123,6 @@ bool is_hitbox_visible(vec3_t eye_pos, hitbox_t* hitbox) {
|
||||
|
||||
pmtrace_t* trace = i_engine->PM_TraceLine(eye_pos, hitbox->origin, PM_TRACELINE_PHYSENTSONLY, 2, -1);
|
||||
|
||||
if (g_settings.aimbot_rage_mode && trace->fraction > 0.5f) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (trace->fraction < 1.0f && trace->ent <= 0)
|
||||
return false;
|
||||
|
||||
@ -136,7 +132,7 @@ bool is_hitbox_visible(vec3_t eye_pos, hitbox_t* hitbox) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return trace->fraction >= 1.0f;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@ -152,10 +148,6 @@ int get_target_priority(cl_entity_t* ent) {
|
||||
if (!ent)
|
||||
return PRIORITY_NONE;
|
||||
|
||||
if (g_settings.aimbot_rage_mode) {
|
||||
return PRIORITY_HIGH;
|
||||
}
|
||||
|
||||
return PRIORITY_MEDIUM;
|
||||
}
|
||||
|
||||
@ -199,17 +191,13 @@ static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
|
||||
float best_score = 0.0f;
|
||||
float max_fov = g_settings.aimbot_fov;
|
||||
|
||||
if (g_settings.aimbot_rage_mode && max_fov < 90.0f) {
|
||||
max_fov = 90.0f;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
|
||||
cl_entity_t* ent = get_player(i);
|
||||
|
||||
if (!ent || !is_alive(ent))
|
||||
continue;
|
||||
|
||||
if (!g_settings.aimbot_friendly_fire && is_friend(ent))
|
||||
if (!g_settings.aimbot_team_attack && is_friend(ent))
|
||||
continue;
|
||||
|
||||
hitbox_t target_hitbox;
|
||||
@ -236,16 +224,10 @@ static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
|
||||
|
||||
float fov_score = 1.0f - (fov_distance / max_fov);
|
||||
|
||||
float priority_score = 0.0f;
|
||||
if (g_settings.aimbot_rage_mode) {
|
||||
int priority = get_target_priority(ent);
|
||||
priority_score = priority / (float)PRIORITY_HIGH;
|
||||
}
|
||||
int priority = get_target_priority(ent);
|
||||
float priority_score = priority / (float)PRIORITY_HIGH;
|
||||
|
||||
float final_score = fov_score;
|
||||
if (g_settings.aimbot_rage_mode) {
|
||||
final_score = (fov_score * 0.5f) + (priority_score * 0.5f);
|
||||
}
|
||||
float final_score = (fov_score * 0.5f) + (priority_score * 0.5f);
|
||||
|
||||
if (final_score > best_score) {
|
||||
best_score = final_score;
|
||||
@ -253,7 +235,7 @@ static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
|
||||
best_target.fov = fov_distance;
|
||||
vec_copy(best_target.aim_point, target_hitbox.origin);
|
||||
best_target.is_visible = true;
|
||||
best_target.priority = get_target_priority(ent);
|
||||
best_target.priority = priority;
|
||||
best_target.distance = distance;
|
||||
}
|
||||
}
|
||||
@ -265,28 +247,12 @@ void aimbot(usercmd_t* cmd) {
|
||||
if (!g_settings.aimbot_enabled)
|
||||
return;
|
||||
|
||||
bool should_run_aimbot = true;
|
||||
bool fire_button_pressed = (cmd->buttons & IN_ATTACK) != 0;
|
||||
bool should_autoshoot = g_settings.aimbot_autoshoot;
|
||||
|
||||
switch (0) {
|
||||
case 0:
|
||||
should_run_aimbot = true;
|
||||
break;
|
||||
case 1:
|
||||
should_run_aimbot = (cmd->buttons & IN_ATTACK) != 0;
|
||||
break;
|
||||
case 2:
|
||||
should_run_aimbot = (cmd->buttons & IN_ATTACK2) != 0;
|
||||
break;
|
||||
default:
|
||||
should_run_aimbot = true;
|
||||
}
|
||||
|
||||
if (!should_run_aimbot && !g_settings.aimbot_rage_mode)
|
||||
if (!fire_button_pressed) {
|
||||
return;
|
||||
|
||||
if (g_settings.aimbot_rage_mode)
|
||||
should_run_aimbot = true;
|
||||
}
|
||||
|
||||
bool can_fire = can_shoot();
|
||||
|
||||
@ -297,14 +263,7 @@ void aimbot(usercmd_t* cmd) {
|
||||
vec3_t engine_viewangles;
|
||||
i_engine->GetViewAngles(engine_viewangles);
|
||||
|
||||
vec3_t adjusted_viewangles = engine_viewangles;
|
||||
if (g_settings.aimbot_norecoil) {
|
||||
adjusted_viewangles.x += g_punchAngles.x * AIM_PUNCH_MULT;
|
||||
adjusted_viewangles.y += g_punchAngles.y * AIM_PUNCH_MULT;
|
||||
adjusted_viewangles.z += g_punchAngles.z * AIM_PUNCH_MULT;
|
||||
}
|
||||
|
||||
target_t best_target = get_best_target(adjusted_viewangles, eye_pos);
|
||||
target_t best_target = get_best_target(engine_viewangles, eye_pos);
|
||||
|
||||
if (best_target.entity && best_target.is_visible) {
|
||||
vec3_t to_target = vec_sub(best_target.aim_point, eye_pos);
|
||||
@ -315,22 +274,27 @@ void aimbot(usercmd_t* cmd) {
|
||||
ang_clamp(&delta);
|
||||
|
||||
if (g_settings.aimbot_silent) {
|
||||
cmd->viewangles.x = engine_viewangles.x + delta.x;
|
||||
cmd->viewangles.y = engine_viewangles.y + delta.y;
|
||||
cmd->viewangles.z = engine_viewangles.z + delta.z;
|
||||
// Silent aim - just modify cmd->viewangles directly
|
||||
cmd->viewangles.x = aim_angles.x;
|
||||
cmd->viewangles.y = aim_angles.y;
|
||||
cmd->viewangles.z = aim_angles.z;
|
||||
} else {
|
||||
float smoothing = SMOOTHING_FACTOR;
|
||||
|
||||
smoothing = g_settings.aimbot_smooth > 0 ? g_settings.aimbot_smooth : SMOOTHING_FACTOR;
|
||||
|
||||
if (g_settings.aimbot_rage_mode) {
|
||||
smoothing = 1.2f;
|
||||
if (g_settings.aimbot_smoothing_enabled) {
|
||||
float smoothing = g_settings.aimbot_smooth;
|
||||
|
||||
if (smoothing <= 0.1f) {
|
||||
smoothing = 0.1f;
|
||||
}
|
||||
|
||||
engine_viewangles.x += delta.x / smoothing;
|
||||
engine_viewangles.y += delta.y / smoothing;
|
||||
engine_viewangles.z += delta.z / smoothing;
|
||||
} else {
|
||||
engine_viewangles.x = aim_angles.x;
|
||||
engine_viewangles.y = aim_angles.y;
|
||||
engine_viewangles.z = aim_angles.z;
|
||||
}
|
||||
|
||||
engine_viewangles.x += delta.x / smoothing;
|
||||
engine_viewangles.y += delta.y / smoothing;
|
||||
engine_viewangles.z += delta.z / smoothing;
|
||||
|
||||
ang_clamp(&engine_viewangles);
|
||||
|
||||
i_engine->SetViewAngles(engine_viewangles);
|
||||
@ -341,9 +305,7 @@ void aimbot(usercmd_t* cmd) {
|
||||
}
|
||||
|
||||
if (should_autoshoot && can_fire) {
|
||||
if (g_settings.aimbot_rage_mode) {
|
||||
cmd->buttons |= IN_ATTACK;
|
||||
} else {
|
||||
if (!g_settings.aimbot_require_key || fire_button_pressed) {
|
||||
float aim_error = sqrtf(delta.x * delta.x + delta.y * delta.y);
|
||||
if (aim_error < 5.0f) {
|
||||
cmd->buttons |= IN_ATTACK;
|
||||
|
@ -33,6 +33,9 @@ bool chams(void* this_ptr);
|
||||
/* src/features/aim.c */
|
||||
void aimbot(usercmd_t* cmd);
|
||||
|
||||
/* src/features/no_recoil.c */
|
||||
void no_recoil(usercmd_t* cmd);
|
||||
|
||||
/* src/features/misc.c */
|
||||
void custom_crosshair(void);
|
||||
void bullet_tracers(usercmd_t* cmd);
|
||||
|
@ -2,23 +2,41 @@
|
||||
#include "../include/settings.h"
|
||||
#include "../include/util.h"
|
||||
#include "../include/globals.h"
|
||||
#include <stdio.h> // For printf
|
||||
#include <time.h> // For time
|
||||
#include "../features/features.h"
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
static time_t last_log_time = 0;
|
||||
|
||||
void no_recoil(usercmd_t* cmd) {
|
||||
if (!g_settings.aimbot_norecoil || !is_alive(localplayer)) {
|
||||
if (!is_alive(localplayer) || (!g_settings.aimbot_norecoil && !g_settings.aimbot_recoil_comp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(cmd->buttons & IN_ATTACK)) {
|
||||
return;
|
||||
}
|
||||
|
||||
time_t current_time = time(NULL);
|
||||
if (current_time - last_log_time >= 5) {
|
||||
printf("Applying anti-recoil: Punch Angles (X: %f, Y: %f)\n", g_punchAngles[0], g_punchAngles[1]);
|
||||
printf("Recoil control active: Punch Angles (X: %f, Y: %f)\n", g_punchAngles[0], g_punchAngles[1]);
|
||||
last_log_time = current_time;
|
||||
}
|
||||
|
||||
float anti_recoil_value = 100.0f;
|
||||
cmd->viewangles[0] -= (g_punchAngles[0] * anti_recoil_value);
|
||||
cmd->viewangles[1] -= (g_punchAngles[1] * anti_recoil_value);
|
||||
if (g_settings.aimbot_norecoil) {
|
||||
float multiplier = 200.0f;
|
||||
|
||||
cmd->viewangles[0] -= (g_punchAngles[0] * multiplier);
|
||||
cmd->viewangles[1] -= (g_punchAngles[1] * multiplier);
|
||||
|
||||
printf("Applied no_recoil: %f, %f\n", -g_punchAngles[0] * multiplier, -g_punchAngles[1] * multiplier);
|
||||
}
|
||||
else if (g_settings.aimbot_recoil_comp) {
|
||||
float multiplier = 5.0f;
|
||||
|
||||
cmd->viewangles[0] -= (g_punchAngles[0] * multiplier);
|
||||
cmd->viewangles[1] -= (g_punchAngles[1] * multiplier);
|
||||
|
||||
printf("Applied recoil_comp: %f, %f\n", -g_punchAngles[0] * multiplier, -g_punchAngles[1] * multiplier);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,6 @@
|
||||
|
||||
#include "../include/sdk.h"
|
||||
|
||||
void aim_no_recoil(usercmd_t* cmd);
|
||||
void no_recoil(usercmd_t* cmd);
|
||||
|
||||
#endif
|
||||
|
@ -215,6 +215,7 @@ void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
|
||||
}
|
||||
|
||||
bhop(cmd);
|
||||
no_recoil(cmd); // Apply recoil control before aimbot
|
||||
aimbot(cmd);
|
||||
bullet_tracers(cmd);
|
||||
anti_aim(cmd);
|
||||
|
@ -27,12 +27,13 @@ typedef struct {
|
||||
bool aimbot_enabled;
|
||||
float aimbot_fov;
|
||||
float aimbot_smooth;
|
||||
bool aimbot_smoothing_enabled;
|
||||
bool aimbot_silent;
|
||||
bool aimbot_autoshoot;
|
||||
bool aimbot_require_key;
|
||||
bool aimbot_norecoil;
|
||||
bool aimbot_recoil_comp;
|
||||
bool aimbot_friendly_fire;
|
||||
bool aimbot_rage_mode;
|
||||
bool aimbot_team_attack;
|
||||
int aimbot_hitbox;
|
||||
|
||||
@ -67,6 +68,7 @@ inline void init_default_settings(void) {
|
||||
|
||||
g_settings.aimbot_fov = 5.0f;
|
||||
g_settings.aimbot_smooth = 10.0f;
|
||||
g_settings.aimbot_smoothing_enabled = true;
|
||||
g_settings.aimbot_hitbox = 0;
|
||||
|
||||
g_settings.esp_mode = ESP_OFF;
|
||||
|
39
src/menu.c
39
src/menu.c
@ -187,10 +187,14 @@ extern "C" void menu_render(void) {
|
||||
}
|
||||
|
||||
if (g_settings.aimbot_enabled) {
|
||||
if (ImGui::SliderFloat("FOV", &g_settings.aimbot_fov, 0.1f, 180.0f, "%.1f")) {
|
||||
if (ImGui::SliderFloat("FOV", &g_settings.aimbot_fov, 0.1f, 360.0f, "%.1f")) {
|
||||
}
|
||||
|
||||
if (ImGui::SliderFloat("Smoothing", &g_settings.aimbot_smooth, 1.0f, 100.0f, "%.1f")) {
|
||||
ImGui::Checkbox("Enable Smoothing", &g_settings.aimbot_smoothing_enabled);
|
||||
|
||||
if (g_settings.aimbot_smoothing_enabled) {
|
||||
if (ImGui::SliderFloat("Smoothing", &g_settings.aimbot_smooth, 1.0f, 100.0f, "%.1f")) {
|
||||
}
|
||||
}
|
||||
|
||||
const char* hitbox_items[] = { "Head", "Chest", "Stomach", "Pelvis", "Nearest" };
|
||||
@ -199,11 +203,30 @@ 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);
|
||||
ImGui::Checkbox("Shoot Teammates", &g_settings.aimbot_team_attack);
|
||||
ImGui::Checkbox("Rage Mode", &g_settings.aimbot_rage_mode);
|
||||
}
|
||||
|
||||
ImGui::EndTabItem();
|
||||
@ -510,9 +533,11 @@ static void render_fallback_menu(void) {
|
||||
i_engine->pfnDrawConsoleString(x1+30, y, buffer);
|
||||
y += 15;
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "- Smoothing: %.1f", g_settings.aimbot_smooth);
|
||||
i_engine->pfnDrawConsoleString(x1+30, y, buffer);
|
||||
y += 15;
|
||||
if (g_settings.aimbot_smoothing_enabled) {
|
||||
snprintf(buffer, sizeof(buffer), "- Smoothing: %.1f", g_settings.aimbot_smooth);
|
||||
i_engine->pfnDrawConsoleString(x1+30, y, buffer);
|
||||
y += 15;
|
||||
}
|
||||
}
|
||||
|
||||
y += 10;
|
||||
@ -529,7 +554,7 @@ static void render_fallback_menu(void) {
|
||||
snprintf(buffer, sizeof(buffer), "- Chams: %s", chams_enabled ? "ON" : "OFF");
|
||||
i_engine->pfnDrawConsoleString(x1+30, y, buffer);
|
||||
y += 30;
|
||||
|
||||
|
||||
i_engine->pfnDrawSetTextColor(1.0f, 1.0f, 0.0f);
|
||||
i_engine->pfnDrawConsoleString(x1+20, y, "Press INSERT to close menu");
|
||||
y += 20;
|
||||
|
@ -46,6 +46,7 @@ bool create_root_default_config(void) {
|
||||
preset.chams = true;
|
||||
preset.aimbot_enabled = true;
|
||||
preset.aimbot_fov = 5.0f;
|
||||
preset.aimbot_smoothing_enabled = true;
|
||||
preset.bhop = true;
|
||||
preset.autostrafe = true;
|
||||
preset.thirdperson = false;
|
||||
@ -150,8 +151,9 @@ void settings_reset(void) {
|
||||
g_settings.aimbot_norecoil = false;
|
||||
g_settings.aimbot_recoil_comp = false;
|
||||
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.aimbot_smoothing_enabled = true;
|
||||
|
||||
g_settings.bhop = false;
|
||||
g_settings.autostrafe = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user