5 Commits

Author SHA1 Message Date
1da95a4c35 Update weaponIds 2025-04-04 22:10:48 -04:00
40f014de59 Update aim.c, anti_aim.c, and no_recoil.c 2025-04-04 21:49:26 -04:00
0b9c748444 Update anti_aim.c, globals.c, and 7 more files... 2025-04-04 21:13:50 -04:00
dcdd090677 Update README.org 2025-04-04 20:08:19 -04:00
f885095c39 Update aim.c and no_recoil.c 2025-04-04 20:06:09 -04:00
12 changed files with 1116 additions and 233 deletions

View File

@@ -7,6 +7,9 @@
#+TOC: headlines 2
* WARNING
TO USE THIS YOU MUST BE RUNNING THE LEGACY BETA
* Description
Simple linux cheat for most goldsrc games, made in C.

View File

@@ -33,6 +33,13 @@
#define PRIORITY_MEDIUM 2
#define PRIORITY_HIGH 3
// Weapon IDs
#define WEAPON_GLOCK 17
#define WEAPON_DEAGLE 26
#define WEAPON_AK47 28
#define WEAPON_M4A1 22
#define WEAPON_AWP 33
extern const char* hitbox_options[];
extern int current_hitbox;
@@ -53,86 +60,133 @@ typedef struct {
float radius;
} hitbox_t;
bool get_hitbox(cl_entity_t* ent, int hitbox_index, hitbox_t* out_hitbox) {
if (!ent || !ent->model || !out_hitbox)
bool get_hitbox(cl_entity_t* ent, int hitbox_id, hitbox_t* out_hitbox) {
if (!ent || !out_hitbox) {
return false;
}
studiohdr_t* studio_model = (studiohdr_t*)i_enginestudio->Mod_Extradata(ent->model);
if (!studio_model)
return false;
out_hitbox->radius = 5.0f;
mstudiobbox_t* studio_box = NULL;
if (studio_model->hitboxindex) {
studio_box = (mstudiobbox_t*)((byte*)studio_model + studio_model->hitboxindex);
if (hitbox_index >= studio_model->numhitboxes || hitbox_index < 0)
return false;
bool is_ak47 = (g_currentWeaponID == WEAPON_AK47);
studiohdr_t* studio = NULL;
if (ent->model) {
studio = (studiohdr_t*)i_enginestudio->Mod_Extradata(ent->model);
}
switch (hitbox_id) {
case 0: {
vec3_t view_offset;
view_offset.x = 0.0f;
view_offset.y = 0.0f;
studio_box += hitbox_index;
} else {
return false;
if (is_ak47) {
view_offset.z = 26.0f;
} else {
view_offset.z = 27.0f;
}
out_hitbox->origin = vec_add(ent->origin, view_offset);
out_hitbox->radius = 7.0f;
vec3_t head_offset;
head_offset.x = 0.0f;
head_offset.y = 0.0f;
head_offset.z = 0.0f;
if (is_ak47) {
head_offset.z = -1.0f;
}
out_hitbox->origin = vec_add(out_hitbox->origin, head_offset);
static int debug_counter = 0;
if (debug_counter++ % 500 == 0) {
i_engine->Con_Printf("Head hitbox: Origin(%.1f,%.1f,%.1f) Radius(%.1f) WeaponID: %d\n",
out_hitbox->origin.x, out_hitbox->origin.y, out_hitbox->origin.z,
out_hitbox->radius, g_currentWeaponID);
}
return true;
}
case 1: {
vec3_t chest_offset;
chest_offset.x = 0.0f;
chest_offset.y = 0.0f;
chest_offset.z = 18.0f;
out_hitbox->origin = vec_add(ent->origin, chest_offset);
out_hitbox->radius = 10.0f;
return true;
}
case 2: {
vec3_t stomach_offset;
stomach_offset.x = 0.0f;
stomach_offset.y = 0.0f;
stomach_offset.z = 12.0f;
out_hitbox->origin = vec_add(ent->origin, stomach_offset);
out_hitbox->radius = 9.0f;
return true;
}
case 3: {
vec3_t pelvis_offset;
pelvis_offset.x = 0.0f;
pelvis_offset.y = 0.0f;
pelvis_offset.z = 6.0f;
out_hitbox->origin = vec_add(ent->origin, pelvis_offset);
out_hitbox->radius = 8.0f;
return true;
}
default:
if (is_ak47) {
vec3_t fallback_offset;
fallback_offset.x = 0.0f;
fallback_offset.y = 0.0f;
fallback_offset.z = 20.0f;
out_hitbox->origin = vec_add(ent->origin, fallback_offset);
} else {
vec3_t fallback_offset;
fallback_offset.x = 0.0f;
fallback_offset.y = 0.0f;
fallback_offset.z = 25.0f;
out_hitbox->origin = vec_add(ent->origin, fallback_offset);
}
out_hitbox->radius = 8.0f;
return true;
}
vec_copy(out_hitbox->mins, studio_box->bbmin);
vec_copy(out_hitbox->maxs, studio_box->bbmax);
vec3_t center;
center.x = (out_hitbox->mins.x + out_hitbox->maxs.x) * 0.5f;
center.y = (out_hitbox->mins.y + out_hitbox->maxs.y) * 0.5f;
center.z = (out_hitbox->mins.z + out_hitbox->maxs.z) * 0.5f;
vec3_t angles;
vec_copy(angles, ent->angles);
int bone = studio_box->bone;
if (bone >= 0 && bone < studio_model->numbones) {
mstudiobone_t* pbone = (mstudiobone_t*)((byte*)studio_model + studio_model->boneindex);
pbone += bone;
angles[0] = pbone->value[0];
angles[1] = pbone->value[1];
angles[2] = pbone->value[2];
}
vec3_t forward, right, up;
i_engine->pfnAngleVectors(angles, forward, right, up);
vec3_t offset;
offset.x = center.x * forward.x + center.y * right.x + center.z * up.x;
offset.y = center.x * forward.y + center.y * right.y + center.z * up.y;
offset.z = center.x * forward.z + center.y * right.z + center.z * up.z;
out_hitbox->origin = vec_add(ent->origin, offset);
if (hitbox_index == HITBOX_HEAD) {
out_hitbox->origin.z += 8.0f;
}
vec3_t size;
size.x = fabs(out_hitbox->maxs.x - out_hitbox->mins.x) * 0.5f;
size.y = fabs(out_hitbox->maxs.y - out_hitbox->mins.y) * 0.5f;
size.z = fabs(out_hitbox->maxs.z - out_hitbox->mins.z) * 0.5f;
out_hitbox->radius = sqrtf(size.x * size.x + size.y * size.y + size.z * size.z);
return true;
}
bool is_hitbox_visible(vec3_t eye_pos, hitbox_t* hitbox) {
if (!hitbox)
return false;
pmtrace_t* trace = i_engine->PM_TraceLine(eye_pos, hitbox->origin, PM_TRACELINE_PHYSENTSONLY, 2, -1);
if (trace->fraction < 1.0f && trace->ent <= 0)
return false;
if (trace->ent > 0) {
const int ent_idx = i_pmove->physents[trace->ent].info;
if (get_player(ent_idx))
return true;
static int trace_debug = 0;
if (trace_debug++ % 500 == 0) {
printf("Trace: fraction=%.3f, ent=%d\n", trace->fraction, trace->ent);
}
return trace->fraction >= 1.0f;
if (trace->fraction < 0.9f) {
if (trace->ent <= 0) {
return false;
}
const int ent_idx = i_pmove->physents[trace->ent].info;
cl_entity_t* hit_entity = get_player(ent_idx);
if (hit_entity) {
return true;
}
return false;
}
return true;
}
typedef struct {
@@ -151,41 +205,6 @@ int get_target_priority(cl_entity_t* ent) {
return PRIORITY_MEDIUM;
}
static bool get_best_hitbox(cl_entity_t* ent, vec3_t eye_pos, hitbox_t* out_hitbox) {
if (!ent || !out_hitbox)
return false;
if (current_hitbox == HITBOX_NEAREST) {
float best_distance = 9999.0f;
bool found_hitbox = false;
for (int i = 0; i < MAX_HITBOXES; i++) {
hitbox_t temp_hitbox;
if (get_hitbox(ent, i, &temp_hitbox)) {
if (is_hitbox_visible(eye_pos, &temp_hitbox)) {
vec3_t to_hitbox = vec_sub(temp_hitbox.origin, eye_pos);
float distance = vec_len2d(to_hitbox);
if (distance < best_distance) {
best_distance = distance;
*out_hitbox = temp_hitbox;
found_hitbox = true;
}
}
}
}
return found_hitbox;
}
else {
if (get_hitbox(ent, current_hitbox, out_hitbox)) {
return is_hitbox_visible(eye_pos, out_hitbox);
}
}
return false;
}
static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
target_t best_target = {NULL, 0.0f, {0, 0, 0}, false, PRIORITY_NONE, 9999.0f};
float best_score = 0.0f;
@@ -203,7 +222,23 @@ static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
hitbox_t target_hitbox;
bool hitbox_found = false;
hitbox_found = get_best_hitbox(ent, eye_pos, &target_hitbox);
if (current_hitbox == HITBOX_NEAREST) {
const int hitbox_priority[] = {HITBOX_HEAD, HITBOX_CHEST, HITBOX_STOMACH, HITBOX_PELVIS};
for (int h = 0; h < 4; h++) {
if (get_hitbox(ent, hitbox_priority[h], &target_hitbox)) {
if (is_hitbox_visible(eye_pos, &target_hitbox)) {
hitbox_found = true;
break;
}
}
}
} else {
hitbox_found = get_hitbox(ent, current_hitbox, &target_hitbox);
if (hitbox_found) {
hitbox_found = is_hitbox_visible(eye_pos, &target_hitbox);
}
}
if (!hitbox_found)
continue;
@@ -227,7 +262,9 @@ static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
int priority = get_target_priority(ent);
float priority_score = priority / (float)PRIORITY_HIGH;
float final_score = (fov_score * 0.5f) + (priority_score * 0.5f);
float distance_score = 1.0f - fmin(1.0f, distance / 3000.0f);
float final_score = (fov_score * 0.6f) + (priority_score * 0.3f) + (distance_score * 0.1f);
if (final_score > best_score) {
best_score = final_score;
@@ -243,76 +280,138 @@ static target_t get_best_target(vec3_t viewangles, vec3_t eye_pos) {
return best_target;
}
#define RECOIL_DETECTION_MULT 1.0f
#define RECOIL_DECAY_RATE 0.5f
static vec3_t s_last_viewangles = {0, 0, 0};
static vec3_t s_punch_angles = {0, 0, 0};
static int s_firing_frames = 0;
void aimbot(usercmd_t* cmd) {
if (!g_settings.aimbot_enabled)
return;
if (!is_alive(localplayer))
return;
if (g_settings.aimbot_require_key && !(cmd->buttons & IN_ATTACK))
return;
bool can_fire = g_flCurrentTime >= g_flNextPrimaryAttack;
bool fire_button_pressed = (cmd->buttons & IN_ATTACK) != 0;
bool should_autoshoot = g_settings.aimbot_autoshoot;
vec3_t eye_pos;
vec_copy(eye_pos, localplayer->origin);
eye_pos.z += 28.0f;
if (!fire_button_pressed) {
vec3_t viewangles;
i_engine->GetViewAngles(viewangles);
static int shot_count = 0;
static float last_shot_time = 0.0f;
if (cmd->buttons & IN_ATTACK) {
if (g_flCurrentTime - last_shot_time > 0.08f) {
shot_count++;
last_shot_time = g_flCurrentTime;
if (shot_count % 5 == 0) {
i_engine->Con_Printf("Shot counter: %d shots in spray\n", shot_count);
}
}
} else {
if (g_flCurrentTime - last_shot_time > 0.25f) {
if (shot_count > 3) {
i_engine->Con_Printf("Reset shot counter from %d\n", shot_count);
}
shot_count = 0;
}
}
if (cmd->buttons & IN_ATTACK) {
if (g_currentWeaponID == WEAPON_AK47) {
viewangles.x -= g_punchAngles[0] * 1.2f;
viewangles.y -= g_punchAngles[1] * 0.8f;
if (shot_count >= 3) {
float extra_comp = CLAMP((shot_count - 2) * 0.3f, 0.0f, 3.0f);
viewangles.x -= extra_comp;
if (shot_count % 5 == 0) {
i_engine->Con_Printf("AK-47 Extra comp: %.1f degrees down\n", extra_comp);
}
}
} else {
viewangles.x -= g_punchAngles[0] * 0.6f;
viewangles.y -= g_punchAngles[1] * 0.4f;
}
}
target_t best_target = get_best_target(viewangles, eye_pos);
if (!best_target.entity) {
return;
}
bool can_fire = can_shoot();
vec3_t aim_direction = vec_sub(best_target.aim_point, eye_pos);
vec3_t aim_angles = vec_to_ang(aim_direction);
vec3_t view_height;
i_engine->pEventAPI->EV_LocalPlayerViewheight(view_height);
vec3_t eye_pos = vec_add(localplayer->origin, view_height);
if (g_currentWeaponID == WEAPON_AK47) {
if (shot_count > 0) {
float ak_compensation = CLAMP(shot_count * 0.25f, 0.0f, 6.0f);
aim_angles.x -= ak_compensation;
if (shot_count % 5 == 0) {
i_engine->Con_Printf("AK-47 aim adjust: Shot %d, Aiming %.1f lower\n",
shot_count, ak_compensation);
}
}
}
vec3_t engine_viewangles;
i_engine->GetViewAngles(engine_viewangles);
target_t best_target = get_best_target(engine_viewangles, eye_pos);
if (g_settings.aimbot_smoothing_enabled && !g_settings.aimbot_silent) {
vec3_t delta;
delta.x = aim_angles.x - engine_viewangles.x;
delta.y = aim_angles.y - engine_viewangles.y;
delta.z = 0.0f;
if (delta.y > 180.0f) delta.y -= 360.0f;
if (delta.y < -180.0f) delta.y += 360.0f;
float smooth_factor = g_settings.aimbot_smooth;
if (g_currentWeaponID == WEAPON_AK47 && shot_count > 1) {
smooth_factor *= 0.7f;
}
if (best_target.fov < g_settings.aimbot_fov * 0.5f) {
smooth_factor *= 0.6f;
}
if (smooth_factor < 1.0f) smooth_factor = 1.0f;
vec3_t smooth_angles;
smooth_angles.x = engine_viewangles.x + delta.x / smooth_factor;
smooth_angles.y = engine_viewangles.y + delta.y / smooth_factor;
smooth_angles.z = 0.0f;
ang_clamp(&smooth_angles);
engine_viewangles = smooth_angles;
i_engine->SetViewAngles(engine_viewangles);
}
else if (g_settings.aimbot_silent) {
vec_copy(cmd->viewangles, aim_angles);
}
else {
engine_viewangles = aim_angles;
i_engine->SetViewAngles(engine_viewangles);
}
if (best_target.entity && best_target.is_visible) {
vec3_t to_target = vec_sub(best_target.aim_point, eye_pos);
vec3_t aim_angles = vec_to_ang(to_target);
vec3_t delta = vec_sub(aim_angles, engine_viewangles);
vec_norm(&delta);
ang_clamp(&delta);
if (g_settings.aimbot_silent) {
// 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 {
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;
}
ang_clamp(&engine_viewangles);
i_engine->SetViewAngles(engine_viewangles);
cmd->viewangles.x = engine_viewangles.x;
cmd->viewangles.y = engine_viewangles.y;
cmd->viewangles.z = engine_viewangles.z;
}
if (should_autoshoot && can_fire) {
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;
}
}
}
} else if (should_autoshoot) {
cmd->buttons &= ~IN_ATTACK;
if (g_settings.aimbot_autoshoot && best_target.is_visible && can_fire) {
cmd->buttons |= IN_ATTACK;
}
}

View File

@@ -8,6 +8,25 @@
#include "../include/sdk.h"
#include "../include/settings.h"
#include "../include/util.h"
#include "../include/globals.h"
#define AA_PITCH_NONE 0
#define AA_PITCH_DOWN 1
#define AA_PITCH_UP 2
#define AA_PITCH_ZERO 3
#define AA_PITCH_JITTER 4
#define AA_PITCH_CUSTOM 5
#define AA_YAW_NONE 0
#define AA_YAW_BACKWARD 1
#define AA_YAW_SPIN 2
#define AA_YAW_JITTER 3
#define AA_YAW_SIDEWAYS 4
#define AA_YAW_CUSTOM 5
static float spin_angle = 0.0f;
static float last_update_time = 0.0f;
static float jitter_next_update = 0.0f;
float random_float(float min, float max) {
return (max - min) * ((float)rand() / (float)RAND_MAX) + min;
@@ -28,17 +47,160 @@ bool isSpacebarPressed() {
return pressed;
}
void anti_aim(usercmd_t* cmd) {
if (cmd->buttons & IN_ATTACK || cmd->buttons & IN_USE) {
if (cmd->buttons & IN_ATTACK) {
i_engine->pfnClientCmd("echo \"Attack detected. Spinbot stopped.\"");
} else if (cmd->buttons & IN_USE) {
i_engine->pfnClientCmd("echo \"Use key detected. Spinbot stopped.\"");
}
return;
bool is_key_pressed(int key_code) {
if (key_code <= 0) {
return false;
}
Display* display = XOpenDisplay(NULL);
if (!display) {
return false;
}
if (!g_settings.antiaim) {
char keys_return[32];
XQueryKeymap(display, keys_return);
KeyCode kc;
if (key_code >= 'A' && key_code <= 'Z') {
kc = XKeysymToKeycode(display, XK_a + (key_code - 'A'));
} else if (key_code >= 'a' && key_code <= 'z') {
kc = XKeysymToKeycode(display, XK_a + (key_code - 'a'));
} else {
switch (key_code) {
case K_SPACE: kc = XKeysymToKeycode(display, XK_space); break;
case K_CTRL: kc = XKeysymToKeycode(display, XK_Control_L); break;
case K_SHIFT: kc = XKeysymToKeycode(display, XK_Shift_L); break;
case K_ALT: kc = XKeysymToKeycode(display, XK_Alt_L); break;
case K_TAB: kc = XKeysymToKeycode(display, XK_Tab); break;
default: kc = XKeysymToKeycode(display, key_code);
}
}
bool pressed = (keys_return[kc >> 3] & (1 << (kc & 7))) != 0;
XCloseDisplay(display);
return pressed;
}
void apply_pitch_anti_aim(vec3_t* view_angles, int pitch_mode, float custom_pitch) {
switch (pitch_mode) {
case AA_PITCH_DOWN:
view_angles->x = 89.0f;
break;
case AA_PITCH_UP:
view_angles->x = -89.0f;
break;
case AA_PITCH_ZERO:
view_angles->x = 0.0f;
break;
case AA_PITCH_JITTER: {
static bool flip_pitch = false;
if (flip_pitch) {
view_angles->x = 89.0f;
} else {
view_angles->x = -89.0f;
}
if (g_flCurrentTime > jitter_next_update) {
flip_pitch = !flip_pitch;
jitter_next_update = g_flCurrentTime + random_float(0.1f, 0.3f);
}
break;
}
case AA_PITCH_CUSTOM:
view_angles->x = CLAMP(custom_pitch, -89.0f, 89.0f);
break;
default:
break;
}
}
void apply_yaw_anti_aim(vec3_t* view_angles, int yaw_mode, float custom_yaw, float speed, float jitter_range) {
float time_now;
float time_delta;
static bool is_left = true;
switch (yaw_mode) {
case AA_YAW_BACKWARD:
view_angles->y += 180.0f;
break;
case AA_YAW_SPIN:
time_now = g_flCurrentTime;
time_delta = time_now - last_update_time;
spin_angle += time_delta * speed;
if (spin_angle > 360.0f) {
spin_angle -= 360.0f;
}
view_angles->y = spin_angle;
last_update_time = time_now;
break;
case AA_YAW_JITTER:
if (g_flCurrentTime > jitter_next_update) {
view_angles->y += random_float(-jitter_range, jitter_range);
jitter_next_update = g_flCurrentTime + random_float(0.1f, 0.3f);
}
break;
case AA_YAW_SIDEWAYS:
if (g_flCurrentTime > jitter_next_update) {
is_left = !is_left;
jitter_next_update = g_flCurrentTime + random_float(0.5f, 1.5f);
}
if (is_left) {
view_angles->y += 90.0f;
} else {
view_angles->y -= 90.0f;
}
break;
case AA_YAW_CUSTOM:
view_angles->y = custom_yaw;
break;
default:
break;
}
}
void apply_lby_breaker(vec3_t* view_angles, bool enable_breaker) {
if (!enable_breaker)
return;
static bool lby_update = false;
static float next_lby_update = 0.0f;
if (g_flCurrentTime > next_lby_update) {
lby_update = !lby_update;
next_lby_update = g_flCurrentTime + 1.1f;
if (lby_update) {
view_angles->y += 120.0f;
}
}
}
void apply_fake_duck(usercmd_t* cmd, bool enable_duck) {
if (!enable_duck)
return;
static int duck_state = 0;
static float next_duck_time = 0.0f;
if (g_flCurrentTime > next_duck_time) {
duck_state = (duck_state + 1) % 4;
next_duck_time = g_flCurrentTime + 0.05f;
}
if (duck_state < 2) {
cmd->buttons |= IN_DUCK;
} else {
cmd->buttons &= ~IN_DUCK;
}
}
void anti_aim(usercmd_t* cmd) {
if (!g_settings.antiaim_enabled) {
return;
}
@@ -46,54 +208,116 @@ void anti_aim(usercmd_t* cmd) {
return;
}
if ((cmd->buttons & IN_ATTACK) && !g_settings.antiaim_on_attack) {
return;
}
if (cmd->buttons & IN_USE) {
return;
}
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;
bool isBunnyHopping = cmd->buttons & IN_JUMP;
bool isStationary = (cmd->forwardmove == 0.0f && cmd->sidemove == 0.0f);
if (g_settings.fakeduck && (isStationary || isBunnyHopping || isSpacebarPressed())) {
static int duckCounter = 0;
if (duckCounter < 2) {
cmd->buttons |= IN_DUCK;
} else if (duckCounter < 4) {
cmd->buttons &= ~IN_DUCK;
if (g_settings.antiaim_pitch_enabled) {
if (g_settings.antiaim_pitch_mode == 0) {
view_angles.x = g_settings.antiaim_pitch;
view_angles.x = CLAMP(view_angles.x, -89.0f, 89.0f);
} else {
duckCounter = 0;
apply_pitch_anti_aim(&view_angles, g_settings.antiaim_pitch_mode, g_settings.antiaim_custom_pitch);
}
duckCounter++;
static float last_debug_time = 0.0f;
if (g_flCurrentTime > last_debug_time + 5.0f) {
i_engine->Con_Printf("Anti-Aim: Applied pitch angle %.1f (mode %d)\n",
view_angles.x, g_settings.antiaim_pitch_mode);
last_debug_time = g_flCurrentTime;
}
}
if (g_settings.antiaim_yaw_enabled) {
if (g_settings.antiaim_yaw_mode == 0) {
if (g_settings.antiaim_legit) {
float legit_yaw_max = 35.0f;
view_angles.y += CLAMP(g_settings.antiaim_yaw, -legit_yaw_max, legit_yaw_max);
} else {
view_angles.y += g_settings.antiaim_yaw;
}
} else {
apply_yaw_anti_aim(&view_angles, g_settings.antiaim_yaw_mode, g_settings.antiaim_custom_yaw,
g_settings.antiaim_spin_speed, g_settings.antiaim_jitter_range);
}
if (view_angles.y > 180.0f) view_angles.y -= 360.0f;
if (view_angles.y < -180.0f) view_angles.y += 360.0f;
}
apply_lby_breaker(&view_angles, g_settings.antiaim_lby_breaker);
if (g_settings.antiaim_desync) {
static bool switch_side = false;
static float next_switch = 0.0f;
if (g_flCurrentTime > next_switch) {
switch_side = !switch_side;
next_switch = g_flCurrentTime + random_float(0.4f, 0.8f);
}
if (!g_settings.antiaim_view) {
vec3_t real_angles;
i_engine->GetViewAngles(real_angles);
vec3_t server_angles;
vec_copy(server_angles, real_angles);
server_angles.y += (switch_side ? 58.0f : -58.0f);
if (server_angles.y > 180.0f) server_angles.y -= 360.0f;
if (server_angles.y < -180.0f) server_angles.y += 360.0f;
vec_copy(cmd->viewangles, server_angles);
i_engine->SetViewAngles(real_angles);
static float last_desync_log = 0.0f;
if (g_flCurrentTime > last_desync_log + 3.0f) {
i_engine->Con_Printf("Desync active: Server %.1f, Client %.1f (invisible to user)\n",
server_angles.y, real_angles.y);
last_desync_log = g_flCurrentTime;
}
return;
}
float desync_amount = switch_side ? 58.0f : -58.0f;
view_angles.y += desync_amount;
if (view_angles.y > 180.0f) view_angles.y -= 360.0f;
if (view_angles.y < -180.0f) view_angles.y += 360.0f;
}
if (view_angles.y > 180.0f) view_angles.y -= 360.0f;
if (view_angles.y < -180.0f) view_angles.y += 360.0f;
bool should_fake_duck = false;
if (g_settings.antiaim_fakeduck_key > 0) {
should_fake_duck = g_settings.antiaim_fakeduck && is_key_pressed(g_settings.antiaim_fakeduck_key);
} else {
should_fake_duck = g_settings.antiaim_fakeduck;
}
if (should_fake_duck) {
apply_fake_duck(cmd, true);
}
if (g_settings.antiaim_view) {
i_engine->SetViewAngles(view_angles);
i_engine->pfnClientCmd("echo \"Set view angles directly using movement_antiaim_view.\"");
} else {
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 \"Advanced Anti-Aim has adjusted view angles.\"");
last_log_time = cmd->msec;
if (g_flCurrentTime > last_log_time + 5.0f) {
i_engine->Con_Printf("Anti-Aim active: Pitch=%.1f, Yaw=%.1f, Mode=%d/%d\n",
view_angles.x, view_angles.y,
g_settings.antiaim_pitch_mode, g_settings.antiaim_yaw_mode);
last_log_time = g_flCurrentTime;
}
}

View File

@@ -7,6 +7,56 @@
#include <time.h>
static time_t last_log_time = 0;
static vec3_t last_punch = {0, 0, 0};
static vec3_t previous_viewangles = {0, 0, 0};
#define WEAPON_GLOCK 17
#define WEAPON_DEAGLE 26
#define WEAPON_AK47 28
#define WEAPON_M4A1 22
#define WEAPON_AWP 33
#define AK47_RECOIL_VERT_MULT 2.8f
#define AK47_RECOIL_HORIZ_MULT 0.9f
#define DEFAULT_RECOIL_VERT_MULT 2.0f
#define DEFAULT_RECOIL_HORIZ_MULT 0.6f
static float ak47_pattern[] = {
0.0f,
2.2f,
3.0f,
3.5f,
3.9f,
4.0f,
3.8f,
3.5f,
3.2f,
2.9f,
2.7f,
2.5f,
2.2f,
2.0f,
1.9f,
1.7f,
1.6f,
1.5f,
1.4f,
1.3f,
1.2f,
1.1f,
1.0f,
0.9f,
0.8f,
0.8f,
0.7f,
0.7f,
0.6f,
0.6f
};
static int bullet_count = 0;
static float last_shot_time = 0.0f;
static int current_weapon_id = -1;
void no_recoil(usercmd_t* cmd) {
if (!is_alive(localplayer) || (!g_settings.aimbot_norecoil && !g_settings.aimbot_recoil_comp)) {
@@ -14,29 +64,123 @@ void no_recoil(usercmd_t* cmd) {
}
if (!(cmd->buttons & IN_ATTACK)) {
if (g_flCurrentTime - last_shot_time > 0.2f) {
if (bullet_count > 0) {
i_engine->Con_Printf("Recoil: Reset spray pattern from %d bullets\n", bullet_count);
bullet_count = 0;
}
}
return;
}
time_t current_time = time(NULL);
if (current_time - last_log_time >= 5) {
printf("Recoil control active: Punch Angles (X: %f, Y: %f)\n", g_punchAngles[0], g_punchAngles[1]);
last_log_time = current_time;
vec3_t current_viewangles;
i_engine->GetViewAngles(current_viewangles);
bool is_ak47 = false;
bool is_high_recoil_weapon = false;
if (g_currentWeaponID == WEAPON_AK47) {
is_ak47 = true;
is_high_recoil_weapon = true;
}
else if (g_currentWeaponID == WEAPON_M4A1) {
is_high_recoil_weapon = true;
}
else if (g_flNextPrimaryAttack - g_flNextAttack < 0.15f) {
is_high_recoil_weapon = true;
if (g_flNextPrimaryAttack - g_flNextAttack < 0.11f) {
is_ak47 = true;
}
}
last_shot_time = g_flCurrentTime;
static float last_attack_time = 0.0f;
bool is_new_shot = g_flCurrentTime - last_attack_time > 0.05f;
if (is_new_shot) {
bullet_count++;
last_attack_time = g_flCurrentTime;
if (bullet_count > 1 && (bullet_count % 3 == 0 || bullet_count <= 5)) {
i_engine->Con_Printf("Recoil comp: Shot #%d, Weapon: %s\n",
bullet_count, is_ak47 ? "AK-47" : (is_high_recoil_weapon ? "High Recoil" : "Standard"));
}
}
vec3_t punch_angles;
vec_copy(punch_angles, g_punchAngles);
float vert_mult = 0.0f;
float horiz_mult = 0.0f;
float pattern_compensation = 0.0f;
if (g_settings.aimbot_norecoil) {
float multiplier = 200.0f;
if (is_ak47) {
vert_mult = AK47_RECOIL_VERT_MULT;
horiz_mult = AK47_RECOIL_HORIZ_MULT;
if (bullet_count > 0 && bullet_count <= 30) {
pattern_compensation = ak47_pattern[bullet_count-1] * 0.6f;
}
}
else if (is_high_recoil_weapon) {
vert_mult = 2.2f;
horiz_mult = 0.8f;
}
else {
vert_mult = 1.9f;
horiz_mult = 0.7f;
}
cmd->viewangles[0] -= (g_punchAngles[0] * multiplier);
cmd->viewangles[1] -= (g_punchAngles[1] * multiplier);
cmd->viewangles[0] -= (punch_angles[0] * vert_mult);
cmd->viewangles[1] -= (punch_angles[1] * horiz_mult);
printf("Applied no_recoil: %f, %f\n", -g_punchAngles[0] * multiplier, -g_punchAngles[1] * multiplier);
if (pattern_compensation > 0) {
cmd->viewangles[0] -= pattern_compensation;
if (is_ak47 && bullet_count <= 5) {
i_engine->Con_Printf("AK-47 pattern comp: Shot #%d, Compensation: %.2f degrees\n",
bullet_count, pattern_compensation);
}
}
}
else if (g_settings.aimbot_recoil_comp) {
float multiplier = 5.0f;
if (is_ak47) {
vert_mult = 2.0f;
horiz_mult = 0.7f;
if (bullet_count > 0 && bullet_count <= 30) {
pattern_compensation = ak47_pattern[bullet_count-1] * 0.35f;
}
}
else if (is_high_recoil_weapon) {
vert_mult = 1.7f;
horiz_mult = 0.6f;
}
else {
vert_mult = 1.3f;
horiz_mult = 0.5f;
}
cmd->viewangles[0] -= (g_punchAngles[0] * multiplier);
cmd->viewangles[1] -= (g_punchAngles[1] * multiplier);
cmd->viewangles[0] -= (punch_angles[0] * vert_mult);
cmd->viewangles[1] -= (punch_angles[1] * horiz_mult);
printf("Applied recoil_comp: %f, %f\n", -g_punchAngles[0] * multiplier, -g_punchAngles[1] * multiplier);
if (pattern_compensation > 0) {
cmd->viewangles[0] -= pattern_compensation;
}
}
time_t current_time = time(NULL);
if (current_time - last_log_time >= 2) {
if (bullet_count > 0) {
i_engine->Con_Printf("Recoil control - Weapon: %s, Bullet: %d, VMult: %.1f, HMult: %.1f, Pattern: %.1f\n",
is_ak47 ? "AK-47" : (is_high_recoil_weapon ? "High Recoil" : "Standard"),
bullet_count, vert_mult, horiz_mult, pattern_compensation);
}
last_log_time = current_time;
}
ang_clamp(&cmd->viewangles);
}

View File

@@ -1,4 +1,3 @@
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
@@ -13,6 +12,7 @@ vec3_t g_punchAngles = { 0, 0, 0 };
float g_flNextAttack = 0.f, g_flNextPrimaryAttack = 0.f;
int g_iClip = 0;
int g_currentWeaponID = -1;
double g_flCurrentTime = 0.0;

View File

@@ -320,6 +320,15 @@ void h_HUD_PostRunCmd(struct local_state_s* from, struct local_state_s* to,
g_flNextPrimaryAttack =
to->weapondata[to->client.m_iId].m_flNextPrimaryAttack;
g_iClip = to->weapondata[to->client.m_iId].m_iClip;
// Track current weapon ID
int weaponId = to->client.m_iId;
// Update global weapon ID if it changed
if (g_currentWeaponID != weaponId) {
g_currentWeaponID = weaponId;
i_engine->Con_Printf("Weapon changed: ID=%d\n", g_currentWeaponID);
}
}
}

View File

@@ -1,4 +1,3 @@
#ifndef GLOBALS_H_
#define GLOBALS_H_
@@ -39,6 +38,7 @@ extern vec3_t g_punchAngles;
extern float g_flNextAttack, g_flNextPrimaryAttack;
extern float* scr_fov_value;
extern int g_iClip;
extern int g_currentWeaponID;
extern double g_flCurrentTime;
extern void* hw;

View File

@@ -1,8 +1,8 @@
#ifndef MATHUTIL_H_
#define MATHUTIL_H_ 1
#include "sdk.h"
#include "util.h"
/* Vector 2 for 2d points */
typedef float vec2_t[2];
@@ -11,8 +11,6 @@ typedef float vec2_t[2];
#define DEG2RAD(n) ((n)*M_PI / 180.0f)
#define RAD2DEG(n) ((n)*180.0f / M_PI)
#define CLAMP(val, min, max) \
(((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
/* Use indexes so it works for float[] as well as vec3_t */
#define vec_copy(dst, src) \

View File

@@ -44,6 +44,37 @@ typedef struct {
bool fakeduck;
bool clmove;
int aa_pitch_mode;
int aa_yaw_mode;
float aa_custom_pitch;
float aa_custom_yaw;
float aa_spin_speed;
float aa_jitter_range;
bool aa_lby_breaker;
bool aa_desync;
bool aa_on_attack;
bool aa_first_person;
bool fake_duck;
bool antiaim_enabled;
bool antiaim_pitch_enabled;
bool antiaim_yaw_enabled;
float antiaim_pitch;
float antiaim_yaw;
bool antiaim_fakeduck;
int antiaim_fakeduck_key;
bool antiaim_desync;
bool antiaim_legit;
int antiaim_pitch_mode;
int antiaim_yaw_mode;
float antiaim_custom_pitch;
float antiaim_custom_yaw;
float antiaim_spin_speed;
float antiaim_jitter_range;
bool antiaim_lby_breaker;
bool antiaim_on_attack;
bool namechanger;
float namechanger_speed;
bool menu_allow_movement;
@@ -51,6 +82,8 @@ typedef struct {
bool thirdperson;
int thirdperson_key;
float thirdperson_dist;
bool blinker;
} cheat_settings_t;
extern cheat_settings_t g_settings;
@@ -80,7 +113,43 @@ inline void init_default_settings(void) {
g_settings.thirdperson_dist = 300.0f;
g_settings.thirdperson_key = 'C';
// Initialize anti-aim defaults
g_settings.aa_pitch_mode = 0; // None
g_settings.aa_yaw_mode = 0; // None
g_settings.aa_custom_pitch = 0.0f;
g_settings.aa_custom_yaw = 0.0f;
g_settings.aa_spin_speed = 360.0f; // One rotation per second
g_settings.aa_jitter_range = 45.0f; // ±45 degrees jitter
g_settings.aa_lby_breaker = false;
g_settings.aa_desync = false;
g_settings.aa_on_attack = false;
g_settings.aa_first_person = false;
g_settings.fake_duck = false;
// Initialize new anti-aim settings
g_settings.antiaim_enabled = false;
g_settings.antiaim_pitch_enabled = false;
g_settings.antiaim_yaw_enabled = false;
g_settings.antiaim_pitch = 89.0f; // Default to look down
g_settings.antiaim_yaw = 180.0f; // Default to backward
g_settings.antiaim_fakeduck = false;
g_settings.antiaim_fakeduck_key = 0; // No key binding
g_settings.antiaim_desync = false;
g_settings.antiaim_legit = false;
g_settings.antiaim_view = false; // Don't show anti-aim in first person by default
// Initialize advanced anti-aim settings
g_settings.antiaim_pitch_mode = 1; // Down (89°)
g_settings.antiaim_yaw_mode = 1; // Backward (180°)
g_settings.antiaim_custom_pitch = 0.0f;
g_settings.antiaim_custom_yaw = 0.0f;
g_settings.antiaim_spin_speed = 360.0f; // One rotation per second
g_settings.antiaim_jitter_range = 45.0f; // ±45 degrees jitter
g_settings.antiaim_lby_breaker = false;
g_settings.antiaim_on_attack = false;
g_settings.menu_allow_movement = true;
g_settings.blinker = false;
}
#ifdef __cplusplus

View File

@@ -23,8 +23,8 @@ typedef struct {
#define DEG2RAD(n) ((n)*M_PI / 180.0f)
#define RAD2DEG(n) ((n)*180.0f / M_PI)
#define CLAMP(val, min, max) \
(((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
#define CLAMP(x, min, max) ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x)))
#define gl_drawline_points(p0, p1, w, col) \
gl_drawline(p0[0], p0[1], p1[0], p1[1], w, col);

View File

@@ -9,6 +9,7 @@
#include "include/globals.h"
#include "include/settings.h"
#include "include/hooks.h"
#include "include/util.h"
#include <GL/gl.h>
#include "include/sdk/public/keydefs.h"
@@ -183,18 +184,28 @@ extern "C" void menu_render(void) {
if (ImGui::BeginTabBar("##Tabs", ImGuiTabBarFlags_None)) {
if (ImGui::BeginTabItem("Aimbot")) {
// Main aimbot settings section
ImGui::Text("Aimbot Settings");
ImGui::Separator();
if (ImGui::Checkbox("Enable Aimbot", &g_settings.aimbot_enabled)) {
}
if (g_settings.aimbot_enabled) {
if (ImGui::SliderFloat("FOV", &g_settings.aimbot_fov, 0.1f, 360.0f, "%.1f")) {
// Target selection section
ImGui::Text("Target Selection:");
if (ImGui::SliderFloat("FOV", &g_settings.aimbot_fov, 0.1f, 180.0f, "%.1f")) {
// Ensure value stays within limits
g_settings.aimbot_fov = CLAMP(g_settings.aimbot_fov, 0.1f, 180.0f);
}
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")) {
}
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Field of view for target selection.\nSmaller values = more precise targeting");
ImGui::EndTooltip();
}
const char* hitbox_items[] = { "Head", "Chest", "Stomach", "Pelvis", "Nearest" };
@@ -202,6 +213,66 @@ extern "C" void menu_render(void) {
current_hitbox = g_settings.aimbot_hitbox;
}
ImGui::Checkbox("Shoot Teammates", &g_settings.aimbot_team_attack);
// Aiming behavior section
ImGui::Separator();
ImGui::Text("Aiming Behavior:");
ImGui::Checkbox("Enable Smoothing", &g_settings.aimbot_smoothing_enabled);
if (g_settings.aimbot_smoothing_enabled) {
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Makes aim movement look more natural");
ImGui::EndTooltip();
}
if (ImGui::SliderFloat("Smoothing", &g_settings.aimbot_smooth, 1.0f, 100.0f, "%.1f")) {
// Ensure value stays within limits
g_settings.aimbot_smooth = CLAMP(g_settings.aimbot_smooth, 1.0f, 100.0f);
}
ImGui::Text("Lower = Faster | Higher = Smoother");
}
ImGui::Checkbox("Silent Aim", &g_settings.aimbot_silent);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Aim is only visible server-side, not in your view");
ImGui::EndTooltip();
}
// Recoil control section
ImGui::Separator();
ImGui::Text("Recoil Control:");
ImGui::Checkbox("No Recoil", &g_settings.aimbot_norecoil);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Completely removes recoil effect");
ImGui::EndTooltip();
}
ImGui::Checkbox("Recoil Compensation", &g_settings.aimbot_recoil_comp);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Dynamic recoil correction for weapons like AK-47\nAdjusts aim based on spray pattern");
ImGui::EndTooltip();
}
// Auto shoot section
ImGui::Separator();
ImGui::Text("Auto Functions:");
ImGui::Checkbox("Auto Shoot", &g_settings.aimbot_autoshoot);
if (g_settings.aimbot_autoshoot) {
@@ -223,10 +294,13 @@ extern "C" void menu_render(void) {
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);
// Weapon info section
ImGui::Separator();
ImGui::Text("Current Weapon: %s (ID: %d)",
g_currentWeaponID == 7 ? "AK-47" :
g_currentWeaponID == 16 ? "M4A1" :
g_currentWeaponID == 1 ? "Desert Eagle" : "Unknown",
g_currentWeaponID);
}
ImGui::EndTabItem();
@@ -271,6 +345,233 @@ extern "C" void menu_render(void) {
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Anti-Aim")) {
ImGui::Text("Anti-Aim Settings");
ImGui::Separator();
if (ImGui::Checkbox("Enable Anti-Aim", &g_settings.antiaim_enabled)) {
if (g_settings.antiaim_enabled) {
i_engine->Con_Printf("Anti-Aim enabled\n");
} else {
i_engine->Con_Printf("Anti-Aim disabled\n");
}
}
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Master switch for all anti-aim features");
ImGui::EndTooltip();
}
if (g_settings.antiaim_enabled) {
ImGui::Separator();
ImGui::Text("Pitch Control:");
if (ImGui::Checkbox("Enable Pitch Anti-Aim", &g_settings.antiaim_pitch_enabled)) {
if (g_settings.antiaim_pitch_enabled) {
i_engine->Con_Printf("Pitch Anti-Aim enabled\n");
} else {
i_engine->Con_Printf("Pitch Anti-Aim disabled\n");
}
}
if (g_settings.antiaim_pitch_enabled) {
const char* pitch_items[] = {"Fixed", "Down (89°)", "Up (-89°)", "Zero (0°)", "Jitter", "Custom"};
if (ImGui::Combo("Pitch Mode", &g_settings.antiaim_pitch_mode, pitch_items, 6)) {
// Reset custom pitch if mode changed
if (g_settings.antiaim_pitch_mode != 5) { // Not custom
g_settings.antiaim_custom_pitch = 0.0f;
}
}
// Show settings based on mode
if (g_settings.antiaim_pitch_mode == 0) { // Fixed
ImGui::SliderFloat("Pitch Angle", &g_settings.antiaim_pitch, -89.0f, 89.0f, "%.1f°");
}
else if (g_settings.antiaim_pitch_mode == 5) { // Custom
ImGui::SliderFloat("Custom Pitch", &g_settings.antiaim_custom_pitch, -89.0f, 89.0f, "%.1f°");
}
}
ImGui::Separator();
ImGui::Text("Yaw Control:");
if (ImGui::Checkbox("Enable Yaw Anti-Aim", &g_settings.antiaim_yaw_enabled)) {
if (g_settings.antiaim_yaw_enabled) {
i_engine->Con_Printf("Yaw Anti-Aim enabled\n");
} else {
i_engine->Con_Printf("Yaw Anti-Aim disabled\n");
}
}
if (g_settings.antiaim_yaw_enabled) {
const char* yaw_items[] = {"Fixed", "Backward (180°)", "Spin", "Jitter", "Sideways", "Custom"};
if (ImGui::Combo("Yaw Mode", &g_settings.antiaim_yaw_mode, yaw_items, 6)) {
// Reset custom yaw if mode changed
if (g_settings.antiaim_yaw_mode != 5) { // Not custom
g_settings.antiaim_custom_yaw = 0.0f;
}
}
// Show settings based on mode
if (g_settings.antiaim_yaw_mode == 0) { // Fixed
ImGui::SliderFloat("Yaw Angle", &g_settings.antiaim_yaw, -180.0f, 180.0f, "%.1f°");
}
else if (g_settings.antiaim_yaw_mode == 2) { // Spin
ImGui::SliderFloat("Spin Speed", &g_settings.antiaim_spin_speed, 10.0f, 1000.0f, "%.1f°/s");
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Controls how fast the spin rotates (degrees per second)");
ImGui::EndTooltip();
}
}
else if (g_settings.antiaim_yaw_mode == 3) { // Jitter
ImGui::SliderFloat("Jitter Range", &g_settings.antiaim_jitter_range, 5.0f, 180.0f, "%.1f°");
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Controls the maximum angle of random jitter (±degrees)");
ImGui::EndTooltip();
}
}
else if (g_settings.antiaim_yaw_mode == 5) { // Custom
ImGui::SliderFloat("Custom Yaw", &g_settings.antiaim_custom_yaw, -180.0f, 180.0f, "%.1f°");
}
}
ImGui::Separator();
ImGui::Text("Additional Options:");
ImGui::Checkbox("Anti-Aim When Shooting", &g_settings.antiaim_on_attack);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Continue anti-aim even when attacking (may affect accuracy)");
ImGui::EndTooltip();
}
ImGui::Checkbox("LBY Breaker", &g_settings.antiaim_lby_breaker);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Breaks lower body yaw for more effective anti-aim");
ImGui::EndTooltip();
}
ImGui::Checkbox("Desync", &g_settings.antiaim_desync);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Creates a desync between client and server angles.\nMakes you harder to hit but may cause visual glitches.");
ImGui::EndTooltip();
}
ImGui::Checkbox("Legit Anti-Aim", &g_settings.antiaim_legit);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Less obvious anti-aim that's harder to detect visually.\nLess effective than rage anti-aim but less noticeable.");
ImGui::EndTooltip();
}
ImGui::Checkbox("Show in First Person", &g_settings.antiaim_view);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("When enabled, you'll see your anti-aim from first person.\nWhen disabled, only others see your anti-aim.");
ImGui::EndTooltip();
}
ImGui::Checkbox("Fake Duck", &g_settings.antiaim_fakeduck);
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Rapidly switches between duck and stand positions.\nMakes you harder to hit while appearing ducked to others.");
ImGui::EndTooltip();
}
if (g_settings.antiaim_fakeduck) {
const char* key_name = "None";
if (g_settings.antiaim_fakeduck_key > 0) {
// Convert key code to name
switch(g_settings.antiaim_fakeduck_key) {
case 'F': key_name = "F"; break;
case 'V': key_name = "V"; break;
case 'T': key_name = "T"; break;
case 'P': key_name = "P"; break;
case 'C': key_name = "C"; break;
case K_F1: key_name = "F1"; break;
case K_F2: key_name = "F2"; break;
case K_F3: key_name = "F3"; break;
case K_F4: key_name = "F4"; break;
case K_F5: key_name = "F5"; break;
case K_TAB: key_name = "Tab"; break;
case K_SPACE: key_name = "Space"; break;
case K_CTRL: key_name = "Ctrl"; break;
case K_SHIFT: key_name = "Shift"; break;
case K_ALT: key_name = "Alt"; break;
case K_MOUSE1: key_name = "Mouse1"; break;
case K_MOUSE2: key_name = "Mouse2"; break;
case K_MOUSE3: key_name = "Mouse3"; break;
default: {
if (g_settings.antiaim_fakeduck_key >= 32 && g_settings.antiaim_fakeduck_key <= 126) {
static char chr[2] = {0};
chr[0] = (char)g_settings.antiaim_fakeduck_key;
key_name = chr;
} else {
static char code[32] = {0};
snprintf(code, sizeof(code), "Key %d", g_settings.antiaim_fakeduck_key);
key_name = code;
}
}
}
}
ImGui::Text("Fake Duck Key: %s", key_name);
if (g_waiting_for_key_bind && g_current_key_binding_action && strcmp(g_current_key_binding_action, "fakeduck") == 0) {
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.8f, 0.1f, 0.1f, 1.0f));
ImGui::Button("Press any key...", ImVec2(150, 25));
ImGui::PopStyleColor();
} else {
if (ImGui::Button("Bind Fake Duck Key", ImVec2(150, 25))) {
g_waiting_for_key_bind = true;
g_current_key_binding_action = "fakeduck";
i_engine->Con_Printf("Press any key to bind for fake duck\n");
}
}
ImGui::SameLine();
if (ImGui::Button("Clear##FakeDuckKey", ImVec2(80, 25))) {
g_settings.antiaim_fakeduck_key = 0;
i_engine->Con_Printf("Fake duck key binding cleared\n");
}
}
}
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Misc")) {
ImGui::Checkbox("Name Changer", &g_settings.namechanger);
@@ -291,6 +592,21 @@ extern "C" void menu_render(void) {
ImGui::Separator();
if (ImGui::Button("Reset Settings", ImVec2(150, 30))) {
settings_reset();
i_engine->pfnClientCmd("echo \"All settings have been reset to defaults.\"");
}
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.1f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Reset all settings to default values");
ImGui::EndTooltip();
}
ImGui::Separator();
if (ImGui::Button("Uninject Cheat", ImVec2(150, 30))) {
i_engine->pfnClientCmd("dz_uninject");
g_menu_open = false;

View File

@@ -162,6 +162,27 @@ void settings_reset(void) {
g_settings.fakeduck = false;
g_settings.clmove = false;
// Reset anti-aim settings
g_settings.antiaim_enabled = false;
g_settings.antiaim_pitch_enabled = false;
g_settings.antiaim_yaw_enabled = false;
g_settings.antiaim_pitch = 89.0f;
g_settings.antiaim_yaw = 180.0f;
g_settings.antiaim_fakeduck = false;
g_settings.antiaim_fakeduck_key = 0;
g_settings.antiaim_desync = false;
g_settings.antiaim_legit = false;
// Reset advanced anti-aim settings
g_settings.antiaim_pitch_mode = 1; // Down (89°)
g_settings.antiaim_yaw_mode = 1; // Backward (180°)
g_settings.antiaim_custom_pitch = 0.0f;
g_settings.antiaim_custom_yaw = 0.0f;
g_settings.antiaim_spin_speed = 360.0f; // One rotation per second
g_settings.antiaim_jitter_range = 45.0f; // ±45 degrees jitter
g_settings.antiaim_lby_breaker = false;
g_settings.antiaim_on_attack = false;
g_settings.namechanger = false;
g_settings.fov = 90.0f;