Add anti-aim: yaw modes (backward/opposite/jitter/spin/offset), pitch modes, visibility gate and fire-disable option

This commit is contained in:
2026-08-05 18:31:03 +02:00
parent cf5280e34f
commit 75670df148
5 changed files with 359 additions and 0 deletions
@@ -541,6 +541,18 @@ auto CMisc::OnClientOutput() -> void
}
}
if ( Settings::AntiAim::Active && Settings::AntiAim::DrawIndicator && m_bAntiAimActive )
{
auto* pFont = &GetFontManager()->m_VerdanaFont;
if ( pFont )
{
const auto DisplaySize = ImGui::GetIO().DisplaySize;
GetRenderStackSystem()->DrawString( pFont , ImVec2( DisplaySize.x - 8.f , 8.f ) , FW1_RIGHT | FW1_TOP , ImColor( 255 , 80 , 80 ) , "[Anti-Aim]" );
}
}
if ( Settings::Misc::Hitmarker )
{
if ( m_HitTime.time_since_epoch().count() > 0 )
@@ -578,6 +590,9 @@ auto CMisc::OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void
if ( Settings::Ragebot::Active )
RunRagebot( pInput , pUserCmd );
if ( Settings::AntiAim::Active )
RunAntiAim( pInput , pUserCmd );
if ( Settings::Misc::Bunnyhop )
{
auto* pLocalPawn = GetCL_Players()->GetLocalPlayerPawn();
@@ -1843,6 +1858,220 @@ auto CMisc::RunRagebot( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void
}
}
auto CMisc::GetAntiAimEnemyData( C_CSPlayerPawn* pLocalPawn , Vector3* vOutClosestPos , bool* bOutAnyVisible ) -> void
{
Vector3 vClosest{};
float flClosest = 999999.f;
bool bVisible = false;
if ( bOutAnyVisible )
*bOutAnyVisible = false;
const Vector3 vEyeOrigin = GetCL_Players()->GetLocalEyeOrigin();
const auto& CachedVec = GetEntityCache()->GetCachedEntity();
std::scoped_lock Lock( GetEntityCache()->GetLock() );
for ( const auto& CachedEntity : *CachedVec )
{
if ( CachedEntity.m_Type != CachedEntity_t::PLAYER_CONTROLLER )
continue;
auto* pEntity = CachedEntity.m_Handle.Get();
if ( !pEntity )
continue;
auto* pController = reinterpret_cast<CCSPlayerController*>( pEntity );
if ( pController == GetCL_Players()->GetLocalPlayerController() )
continue;
auto* pPawn = pController->m_hPawn().Get<C_CSPlayerPawn>();
if ( !pPawn || !pPawn->IsPlayerPawn() || pPawn == pLocalPawn || !pPawn->IsAlive() )
continue;
if ( pPawn->m_iTeamNum() == pLocalPawn->m_iTeamNum() )
continue;
const Vector3 vPos = GetCL_Bones()->GetBonePositionByName( pPawn , "head_0" );
if ( vPos.IsZero() )
continue;
const float flDist = ( vPos - vEyeOrigin ).Length();
if ( flDist < flClosest )
{
flClosest = flDist;
vClosest = vPos;
}
if ( !bVisible && GetCL_VisibleCheck()->IsBoneVisible( pPawn , vPos ) )
bVisible = true;
}
if ( vOutClosestPos )
*vOutClosestPos = vClosest;
if ( bOutAnyVisible )
*bOutAnyVisible = bVisible;
}
auto CMisc::RunAntiAim( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void
{
m_bAntiAimActive = false;
if ( !pUserCmd )
return;
auto* pLocalPawn = GetCL_Players()->GetLocalPlayerPawn();
if ( !pLocalPawn || !pLocalPawn->IsAlive() )
return;
if ( Settings::AntiAim::DisableWhileFiring )
{
if ( ( pUserCmd->button_states.buttonstate1 & IN_ATTACK ) != 0 )
return;
if ( m_bRagebotFiring )
return;
}
bool bShouldRun = false;
switch ( Settings::AntiAim::Mode )
{
case 1:
{
bShouldRun = true;
}
break;
case 2:
{
const bool bKeyDown = ( GetAsyncKeyState( Settings::AntiAim::Key ) & 0x8000 ) != 0;
if ( bKeyDown && !m_bAntiAimKeyDown )
m_bAntiAimToggledOn = !m_bAntiAimToggledOn;
m_bAntiAimKeyDown = bKeyDown;
bShouldRun = m_bAntiAimToggledOn;
}
break;
default:
{
const bool bKeyDown = ( GetAsyncKeyState( Settings::AntiAim::Key ) & 0x8000 ) != 0;
bShouldRun = bKeyDown;
}
break;
}
if ( !bShouldRun )
return;
Vector3 vClosestPos{};
bool bAnyVisible = false;
if ( Settings::AntiAim::OnlyWhenTarget || Settings::AntiAim::YawType == 1 )
GetAntiAimEnemyData( pLocalPawn , &vClosestPos , &bAnyVisible );
if ( Settings::AntiAim::OnlyWhenTarget && !bAnyVisible )
return;
const QAngle ViewAngles = *CCSGOInput_GetViewAngles( pInput , 0 );
QAngle FinalAngles = ViewAngles;
if ( Settings::AntiAim::YawEnabled )
{
constexpr float k_Pi = 3.14159265358979f;
float flYaw = ViewAngles.m_y;
switch ( Settings::AntiAim::YawType )
{
case 1: // Opposite: weg vom nächsten Gegner
{
if ( !vClosestPos.IsZero() )
{
const Vector3 vDelta = GetCL_Players()->GetLocalEyeOrigin() - vClosestPos;
flYaw = std::atan2f( vDelta.m_y , vDelta.m_x ) * ( 180.f / k_Pi );
}
else
{
flYaw = ViewAngles.m_y + Settings::AntiAim::YawOffset;
}
}
break;
case 2: // Jitter: alternierend ums Backward
{
const auto Now = std::chrono::steady_clock::now();
if ( ( Now - m_JitterLastSwitch ) >= std::chrono::milliseconds( Settings::AntiAim::JitterDelay ) )
{
m_JitterLastSwitch = Now;
m_flJitterSign = -m_flJitterSign;
}
flYaw = ViewAngles.m_y + Settings::AntiAim::YawOffset + m_flJitterSign * Settings::AntiAim::JitterRange;
}
break;
case 3: // Spin: kontinuierlich rotieren
{
m_flSpinAngle += static_cast<float>( Settings::AntiAim::SpinSpeed );
if ( m_flSpinAngle > 360.f )
m_flSpinAngle -= 360.f;
flYaw = m_flSpinAngle;
}
break;
case 4: // Offset: eigener Winkel
{
flYaw = ViewAngles.m_y + Settings::AntiAim::YawOffset;
}
break;
default: // Backward
{
flYaw = ViewAngles.m_y + Settings::AntiAim::YawOffset;
}
break;
}
FinalAngles.m_y = flYaw;
}
if ( Settings::AntiAim::PitchEnabled )
{
switch ( Settings::AntiAim::PitchType )
{
case 0: FinalAngles.m_x = -static_cast<float>( Settings::AntiAim::PitchAngle ); break;
case 1: FinalAngles.m_x = static_cast<float>( Settings::AntiAim::PitchAngle ); break;
case 2: FinalAngles.m_x = 0.f; break;
case 3: FinalAngles.m_x = static_cast<float>( Settings::AntiAim::PitchAngle ) * 0.45f; break;
}
}
Math::NormalizeAngles( FinalAngles );
Math::ClampAngles( FinalAngles );
GetCL_Bypass()->SetViewAngles( &FinalAngles , pInput , pUserCmd );
m_bAntiAimActive = true;
}
static thread_local std::mt19937 g_TriggerRng( std::random_device{}() );
static thread_local std::mt19937 g_LegitRng( std::random_device{}() );
@@ -37,6 +37,8 @@ private:
auto RunTriggerbot( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void;
auto RunLegitbot( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void;
auto RunRagebot( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void;
auto RunAntiAim( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void;
auto GetAntiAimEnemyData( C_CSPlayerPawn* pLocalPawn , Vector3* vOutClosestPos , bool* bOutAnyVisible ) -> void;
auto CalculateHitchance( CCSGOInput* pInput , C_CSPlayerPawn* pTarget , const QAngle& ViewAngles , const int Samples ) -> float;
auto CalculateSeedDirection( CCSGOInput* pInput , CUserCmd* pUserCmd , Vector3* vOutDirection ) -> bool;
auto CalculateRagebotFov( const QAngle& ViewAngles , const QAngle& AimAngles ) -> float;
@@ -98,6 +100,13 @@ private:
std::chrono::steady_clock::time_point m_LegitAcquireTime{};
Vector3 m_vLegitTargetPoint{};
float m_flLegitTargetHealth = 0.f;
bool m_bAntiAimKeyDown = false;
bool m_bAntiAimToggledOn = false;
std::atomic_bool m_bAntiAimActive = false;
std::chrono::steady_clock::time_point m_JitterLastSwitch{};
float m_flJitterSign = -1.f;
float m_flSpinAngle = 0.f;
};
auto GetMisc() -> CMisc*;
@@ -81,6 +81,7 @@ auto CAndromedaMenu::OnRenderMenu() -> void
if ( ImGui::BeginTabItem( "Ragebot" ) )
{
RenderRagebotPanel();
RenderAntiAimPanel();
ImGui::EndTabItem();
}
@@ -656,6 +657,98 @@ auto CAndromedaMenu::RenderRagebotPanel() -> void
Checkbox( "Ziel markieren" , Settings::Ragebot::DrawTarget );
}
auto CAndromedaMenu::RenderAntiAimPanel() -> void
{
ImGui::SeparatorText( "Anti-Aim" );
Checkbox( "Enabled" , Settings::AntiAim::Active );
if ( !Settings::AntiAim::Active )
return;
const char* AntiAimModeItems[] =
{
"Hold Key" , "Always" , "Toggle"
};
Combo( "Modus" , Settings::AntiAim::Mode , AntiAimModeItems , IM_ARRAYSIZE( AntiAimModeItems ) );
static const char* AntiAimKeyItems[] =
{
"Alt" , "Shift" , "Ctrl" , "Mouse 4" , "Mouse 5" , "Q" , "E" , "F" , "X" , "C" , "V" , "B" , "Space"
};
static const int AntiAimKeys[] =
{
VK_MENU , VK_SHIFT , VK_CONTROL , 0x04 , 0x05 , 0x51 , 0x45 , 0x46 , 0x58 , 0x43 , 0x56 , 0x42 , VK_SPACE
};
int iKeyIdx = 0;
for ( int i = 0; i < IM_ARRAYSIZE( AntiAimKeys ); i++ )
{
if ( AntiAimKeys[ i ] == Settings::AntiAim::Key )
{
iKeyIdx = i;
break;
}
}
if ( Combo( "Key" , iKeyIdx , AntiAimKeyItems , IM_ARRAYSIZE( AntiAimKeyItems ) ) )
Settings::AntiAim::Key = AntiAimKeys[ iKeyIdx ];
ImGui::SeparatorText( "Yaw" );
Checkbox( "Yaw aktiv" , Settings::AntiAim::YawEnabled );
if ( Settings::AntiAim::YawEnabled )
{
const char* YawTypeItems[] =
{
"Backward" , "Opposite (weg vom Gegner)" , "Jitter" , "Spin" , "Offset"
};
Combo( "Yaw-Typ" , Settings::AntiAim::YawType , YawTypeItems , IM_ARRAYSIZE( YawTypeItems ) );
if ( Settings::AntiAim::YawType != 3 )
SliderInt( "Yaw Offset (Grad)" , Settings::AntiAim::YawOffset , 0 , 360 );
if ( Settings::AntiAim::YawType == 2 )
{
SliderInt( "Jitter-Ausschlag (Grad)" , Settings::AntiAim::JitterRange , 1 , 180 );
SliderInt( "Jitter-Delay (ms)" , Settings::AntiAim::JitterDelay , 10 , 500 );
}
if ( Settings::AntiAim::YawType == 3 )
SliderInt( "Spin-Geschwindigkeit (Grad/Tick)" , Settings::AntiAim::SpinSpeed , 1 , 60 );
}
ImGui::SeparatorText( "Pitch" );
Checkbox( "Pitch aktiv" , Settings::AntiAim::PitchEnabled );
if ( Settings::AntiAim::PitchEnabled )
{
const char* PitchTypeItems[] =
{
"Up" , "Down" , "Zero" , "Fake Down"
};
Combo( "Pitch-Typ" , Settings::AntiAim::PitchType , PitchTypeItems , IM_ARRAYSIZE( PitchTypeItems ) );
SliderInt( "Pitch-Winkel (Grad)" , Settings::AntiAim::PitchAngle , 1 , 89 );
}
ImGui::SeparatorText( "Logik" );
Checkbox( "Nur wenn Gegner sichtbar" , Settings::AntiAim::OnlyWhenTarget );
Checkbox( "Nicht beim Schießen" , Settings::AntiAim::DisableWhileFiring );
ImGui::SeparatorText( "Overlay" );
Checkbox( "Indikator anzeigen" , Settings::AntiAim::DrawIndicator );
}
auto CAndromedaMenu::RenderConfigPanel() -> void
{
ImGui::SeparatorText( "Menu" );
@@ -18,6 +18,7 @@ private:
auto RenderMiscPanel() -> void;
auto RenderLegitbotPanel() -> void;
auto RenderRagebotPanel() -> void;
auto RenderAntiAimPanel() -> void;
private:
auto Checkbox( const char* szLabel , bool& bValue ) -> bool;
@@ -173,6 +173,33 @@ namespace Settings
inline auto DrawFov = false; // FOV-Kreis ums Fadenkreuz
inline auto DrawTarget = true; // Ziel markieren
}
namespace AntiAim
{
// --- Aktivierung ---
inline auto Active = false;
inline auto Mode = 0; // 0 = Hold Key, 1 = Always, 2 = Toggle
inline auto Key = VK_MENU; // Alt
// --- Yaw ---
inline auto YawEnabled = true;
inline auto YawType = 0; // 0 = Backward, 1 = Opposite, 2 = Jitter, 3 = Spin, 4 = Offset
inline auto YawOffset = 180; // Grad (Backward / Offset)
inline auto JitterRange = 90; // Grad Ausschlag
inline auto JitterDelay = 100; // ms pro Richtungswechsel
inline auto SpinSpeed = 20; // Grad pro Tick
// --- Pitch ---
inline auto PitchEnabled = false;
inline auto PitchType = 0; // 0 = Up, 1 = Down, 2 = Zero, 3 = Fake Down
inline auto PitchAngle = 89; // Grad
// --- Logik ---
inline auto OnlyWhenTarget = true; // nur aktiv wenn ein Gegner sichtbar ist
inline auto DisableWhileFiring = true; // nicht beim Schießen
// --- Overlay ---
inline auto DrawIndicator = false;
}
namespace Colors
{
namespace Visual