-
Автор темы
- #1
Не работают мануал AA и auto_directional
Пытался брать с других читов итог:
Начинают работать При выстреле стопит и спамит выстрелами Если даже их не юзать происходит то что и там
Без них работает онли тот который смотрит назад и всё работает как часики, хз как это исправить
Код: (ПРОШУ ХЕЛПП)
Пытался брать с других читов итог:
Начинают работать При выстреле стопит и спамит выстрелами Если даже их не юзать происходит то что и там
Без них работает онли тот который смотрит назад и всё работает как часики, хз как это исправить
Код: (ПРОШУ ХЕЛПП)
antiaim.cpp:
// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "antiaim.h"
#include "knifebot.h"
#include "zeusbot.h"
#include "..\misc\fakelag.h"
#include "..\misc\prediction_system.h"
#include "..\misc\misc.h"
#include "..\lagcompensation\local_animations.h"
void antiaim::create_move(CUserCmd* m_pcmd)
{
auto velocity = g_ctx.local()->m_vecVelocity().Length();
type = ANTIAIM_STAND;
if (g_cfg.antiaim.antiaim_type)
type = ANTIAIM_LEGIT;
if (!g_cfg.ragebot.enable && type != ANTIAIM_LEGIT)
return;
if (condition(m_pcmd))
return;
if ((type == ANTIAIM_LEGIT ? g_cfg.antiaim.desync : g_cfg.antiaim.type[type].desync) && (type == ANTIAIM_LEGIT ? !g_cfg.antiaim.legit_lby_type : !g_cfg.antiaim.lby_type) && !g_cfg.misc.fast_stop && (!g_ctx.globals.weapon->is_grenade() || g_cfg.esp.on_click && !(m_pcmd->m_buttons & IN_ATTACK) && !(m_pcmd->m_buttons & IN_ATTACK2)) && engineprediction::get().backup_data.velocity.Length2D() <= 20.0f) //-V648
{
auto speed = 1.01f;
if (m_pcmd->m_buttons & IN_DUCK || g_ctx.globals.fakeducking)
speed *= 2.94117647f;
static auto switch_move = false;
if (switch_move)
m_pcmd->m_sidemove += speed;
else
m_pcmd->m_sidemove -= speed;
switch_move = !switch_move;
}
if (type != ANTIAIM_LEGIT)
m_pcmd->m_viewangles.x = get_pitch(m_pcmd);
if (!flicker)
m_pcmd->m_viewangles.y = get_yaw(m_pcmd);
desync_on_shot(m_pcmd);
if (g_cfg.antiaim.roll_enabled)
m_pcmd->m_viewangles.z = flip == true ? g_cfg.antiaim.roll : -g_cfg.antiaim.roll;
fakeflickbylabeforrolix(m_pcmd);
}
void antiaim::desync_on_shot(CUserCmd* cmd) {
if (!g_ctx.local() || !g_cfg.antiaim.desync_on_shot)
return;
if (cmd->m_buttons & IN_ATTACK && !g_ctx.globals.fakeducking
&& m_clientstate()->iChokedCommands != 0
&& (cmd->m_command_number - g_ctx.globals.shot_command) == 1) {
if (!g_ctx.send_packet) {
float desync_delta;
if (!flip)
desync_delta = min(desync_delta, (float)g_cfg.antiaim.type[type].desync_range);
else
desync_delta = min(desync_delta, (float)g_cfg.antiaim.type[type].inverted_desync_range);
cmd->m_viewangles.y += desync_delta;
}
}
}
float antiaim::get_pitch(CUserCmd* m_pcmd)
{
static auto invert_jitter = false;
static auto should_invert = false;
if (g_ctx.send_packet)
should_invert = true;
else if (!g_ctx.send_packet && should_invert) //-V560
{
should_invert = false;
invert_jitter = !invert_jitter;
}
auto pitch = m_pcmd->m_viewangles.x;
switch (g_cfg.antiaim.type[type].pitch)
{
case 1:
pitch = 89.0f;
break;
case 2:
pitch = -89.0f;
break;
case 3:
pitch = 0.0f;
break;
case 4:
pitch = math::random_float(-89.0f, 89.0f);
break;
case 5:
pitch = invert_jitter ? 89.0f : -89.0f;
break;
case 6:
pitch = g_cfg.misc.anti_untrusted ? 89.0f : 540.0f;
break;
case 7:
pitch = g_cfg.misc.anti_untrusted ? -89.0f : -540.0f;
break;
case 8:
pitch = invert_jitter ? (g_cfg.misc.anti_untrusted ? 89.0f : 540.0f) : (g_cfg.misc.anti_untrusted ? -89.0f : -540.0f);
break;
}
return pitch;
}
float antiaim::get_yaw(CUserCmd* m_pcmd)
{
static auto invert_jitter = false;
static auto should_invert = false;
if (g_ctx.send_packet)
should_invert = true;
else if (!g_ctx.send_packet && should_invert) //-V560
{
should_invert = false;
invert_jitter = !invert_jitter;
}
auto max_desync_delta = g_ctx.local()->get_max_desync_delta(); //-V807
auto yaw = 0.0f;
auto lby_type = 0;
if (type == ANTIAIM_LEGIT)
{
yaw = m_pcmd->m_viewangles.y;
if (!g_cfg.antiaim.desync)
return yaw;
if (g_cfg.antiaim.desync != 2 && (g_cfg.antiaim.flip_desync.key <= KEY_NONE || g_cfg.antiaim.flip_desync.key >= KEY_MAX))
flip = automatic_direction();
else if (g_cfg.antiaim.desync == 1)
flip = key_binds::get().get_key_bind_state(16);
else if (g_cfg.antiaim.desync == 2)
flip = invert_jitter;
desync_angle = max_desync_delta;
if (g_cfg.antiaim.legit_lby_type && g_ctx.local()->m_vecVelocity().Length() < 5.0f && g_ctx.local()->m_fFlags() & FL_ONGROUND && engineprediction::get().backup_data.flags & FL_ONGROUND)
desync_angle *= 2.0f;
if (flip)
{
desync_angle = -desync_angle;
max_desync_delta = -max_desync_delta;
}
yaw -= desync_angle;
lby_type = g_cfg.antiaim.legit_lby_type;
}
else
{
auto base_angle = m_pcmd->m_viewangles.y + 180.0f;
if (final_manual_side == SIDE_LEFT)
base_angle -= 90.0f;
if (final_manual_side == SIDE_RIGHT)
base_angle += 90.0f;
if (g_cfg.antiaim.type[type].base_angle && manual_side == SIDE_NONE)
base_angle = at_targets();
if (g_cfg.antiaim.type[type].desync != 2 && (g_cfg.antiaim.flip_desync.key <= KEY_NONE || g_cfg.antiaim.flip_desync.key >= KEY_MAX))
{
if (final_manual_side == SIDE_LEFT)
flip = true;
else if (final_manual_side == SIDE_RIGHT)
flip = false;
else
flip = automatic_direction();
}
else if (g_cfg.antiaim.type[type].desync == 1)
flip = key_binds::get().get_key_bind_state(16);
auto yaw_angle = 0.0f;
switch (g_cfg.antiaim.type[type].yaw)
{
case 1:
yaw_angle = invert_jitter ? (float)g_cfg.antiaim.type[type].range * -0.5f : (float)g_cfg.antiaim.type[type].range * 0.5f;
break;
case 2:
{
if (flip)
{
auto start_angle = (float)g_cfg.antiaim.type[type].range * 0.5f;
auto end_angle = (float)g_cfg.antiaim.type[type].range * -0.5f;
static auto angle = start_angle;
auto angle_add_amount = (float)g_cfg.antiaim.type[type].speed * 0.5f;
if (angle - angle_add_amount >= end_angle)
angle -= angle_add_amount;
else
angle = start_angle;
yaw_angle = angle;
}
else
{
auto start_angle = (float)g_cfg.antiaim.type[type].range * -0.5f;
auto end_angle = (float)g_cfg.antiaim.type[type].range * 0.5f;
static auto angle = start_angle;
auto angle_add_amount = (float)g_cfg.antiaim.type[type].speed * 0.5f;
if (angle + angle_add_amount <= end_angle)
angle += angle_add_amount;
else
angle = start_angle;
yaw_angle = angle;
}
}
break;
}
desync_angle = 0.0f;
if (g_cfg.antiaim.type[type].desync)
{
if (g_cfg.antiaim.type[type].desync == 2)
flip = invert_jitter;
auto desync_delta = max_desync_delta;
if (type == ANTIAIM_STAND && g_cfg.antiaim.lby_type)
desync_delta *= 2.0f;
else
{
if (!flip)
desync_delta = min(desync_delta, (float)g_cfg.antiaim.type[type].desync_range);
else
desync_delta = min(desync_delta, (float)g_cfg.antiaim.type[type].inverted_desync_range);
}
if (!flip)
{
desync_delta = -desync_delta;
max_desync_delta = -max_desync_delta;
}
base_angle -= desync_delta;
if (type != ANTIAIM_STAND && type != ANTIAIM_LEGIT || !g_cfg.antiaim.lby_type)
{
if (!flip)
base_angle += desync_delta * (float)g_cfg.antiaim.type[type].body_lean * 0.01f;
else
base_angle += desync_delta * (float)g_cfg.antiaim.type[type].inverted_body_lean * 0.01f;
}
desync_angle = desync_delta;
}
yaw = base_angle + yaw_angle;
if (!desync_angle) //-V550
return yaw;
lby_type = g_cfg.antiaim.lby_type;
}
static auto sway_counter = 0;
static auto force_choke = false;
if (should_break_lby(m_pcmd, lby_type))
{
auto speed = 1.01f;
if (m_pcmd->m_buttons & IN_DUCK || g_ctx.globals.fakeducking)
speed *= 2.94117647f;
static auto switch_move = false;
if (switch_move)
m_pcmd->m_sidemove += speed;
else
m_pcmd->m_sidemove -= speed;
switch_move = !switch_move;
if (lby_type != 2 || sway_counter > 3)
{
if (desync_angle > 0.0f)
yaw -= 179.0f;
else
yaw += 179.0f;
}
if (sway_counter < 8)
++sway_counter;
else
sway_counter = 0;
breaking_lby = true;
force_choke = true;
g_ctx.send_packet = false;
return yaw;
}
else if (force_choke)
{
force_choke = false;
g_ctx.send_packet = false;
return yaw;
}
else if (g_ctx.send_packet)
yaw += desync_angle;
return yaw;
}
bool antiaim::condition(CUserCmd* m_pcmd, bool dynamic_check)
{
if (!m_pcmd)
return true;
if (!g_ctx.available())
return true;
if (!g_cfg.antiaim.enable)
return true;
if (!g_ctx.local()->is_alive()) //-V807
return true;
if (g_ctx.local()->m_bGunGameImmunity() || g_ctx.local()->m_fFlags() & FL_FROZEN)
return true;
if (g_ctx.local()->get_move_type() == MOVETYPE_NOCLIP || g_ctx.local()->get_move_type() == MOVETYPE_LADDER)
return true;
if (g_ctx.globals.aimbot_working)
return true;
auto weapon = g_ctx.local()->m_hActiveWeapon().Get();
if (!weapon)
return true;
if (m_pcmd->m_buttons & IN_ATTACK && weapon->m_iItemDefinitionIndex() != WEAPON_REVOLVER && !weapon->is_non_aim())
return true;
auto revolver_shoot = weapon->m_iItemDefinitionIndex() == WEAPON_REVOLVER && !g_ctx.globals.revolver_working && (m_pcmd->m_buttons & IN_ATTACK || m_pcmd->m_buttons & IN_ATTACK2);
if (revolver_shoot)
return true;
if ((m_pcmd->m_buttons & IN_ATTACK || m_pcmd->m_buttons & IN_ATTACK2) && weapon->is_knife())
return true;
if (dynamic_check && freeze_check)
return true;
if (m_pcmd->m_buttons & IN_USE && !g_cfg.antiaim.antiaim_type)
type = ANTIAIM_LEGIT;
else if (g_cfg.antiaim.antiaim_type)
type = ANTIAIM_LEGIT;
if (dynamic_check && weapon->is_grenade() && weapon->m_fThrowTime())
return true;
return false;
}
bool antiaim::should_break_lby(CUserCmd* m_pcmd, int lby_type)
{
if (!lby_type)
return false;
if (g_ctx.globals.fakeducking && m_clientstate()->iChokedCommands > 12)
return false;
if (!g_ctx.globals.fakeducking && m_clientstate()->iChokedCommands > 14)
{
g_ctx.send_packet = true;
fakelag::get().started_peeking = false;
}
auto animstate = g_ctx.local()->get_animation_state(); //-V807
if (!animstate)
return false;
if (animstate->m_velocity > 0.1f || fabs(animstate->flUpVelocity) > 100.0f)
g_ctx.globals.next_lby_update = TICKS_TO_TIME(g_ctx.globals.fixed_tickbase + 14);
else
{
if (TICKS_TO_TIME(g_ctx.globals.fixed_tickbase) > g_ctx.globals.next_lby_update)
{
g_ctx.globals.next_lby_update = 0.0f;
return true;
}
}
return false;
}
float antiaim::at_targets()
{
player_t* target = nullptr;
auto best_fov = FLT_MAX;
for (auto i = 1; i < m_globals()->m_maxclients; i++)
{
auto e = static_cast<player_t*>(m_entitylist()->GetClientEntity(i));
if (!e->valid(true))
continue;
auto weapon = e->m_hActiveWeapon().Get();
if (!weapon)
continue;
if (weapon->is_non_aim())
continue;
Vector angles;
m_engine()->GetViewAngles(angles);
auto fov = math::get_fov(angles, math::calculate_angle(g_ctx.globals.eye_pos, e->GetAbsOrigin()));
if (fov < best_fov)
{
best_fov = fov;
target = e;
}
}
auto angle = 180.0f;
if (manual_side == SIDE_LEFT)
angle = 90.0f;
else if (manual_side == SIDE_RIGHT)
angle = -90.0f;
if (!target)
return g_ctx.get_command()->m_viewangles.y + angle;
return math::calculate_angle(g_ctx.globals.eye_pos, target->GetAbsOrigin()).y + angle;
}
bool antiaim::automatic_direction()
{
float Right, Left;
Vector src3D, dst3D, forward, right, up;
trace_t tr;
Ray_t ray_right, ray_left;
CTraceFilter filter;
Vector engineViewAngles;
m_engine()->GetViewAngles(engineViewAngles);
engineViewAngles.x = 0.0f;
math::angle_vectors(engineViewAngles, &forward, &right, &up);
filter.pSkip = g_ctx.local();
src3D = g_ctx.globals.eye_pos;
dst3D = src3D + forward * 100.0f;
ray_right.Init(src3D + right * 35.0f, dst3D + right * 35.0f);
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray_right, MASK_SOLID & ~CONTENTS_MONSTER, &filter, &tr);
g_ctx.globals.autowalling = false;
Right = (tr.endpos - tr.startpos).Length();
ray_left.Init(src3D - right * 35.0f, dst3D - right * 35.0f);
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray_left, MASK_SOLID & ~CONTENTS_MONSTER, &filter, &tr);
g_ctx.globals.autowalling = false;
Left = (tr.endpos - tr.startpos).Length();
static auto left_ticks = 0;
static auto right_ticks = 0;
if (Left - Right > 10.0f)
left_ticks++;
else
left_ticks = 0;
if (Right - Left > 10.0f)
right_ticks++;
else
right_ticks = 0;
if (right_ticks > 10)
return true;
else if (left_ticks > 10)
return false;
return flip;
}
void antiaim::freestanding(CUserCmd* m_pcmd)
{
float Right, Left;
Vector src3D, dst3D, forward, right, up;
trace_t tr;
Ray_t ray_right, ray_left;
CTraceFilter filter;
Vector engineViewAngles;
m_engine()->GetViewAngles(engineViewAngles);
engineViewAngles.x = 0.0f;
math::angle_vectors(engineViewAngles, &forward, &right, &up);
filter.pSkip = g_ctx.local();
src3D = g_ctx.globals.eye_pos;
dst3D = src3D + forward * 100.0f;
ray_right.Init(src3D + right * 35.0f, dst3D + right * 35.0f);
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray_right, MASK_SOLID & ~CONTENTS_MONSTER, &filter, &tr);
g_ctx.globals.autowalling = false;
Right = (tr.endpos - tr.startpos).Length();
ray_left.Init(src3D - right * 35.0f, dst3D - right * 35.0f);
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray_left, MASK_SOLID & ~CONTENTS_MONSTER, &filter, &tr);
g_ctx.globals.autowalling = false;
Left = (tr.endpos - tr.startpos).Length();
static auto left_ticks = 0;
static auto right_ticks = 0;
static auto back_ticks = 0;
if (Right - Left > 20.0f)
left_ticks++;
else
left_ticks = 0;
if (Left - Right > 20.0f)
right_ticks++;
else
right_ticks = 0;
if (fabs(Right - Left) <= 20.0f)
back_ticks++;
else
back_ticks = 0;
m_back = back_ticks;
m_left = left_ticks;
m_right = right_ticks;
}
float WallThickness(Vector from, Vector to, player_t* skip, player_t* skip2)
{
Vector endpos1, endpos2;
Ray_t ray;
ray.Init(from, to);
CTraceFilterSkipTwoEntities filter(skip, skip2);
trace_t trace1, trace2;
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace1);
g_ctx.globals.autowalling = false;
if (trace1.DidHit())
endpos1 = trace1.endpos;
else
return -1.f;
ray.Init(to, from);
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace2);
g_ctx.globals.autowalling = false;
if (trace2.DidHit())
endpos2 = trace2.endpos;
return endpos1.DistTo(endpos2);
}
void antiaim::do_fr(CUserCmd* cmd)
{
if (!g_cfg.antiaim.freestand)
return;
freestanding(cmd);
//////////////////////////////***/////////////////////////////
float best_rotation = 0.f;
auto local_eyeposition = g_ctx.globals.eye_pos;
auto head_position = g_ctx.local()->hitbox_position(HITBOX_HEAD);
auto origin = g_ctx.local()->m_vecOrigin();
float thickest = -1.f;
float step = (2 * M_PI) / 8.f;
float radius = fabs(Vector(head_position - origin).Length2D());
player_t* target = nullptr;
auto best_fov = FLT_MAX;
for (auto i = 1; i < m_globals()->m_maxclients; i++)
{
auto e = static_cast<player_t*>(m_entitylist()->GetClientEntity(i));
if (!e->valid(true))
continue;
auto weapon = e->m_hActiveWeapon().Get();
if (!weapon)
continue;
if (weapon->is_non_aim())
continue;
Vector angles;
m_engine()->GetViewAngles(angles);
auto fov = math::get_fov(angles, math::calculate_angle(g_ctx.globals.eye_pos, e->GetAbsOrigin()));
if (fov < best_fov)
{
best_fov = fov;
target = e;
}
}
if (!target)
at_targets();
if (m_right > 10 || m_left > 10)
{
for (float rotation = 0; rotation < (M_PI * 2.0); rotation += step)
{
Vector newhead(radius * cos(rotation) + local_eyeposition.x, radius * sin(rotation) + local_eyeposition.y, local_eyeposition.z);
float thickness = WallThickness(target->get_shoot_position(), newhead, target, g_ctx.local());
if (thickness > thickest)
{
thickest = thickness;
best_rotation = rotation;
}
}
free_stand = RAD2DEG(best_rotation);
}
else if (m_back > 10)
free_stand = at_targets();
else
free_stand = 180.0f;
}
bool antiaim::freestand_nix(float& ang)
{
if (!g_cfg.antiaim.freestand)
return false;
if (!g_ctx.local() || !g_ctx.local()->is_alive())
{
return false;
}
auto local = g_ctx.local();
bool no_active = true;
float bestrotation = 0.f;
float highestthickness = 0.f;
static float hold = 0.f;
Vector besthead;
auto leyepos = g_ctx.globals.eye_pos;
auto headpos = local->hitbox_position(0); //GetHitboxPosition(local_player, 0);
auto origin = local->m_vecOrigin();
auto checkWallThickness = [&](player_t* pPlayer, Vector newhead) -> float
{
Vector endpos1, endpos2;
Vector eyepos = pPlayer->m_vecOrigin() + pPlayer->m_vecViewOffset();
Ray_t ray;
ray.Init(newhead, eyepos);
CTraceFilterSkipTwoEntities filter(pPlayer, local);
trace_t trace1, trace2;
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY | MASK_OPAQUE_AND_NPCS, &filter, &trace1);
g_ctx.globals.autowalling = false;
if (trace1.DidHit())
{
endpos1 = trace1.endpos;
}
else
{
return 0.f;
}
ray.Init(eyepos, newhead);
g_ctx.globals.autowalling = true;
m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY | MASK_OPAQUE_AND_NPCS, &filter, &trace2);
g_ctx.globals.autowalling = false;
if (trace2.DidHit())
{
endpos2 = trace2.endpos;
}
float add = newhead.DistTo(eyepos) - leyepos.DistTo(eyepos) + 3.f;
return endpos1.DistTo(endpos2) + add / 3;
};
int index = GetNearestPlayerToCrosshair();
static player_t* entity;
if (!local->is_alive())
{
hold = 0.f;
}
if (index != -1)
{
entity = (player_t*)m_entitylist()->GetClientEntity(index); // maybe?
}
if (!entity || entity == nullptr)
{
return false;
}
float radius = Vector(headpos - origin).Length2D();
if (index == -1)
{
no_active = true;
}
else
{
float step = (M_PI * 2) / 90;
for (float besthead = 0; besthead < (M_PI * 2); besthead += step)
{
Vector newhead(radius * cos(besthead) + leyepos.x, radius * sin(besthead) + leyepos.y, leyepos.z);
float totalthickness = 0.f;
no_active = false;
totalthickness += checkWallThickness(entity, newhead);
if (totalthickness > highestthickness)
{
highestthickness = totalthickness;
bestrotation = besthead;
}
}
}
if (no_active)
{
return false;
}
else
{
ang = RAD2DEG(bestrotation);
return true;
}
return false;
}
int antiaim::GetNearestPlayerToCrosshair()
{
float BestFov = FLT_MAX;
int BestEnt = -1;
Vector MyAng;
m_engine()->GetViewAngles(MyAng);
for (int i = 1; i < 65; i++)
{
auto entity = static_cast<player_t*>(m_entitylist()->GetClientEntity(i));
if (!entity || !g_ctx.local() || !entity->is_player() || entity == g_ctx.local() || entity->IsDormant()
|| !entity->is_alive() || entity->m_iTeamNum() == g_ctx.local()->m_iTeamNum())
{
continue;
}
auto CFov = math::get_fov(MyAng, math::calculate_angle(g_ctx.globals.eye_pos, entity->GetAbsOrigin()));
if (CFov < BestFov)
{
BestFov = CFov;
BestEnt = i;
}
}
return BestEnt;
}
bool antiaim::MatchShot(player_t* player)
{
// do not attempt to do this in nospread mode.
float shoot_time = -1.f;
auto weapon = player->m_hActiveWeapon();
if (weapon) {
// with logging this time was always one tick behind.
// so add one tick to the last shoot time.
shoot_time = weapon->m_fLastShotTime() + m_globals()->m_intervalpertick;
}
// this record has a shot on it.
if (TIME_TO_TICKS(shoot_time) == TIME_TO_TICKS(player->m_flSimulationTime()))
{
return true;
}
return false;
}
bool antiaim::anti_brute(bool flip)
{
if (!g_cfg.antiaim.anti_brute)
return false;
if (!g_ctx.local() || !g_ctx.local()->is_alive())
{
return false;
}
int index = GetNearestPlayerToCrosshair();
static player_t* entity;
if (index != -1)
{
entity = (player_t*)m_entitylist()->GetClientEntity(index); // maybe?
}
if (!entity || entity == nullptr)
{
return false;
}
static float shot[65];
bool shoot;
if (entity->m_hActiveWeapon())
{
if (shot[index] != entity->m_hActiveWeapon()->m_fLastShotTime())
{
shoot = true;
shot[index] = entity->m_hActiveWeapon()->m_fLastShotTime();
}
else
shoot = false;
}
else
{
shoot = false;
shot[index] = 0.f;
}
/**/
auto pWeapon = entity->m_hActiveWeapon();
auto simtime = entity->m_flSimulationTime();
auto oldsimtime = entity->m_flOldSimulationTime();
float m_flLastShotTime;
bool m_shot;
m_flLastShotTime = pWeapon ? pWeapon->m_fLastShotTime() : 0.f;
m_shot = m_flLastShotTime > oldsimtime && m_flLastShotTime <= simtime;
/**/
if (shoot || m_flLastShotTime <= simtime && m_shot || MatchShot(entity))
{
flip = !flip;
}
}
void antiaim::fakeflickbylabeforrolix(CUserCmd* m_pcmd)
{
if (m_pcmd->m_buttons & IN_ATTACK || m_pcmd->m_buttons & IN_ATTACK2 || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_FLASHBANG || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_HEGRENADE || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SMOKEGRENADE || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_MOLOTOV || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_DECOY || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_INCGRENADE)
return;
if (!g_cfg.antiaim.flick)
return;
if (!g_ctx.local()->is_alive())
return;
if (m_globals()->m_tickcount % g_cfg.antiaim.flicktick - 1 == 0)
g_ctx.globals.tickbase_shift++;
if (m_globals()->m_tickcount % g_cfg.antiaim.flicktick == 0) {
flicker = true;
int angle = flip == true ? -90 : 90;
m_pcmd->m_viewangles.y = m_pcmd->m_viewangles.y + angle;
}
else {
flicker = false;
}
}
antiaim.h:
#pragma once
#include "..\autowall\autowall.h"
#include "..\..\includes.hpp"
#include "..\..\sdk\structs.hpp"
class antiaim : public singleton <antiaim>
{
public:
void fakeflickbylabeforrolix(CUserCmd* m_pcmd);
void create_move(CUserCmd* m_pcmd);
void desync_on_shot(CUserCmd* cmd);
bool freestand_nix(float& ang);
void get_best_target();
int GetNearestPlayerToCrosshair();
bool MatchShot(player_t* player);
bool anti_brute(bool flip);
float get_pitch(CUserCmd* m_pcmd);
float get_yaw(CUserCmd* m_pcmd);
bool condition(CUserCmd* m_pcmd, bool dynamic_check = true);
bool should_break_lby(CUserCmd* m_pcmd, int lby_type);
float at_targets();
bool automatic_direction();
void freestanding(CUserCmd* m_pcmd);
void edge_anti_aim(CUserCmd* m_pcmd);
void do_fr(CUserCmd* cmd);
float corrected_tickbase(CUserCmd* cmd);
void predict_lby_update(float sampletime, CUserCmd* ucmd, bool& sendpacket);
void better_freestand();
float best_head_yaw();
bool flicker = false;
void lagsync(CUserCmd* m_pcmd);
int type = 0;
int manual_side = -1;
int final_manual_side = -1;
bool flip = false;
bool freeze_check = false;
bool breaking_lby = false;
float desync_angle = 0.0f;
float free_stand = 0.0f;
int m_right;
int m_left;
int m_back;
bool dt_cond(CUserCmd* m_pcmd);
};
enum
{
SIDE_NONE = -1,
SIDE_BACK,
SIDE_LEFT,
SIDE_RIGHT,
SIDE_FORWARD,
SIDE_FR
};