-
Автор темы
- #1
if (!c_config::get().aimbot_resolver)
return;
auto local_player = Globals::LocalPlayer;
if (!local_player)
return;
if (!player)
return;
if (player->GetTeam() == Globals::LocalPlayer->GetTeam())
return;
bool is_local_player = player == local_player;
bool is_teammate = local_player->GetTeam() == player->GetTeam() && !is_local_player;
if (is_local_player)
return;
if (is_teammate)
return;
if (player->GetHealth() <= 0)
return;
if (local_player->GetHealth() <= 0)
return;
auto idx = player->EntIndex();
auto state = player->GetBasePlayerAnimState();
auto lby = player->GetLowerBodyYaw();
static float oldSimtimeShot[65];
static float storedSimtimeShot[65];
static float OldStoredLby[65];
static float StoredLby[65];
static float ShotTime[65];
bool shot = false;
bool ShotCounterWithFalseAndTrue;
bool CounterSHot;
static bool jittering[65];
static float oldSimtime[65];
static float storedSimtime[65];
static float SideTime[65][3];
static int LastDesyncSide[65];
static bool Delaying[1];
static AnimationLayer StoredLayers[64][30];//15
static C_AnimState * StoredAnimState[65];
static float StoredPosParams[65][48];//24
static Vector oldEyeAngles[65];
static float oldGoalfeetYaw[65];
float* PosParams = (float*)((uintptr_t)player + 0x2774);
bool update = false;
auto player_animation_state = player->AnimState();
auto RemapVal = [](float val, float A, float B, float C, float D) -> float
{
if (A == B)
return val >= B ? D : C;
return C + (D - C) * (val - A) / (B - A);
};
resolver_record _player[64];
auto& record = _player[idx];
if (state)
{
state->m_flEyeYaw = player->GetEyeAnglesXY()->y;
state->m_flEyePitch = player->GetEyeAnglesXY()->x;
player->setAnimationState(state);
}
if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
{
state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);
player->setAnimationState(state);
}
else
{
if (state)
{
state->m_flGoalFeetYaw = approach_angle(lby, state->m_flGoalFeetYaw,
state->m_flLastClientSideAnimationUpdateTime * 100.0f);
player->setAnimationState(state);
}
}
record.current_tick.eyes = player->GetEyeAnglesXY()->y;
if (record.current_tick.last_lby == FLT_MAX)
{
record.current_tick.last_lby = lby;
}
bool one = false;
bool two = false;
record.current_tick.lby_delta = record.current_tick.last_lby - lby;
record.current_tick.eye_lby_delta = lby - record.current_tick.eyes;
if (record.current_tick.last_lby != FLT_MAX)
{
if (record.current_tick.last_lby == 979) // the current layer must be triggering 979
{
if (record.current_tick.lby_delta == 979) // the previous layer must be trigerring 979
{
// we can tell now that he is surely breaking lby in some sort
if (record.current_tick.last_lby != record.current_tick.lby_delta)
{
float
flAnimTime = record.current_tick.lby_delta,
flSimTime = player->GetSimulationTime();
record.current_tick.last_lby = player->GetLowerBodyYaw() - 180.f; // for the resolver it's enough here to just flip him, because we will backtrack him
}
else if (player->GetVelocity().Length2D() > 0.1f) // breaking lby with delta < 120; can fakewalk here aswell
{
if (record.current_tick.last_lby != lby)
record.current_tick.last_lby = lby;
one = false, two = false;
}
}
}
else
{
record.current_tick.lby_delta = record.current_tick.last_lby - lby;
if (record.current_tick.last_lby != lby)
{
if (solve_desync_simple(player))
{
if (delta_58(record.current_tick.last_lby, lby))
{
record.current_tick.low_delta = true;
record.current_tick.high_delta = false;
}
else
{
record.current_tick.low_delta = false;
record.current_tick.high_delta = true;
}
if (delta_58(lby, record.current_tick.eyes) && delta_58(record.current_tick.last_lby, record.current_tick.eyes))
{
if (!one || !two)
record.current_tick.jitter_desync = false;
if (one && two)
record.current_tick.jitter_desync = true;
}
if (record.current_tick.low_delta && !delta_58(record.current_tick.last_lby, record.current_tick.eyes))
{
if (!one)
one = true;
if (!two && one)
two = true;
if (one && two)
record.current_tick.jitter_desync = true;
}
// else
// record.current_tick.low_delta = true;
}
else
record.current_tick.static_desync = true;
}
else
{
if (!solve_desync_simple(player))
{
one = false, two = false;
record.current_tick.static_desync = true;
record.current_tick.jitter_desync = false;
}
else
{
if (!delta_58(record.current_tick.last_lby, record.current_tick.eyes))
{
record.current_tick.low_delta = false;
record.current_tick.high_delta = true;
record.current_tick.jitter_desync = true;
}
else
{
record.current_tick.low_delta = true;
record.current_tick.high_delta = false;
record.current_tick.jitter_desync = true;
}
}
}
}
}
auto slow_walking = [&player]() -> bool
{
bool s = g_Resolver.enemy_is_slow_walking(player);
if (s)
{
if (!(player->GetFlags() & FL_DUCKING))
{
g_Resolver.enemy_slowwalk = true;
return true;
}
else
{
g_Resolver.enemy_slowwalk = false;
return false;
}
}
else
return false;
};
if (slow_walking() && Globals::MissedShots[player->EntIndex()] >= 1)
{
Globals::enemyslow[player->EntIndex()] = true;
}
auto max_rotate = max_desync_angle(player);
auto delta = angle_difference(player->GetEyeAnglesXY()->y, player->AnimState()->m_flCurrentFeetYaw);
if (record.current_tick.low_delta && !record.current_tick.jitter_desync && record.current_tick.lby_delta < 58.f)
{
player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
Globals::rmode[player->EntIndex()] = 4;
}
else if (record.current_tick.jitter_desync && (!record.current_tick.high_delta || record.current_tick.low_delta))
{
// record.current_tick.eye_lby_delta
player->GetEyeAnglesXY()->y = lby + (-record.current_tick.eye_lby_delta);
Globals::rmode[player->EntIndex()] = 5;
}
else if (record.current_tick.jitter_desync && record.current_tick.high_delta)
{
player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
Globals::rmode[player->EntIndex()] = 6;
}
else if (record.current_tick.low_delta && record.current_tick.jitter_desync)
{
player->GetEyeAnglesXY()->y = lby - record.current_tick.lby_delta;
Globals::rmode[player->EntIndex()] = 7;
}
else
{
const auto player_animation_state = player->AnimState();
if (!player_animation_state)
return;
float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);
auto v48 = 0.f;
if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
{
v48 = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
}
else
{
v48 = 0.0f;
}
float v49 = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;
float flYawModifier = v49 + 1.0;
if (player_animation_state->m_fDuckAmount > 0.0)
{
float v53 = 0.0f;
if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
{
v53 = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
}
else
{
v53 = 0.0f;
}
}
float flMaxYawModifier = player_animation_state->pad10[516] * flYawModifier;
float flMinYawModifier = player_animation_state->pad10[512] * flYawModifier;
float newFeetYaw = 0.f;
auto eyeYaw = player_animation_state->m_flEyeYaw;
auto lbyYaw = player_animation_state->m_flGoalFeetYaw;
float eye_feet_delta = fabs(eyeYaw - lbyYaw);
if (eye_feet_delta <= flMaxYawModifier)
{
if (flMinYawModifier > eye_feet_delta)
{
newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
}
}
else
{
newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
}
float v136 = fmod(newFeetYaw, 360.0);
if (v136 > 180.0)
{
v136 = v136 - 360.0;
}
if (v136 < 180.0)
{
v136 = v136 + 360.0;
}
player_animation_state->m_flGoalFeetYaw = v136;
}
float DesyncFix = 0;
float Resim = 0;
for (size_t i = 0; i < player->NumOverlays(); i++)
{
auto layer = player->get_anim_overlay_index(i);
if (!layer)
continue;
if (player->get_sequence_act(layer->m_nSequence) == 979)
{
if (layer->m_flCycle != layer->m_flPrevCycle) {
float Brute = player->GetLowerBodyYaw();
float Delta = NormalizeYaw180(NormalizeYaw180(Brute - NormalizeYaw180(NormalizeYaw180(player_animation_state->m_flGoalFeetYaw + RemapVal(PosParams[11], 0, 1, -60, 60))) + Resim));
if (Delta > 58.f)
Delta = randomintcalc;
if (Delta < -58.f)
Delta = -randomintcalc;
Resim += Delta;
DesyncFix += Delta;
}
}
}
float Equalized = NormalizeYaw180(NormalizeYaw180(player_animation_state->m_flGoalFeetYaw + RemapVal(PosParams[11], 0, 1, -58, 58)) + Resim);
float JitterDelta = fabs(NormalizeYaw180(oldEyeAngles[player->EntIndex()].y - player->GetEyeAngles().y));
if (JitterDelta >= 70.f && !shot)
jittering[player->EntIndex()] = true;
if (player != Globals::LocalPlayer && player->GetTeam() != Globals::LocalPlayer->GetTeam() && (player->GetFlags() & FL_ONGROUND) && c_config::get().aimbot_resolver)
{
if (jittering[player->EntIndex()])
player_animation_state->m_flGoalFeetYaw = NormalizeYaw180(player->GetEyeAngles().y + DesyncFix);
else
player_animation_state->m_flGoalFeetYaw = Equalized;
player->SetLowerBodyYaw(player_animation_state->m_flGoalFeetYaw);
}
StoredAnimState[player->EntIndex()] = player_animation_state;
oldEyeAngles[player->EntIndex()] = player->GetEyeAngles();
oldSimtime[player->EntIndex()] = storedSimtime[player->EntIndex()];
storedSimtime[player->EntIndex()] = player->GetSimulationTime();
update = true;
return;
auto local_player = Globals::LocalPlayer;
if (!local_player)
return;
if (!player)
return;
if (player->GetTeam() == Globals::LocalPlayer->GetTeam())
return;
bool is_local_player = player == local_player;
bool is_teammate = local_player->GetTeam() == player->GetTeam() && !is_local_player;
if (is_local_player)
return;
if (is_teammate)
return;
if (player->GetHealth() <= 0)
return;
if (local_player->GetHealth() <= 0)
return;
auto idx = player->EntIndex();
auto state = player->GetBasePlayerAnimState();
auto lby = player->GetLowerBodyYaw();
static float oldSimtimeShot[65];
static float storedSimtimeShot[65];
static float OldStoredLby[65];
static float StoredLby[65];
static float ShotTime[65];
bool shot = false;
bool ShotCounterWithFalseAndTrue;
bool CounterSHot;
static bool jittering[65];
static float oldSimtime[65];
static float storedSimtime[65];
static float SideTime[65][3];
static int LastDesyncSide[65];
static bool Delaying[1];
static AnimationLayer StoredLayers[64][30];//15
static C_AnimState * StoredAnimState[65];
static float StoredPosParams[65][48];//24
static Vector oldEyeAngles[65];
static float oldGoalfeetYaw[65];
float* PosParams = (float*)((uintptr_t)player + 0x2774);
bool update = false;
auto player_animation_state = player->AnimState();
auto RemapVal = [](float val, float A, float B, float C, float D) -> float
{
if (A == B)
return val >= B ? D : C;
return C + (D - C) * (val - A) / (B - A);
};
resolver_record _player[64];
auto& record = _player[idx];
if (state)
{
state->m_flEyeYaw = player->GetEyeAnglesXY()->y;
state->m_flEyePitch = player->GetEyeAnglesXY()->x;
player->setAnimationState(state);
}
if (state && state->speed_2d > 0.1f || fabs(state->flUpVelocity) > 100.0f)
{
state->m_flGoalFeetYaw = approach_angle(state->m_flEyeYaw, state->m_flGoalFeetYaw,
((state->m_flUnknownFraction * 20.0f) + 30.0f) * state->m_flLastClientSideAnimationUpdateTime);
player->setAnimationState(state);
}
else
{
if (state)
{
state->m_flGoalFeetYaw = approach_angle(lby, state->m_flGoalFeetYaw,
state->m_flLastClientSideAnimationUpdateTime * 100.0f);
player->setAnimationState(state);
}
}
record.current_tick.eyes = player->GetEyeAnglesXY()->y;
if (record.current_tick.last_lby == FLT_MAX)
{
record.current_tick.last_lby = lby;
}
bool one = false;
bool two = false;
record.current_tick.lby_delta = record.current_tick.last_lby - lby;
record.current_tick.eye_lby_delta = lby - record.current_tick.eyes;
if (record.current_tick.last_lby != FLT_MAX)
{
if (record.current_tick.last_lby == 979) // the current layer must be triggering 979
{
if (record.current_tick.lby_delta == 979) // the previous layer must be trigerring 979
{
// we can tell now that he is surely breaking lby in some sort
if (record.current_tick.last_lby != record.current_tick.lby_delta)
{
float
flAnimTime = record.current_tick.lby_delta,
flSimTime = player->GetSimulationTime();
record.current_tick.last_lby = player->GetLowerBodyYaw() - 180.f; // for the resolver it's enough here to just flip him, because we will backtrack him
}
else if (player->GetVelocity().Length2D() > 0.1f) // breaking lby with delta < 120; can fakewalk here aswell
{
if (record.current_tick.last_lby != lby)
record.current_tick.last_lby = lby;
one = false, two = false;
}
}
}
else
{
record.current_tick.lby_delta = record.current_tick.last_lby - lby;
if (record.current_tick.last_lby != lby)
{
if (solve_desync_simple(player))
{
if (delta_58(record.current_tick.last_lby, lby))
{
record.current_tick.low_delta = true;
record.current_tick.high_delta = false;
}
else
{
record.current_tick.low_delta = false;
record.current_tick.high_delta = true;
}
if (delta_58(lby, record.current_tick.eyes) && delta_58(record.current_tick.last_lby, record.current_tick.eyes))
{
if (!one || !two)
record.current_tick.jitter_desync = false;
if (one && two)
record.current_tick.jitter_desync = true;
}
if (record.current_tick.low_delta && !delta_58(record.current_tick.last_lby, record.current_tick.eyes))
{
if (!one)
one = true;
if (!two && one)
two = true;
if (one && two)
record.current_tick.jitter_desync = true;
}
// else
// record.current_tick.low_delta = true;
}
else
record.current_tick.static_desync = true;
}
else
{
if (!solve_desync_simple(player))
{
one = false, two = false;
record.current_tick.static_desync = true;
record.current_tick.jitter_desync = false;
}
else
{
if (!delta_58(record.current_tick.last_lby, record.current_tick.eyes))
{
record.current_tick.low_delta = false;
record.current_tick.high_delta = true;
record.current_tick.jitter_desync = true;
}
else
{
record.current_tick.low_delta = true;
record.current_tick.high_delta = false;
record.current_tick.jitter_desync = true;
}
}
}
}
}
auto slow_walking = [&player]() -> bool
{
bool s = g_Resolver.enemy_is_slow_walking(player);
if (s)
{
if (!(player->GetFlags() & FL_DUCKING))
{
g_Resolver.enemy_slowwalk = true;
return true;
}
else
{
g_Resolver.enemy_slowwalk = false;
return false;
}
}
else
return false;
};
if (slow_walking() && Globals::MissedShots[player->EntIndex()] >= 1)
{
Globals::enemyslow[player->EntIndex()] = true;
}
auto max_rotate = max_desync_angle(player);
auto delta = angle_difference(player->GetEyeAnglesXY()->y, player->AnimState()->m_flCurrentFeetYaw);
if (record.current_tick.low_delta && !record.current_tick.jitter_desync && record.current_tick.lby_delta < 58.f)
{
player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
Globals::rmode[player->EntIndex()] = 4;
}
else if (record.current_tick.jitter_desync && (!record.current_tick.high_delta || record.current_tick.low_delta))
{
// record.current_tick.eye_lby_delta
player->GetEyeAnglesXY()->y = lby + (-record.current_tick.eye_lby_delta);
Globals::rmode[player->EntIndex()] = 5;
}
else if (record.current_tick.jitter_desync && record.current_tick.high_delta)
{
player->GetEyeAnglesXY()->y = record.current_tick.last_lby;
Globals::rmode[player->EntIndex()] = 6;
}
else if (record.current_tick.low_delta && record.current_tick.jitter_desync)
{
player->GetEyeAnglesXY()->y = lby - record.current_tick.lby_delta;
Globals::rmode[player->EntIndex()] = 7;
}
else
{
const auto player_animation_state = player->AnimState();
if (!player_animation_state)
return;
float m_flLastClientSideAnimationUpdateTimeDelta = fabs(player_animation_state->m_iLastClientSideAnimationUpdateFramecount - player_animation_state->m_flLastClientSideAnimationUpdateTime);
auto v48 = 0.f;
if (player_animation_state->m_flFeetSpeedForwardsOrSideWays >= 0.0f)
{
v48 = fminf(player_animation_state->m_flFeetSpeedForwardsOrSideWays, 1.0f);
}
else
{
v48 = 0.0f;
}
float v49 = ((player_animation_state->m_flStopToFullRunningFraction * -0.30000001) - 0.19999999) * v48;
float flYawModifier = v49 + 1.0;
if (player_animation_state->m_fDuckAmount > 0.0)
{
float v53 = 0.0f;
if (player_animation_state->m_flFeetSpeedUnknownForwardOrSideways >= 0.0)
{
v53 = fminf(player_animation_state->m_flFeetSpeedUnknownForwardOrSideways, 1.0);
}
else
{
v53 = 0.0f;
}
}
float flMaxYawModifier = player_animation_state->pad10[516] * flYawModifier;
float flMinYawModifier = player_animation_state->pad10[512] * flYawModifier;
float newFeetYaw = 0.f;
auto eyeYaw = player_animation_state->m_flEyeYaw;
auto lbyYaw = player_animation_state->m_flGoalFeetYaw;
float eye_feet_delta = fabs(eyeYaw - lbyYaw);
if (eye_feet_delta <= flMaxYawModifier)
{
if (flMinYawModifier > eye_feet_delta)
{
newFeetYaw = fabs(flMinYawModifier) + eyeYaw;
}
}
else
{
newFeetYaw = eyeYaw - fabs(flMaxYawModifier);
}
float v136 = fmod(newFeetYaw, 360.0);
if (v136 > 180.0)
{
v136 = v136 - 360.0;
}
if (v136 < 180.0)
{
v136 = v136 + 360.0;
}
player_animation_state->m_flGoalFeetYaw = v136;
}
float DesyncFix = 0;
float Resim = 0;
for (size_t i = 0; i < player->NumOverlays(); i++)
{
auto layer = player->get_anim_overlay_index(i);
if (!layer)
continue;
if (player->get_sequence_act(layer->m_nSequence) == 979)
{
if (layer->m_flCycle != layer->m_flPrevCycle) {
float Brute = player->GetLowerBodyYaw();
float Delta = NormalizeYaw180(NormalizeYaw180(Brute - NormalizeYaw180(NormalizeYaw180(player_animation_state->m_flGoalFeetYaw + RemapVal(PosParams[11], 0, 1, -60, 60))) + Resim));
if (Delta > 58.f)
Delta = randomintcalc;
if (Delta < -58.f)
Delta = -randomintcalc;
Resim += Delta;
DesyncFix += Delta;
}
}
}
float Equalized = NormalizeYaw180(NormalizeYaw180(player_animation_state->m_flGoalFeetYaw + RemapVal(PosParams[11], 0, 1, -58, 58)) + Resim);
float JitterDelta = fabs(NormalizeYaw180(oldEyeAngles[player->EntIndex()].y - player->GetEyeAngles().y));
if (JitterDelta >= 70.f && !shot)
jittering[player->EntIndex()] = true;
if (player != Globals::LocalPlayer && player->GetTeam() != Globals::LocalPlayer->GetTeam() && (player->GetFlags() & FL_ONGROUND) && c_config::get().aimbot_resolver)
{
if (jittering[player->EntIndex()])
player_animation_state->m_flGoalFeetYaw = NormalizeYaw180(player->GetEyeAngles().y + DesyncFix);
else
player_animation_state->m_flGoalFeetYaw = Equalized;
player->SetLowerBodyYaw(player_animation_state->m_flGoalFeetYaw);
}
StoredAnimState[player->EntIndex()] = player_animation_state;
oldEyeAngles[player->EntIndex()] = player->GetEyeAngles();
oldSimtime[player->EntIndex()] = storedSimtime[player->EntIndex()];
storedSimtime[player->EntIndex()] = player->GetSimulationTime();
update = true;