Вопрос Cheat is not shooting, when enabled

Начинающий
Статус
Оффлайн
Регистрация
15 Янв 2022
Сообщения
174
Реакции[?]
27
Поинты[?]
11K
so im trying to fix this cheat, i fixed everything except the ragebot. whenever i turn it on its just not doing anything.
heres code:
Код:
/* ragebot main part */
void C_RageBot::Instance( )
{
    /* make previous aimbot target invalid */
    m_ScanData.m_AimTarget.m_Player = NULL;

    /* reset recurse state */
    m_bIsRecursed = false;

    /* check conditions */
    if ( g_Globals->m_LocalPlayer->IsFrozen( ) || !g_SettingsManager->B[ _S( "ragebot.enable" ) ] )
    {
        memset( m_ScanData.m_BadPlayers.data( ), 0, m_ScanData.m_BadPlayers.size( ) );
        return;
    }

    /* get weapon and check it */
    C_BaseCombatWeapon* pWeapon = g_Globals->m_LocalPlayer->m_hActiveWeapon( );
    if ( !pWeapon )
    {
        memset( m_ScanData.m_BadPlayers.data( ), 0, m_ScanData.m_BadPlayers.size( ) );
        return;
    }

    /* has no ammo */
    if ( pWeapon->m_iClip1( ) <= 0 )
    {
        memset( m_ScanData.m_BadPlayers.data( ), 0, m_ScanData.m_BadPlayers.size( ) );
        return;
    }

    /* get weapon data */
    const C_CSWeaponData* pWeaponData = pWeapon->GetWeaponData( );
    if ( !pWeaponData )
    {
        memset( m_ScanData.m_BadPlayers.data( ), 0, m_ScanData.m_BadPlayers.size( ) );
        return;
    }

    /* setup default ragebot accuracy */
    float flDefaultInaccuracy = 0.0f;
    if ( g_Globals->m_LocalPlayer->m_bDucked( ) || g_Globals->m_LocalPlayer->m_fFlags( ) & FL_DUCKING )
    {
        if ( pWeapon->m_nWeaponMode( ) != 0 )
            flDefaultInaccuracy = pWeaponData->m_flInaccuracyCrouchAlt;
        else
            flDefaultInaccuracy = pWeaponData->m_flInaccuracyCrouch;
    }
    else
    {
        if ( pWeapon->m_nWeaponMode( ) != 0 )
            flDefaultInaccuracy = pWeaponData->m_flInaccuracyStandAlt;
        else
            flDefaultInaccuracy = pWeaponData->m_flInaccuracyStand;
    }
    m_CachedData.m_flDefaultAccuracy = flDefaultInaccuracy;

    /* cache accuracy seeds */
    if ( m_CachedData.m_bShouldBeCached )
    {
        /* setup hitchance seeds */
        for ( int nSeed = 0; nSeed < 256; nSeed++ )
        {
            /* set random seed */
            g_Utils->RandomSeed( nSeed + 1 );

            /* generate random */
            m_CachedData.m_Seeds.m_Theta0[ nSeed ] = g_Utils->RandomFloat( 0.0f, pi / 0.5f );
            m_CachedData.m_Seeds.m_Theta1[ nSeed ] = g_Utils->RandomFloat( 0.0f, pi / 0.5f );
            m_CachedData.m_Seeds.m_Spread[ nSeed ] = g_Utils->RandomFloat( 0.0f, 1.0f );
            m_CachedData.m_Seeds.m_flInaccuracy = g_Utils->RandomFloat( 0.0f, 1.0f );
        }

        /* setup accuracy sin/cos */
        for ( int nSeed = 0; nSeed < 8; nSeed++ )
        {
            /* calcualte direction cos/sin */
            float flDirCos, flDirSin;
            DirectX::XMScalarSinCos( &flDirCos, &flDirSin, DirectX::XM_2PI * ( ( float ) ( nSeed ) / 8.0f ) );

            /* push the pair of direction sin/cos */
            m_CachedData.m_AccuracyBoost.m_Iterations[ nSeed ] = std::make_pair( flDirCos, flDirSin );
        }

        /* do not cache data twice */
        m_CachedData.m_bShouldBeCached = false;
    }

    /* force scope function */
    auto ForceWeaponZoom = [ & ] ( )
    {
        /* we cannot zoom and attack at the same time */
        g_Globals->m_Packet.m_pCmd->m_nButtons |= IN_ATTACK2;
        g_Globals->m_Packet.m_pCmd->m_nButtons &= ~IN_USE;
        g_Globals->m_Packet.m_pCmd->m_nButtons &= ~IN_ATTACK;

        /* force repredict due to forced zoom */
        g_EnginePrediction->RePredict( );
    };

    /* handle accuracy failure */
    auto HandleAccuracyFailure = [ & ] ( )
    {
        /* check autoscope */
        if ( !m_Settings.m_bAutoScope )
            return;

        /* hitchance has been failed. we can increase accuracy in the next tick in some cases */
        if ( pWeapon->IsSniper( ) )
        {
            /* if we are already scoped, then we can't do anything. So, if we ain't scoped then we have to force it */
            if ( pWeapon->m_nWeaponMode( ) == CSWeaponMode::Primary_Mode )
            {
                /* get distance to player */
                float flDistanceToPlayer = g_Globals->m_LocalPlayer->m_vecOrigin( ).DistTo( m_ScanData.m_AimTarget.m_Record.m_vecOrigin );

                /* check distance for a weapon isn't auto-sniper */
                if ( pWeapon->m_nItemID( ) != WEAPON_SCAR20 && pWeapon->m_nItemID( ) != WEAPON_G3SG1 )
                {
                    /* distance is too long and we'll need to zoom and repredict */
                    if ( flDistanceToPlayer > 200.0f )
                        ForceWeaponZoom( );
                }
                else if ( flDistanceToPlayer > 500.0f )
                    ForceWeaponZoom( );
            }
        }
    };
    
    if ( pWeapon->m_nItemID( ) == WEAPON_REVOLVER )
        g_Revolver->OnCreateMove( );

    /* get shoot position */
    Vector vecShootPosition = g_LocalAnimations->GetShootPosition( );

    /* continue state */
    bool bContinueRageBot = true;

    /* run ragebot */
    if ( pWeapon->m_nItemID( ) == WEAPON_TASER )
    {
        // g_RageBot->TaserBot( );
    }
    else if ( pWeapon->IsKnife( ) )
    {
        // g_RageBot->KnifeBot( );
    }
    else if ( pWeapon->IsGun( ) )
    {
        /* can fire check */
        bool bCanFire = g_Globals->m_Packet.m_bCanFire;
        if ( pWeaponData->m_flCycleTimeAlt > 0.2f )
            if ( !bCanFire )
                return;

        /* find target and check it */
        g_RageBot->FindTarget( vecShootPosition );
        if ( bCanFire && m_ScanData.m_AimTarget.m_Player )
        {
            if ( pWeapon->m_nItemID( ) == WEAPON_REVOLVER && !g_Globals->m_Packet.m_bCanFireRev )
            {
                g_Globals->m_Packet.m_pCmd->m_nButtons |= IN_ATTACK;
                return;
            }

            /* store buttons */
            int nButtons = g_Globals->m_Packet.m_pCmd->m_nButtons;

            /* auto-scope if needed */
            HandleAccuracyFailure( );

            /* did we scope */
            if ( nButtons != g_Globals->m_Packet.m_pCmd->m_nButtons )
                bContinueRageBot = false;

            /* continue ragebot only if we has no failures at previous checks */
            if ( bContinueRageBot )
            {
                /* now we'll have to check hitchance */
                float flHitChance = g_RageBot->GetHitchance( );
                if ( flHitChance < ( float ) ( m_Settings.m_nHitChance ) )
                {
                    /* hitchance has been failed. we can increase accuracy in the next tick in some cases */
                    HandleAccuracyFailure( );

                    /* do not continue */
                    bContinueRageBot = false;
                }

                /* if we have good accuracy then run ragebot */
                if ( bContinueRageBot )
                {
                    /* calculate aimbot angles */
                    QAngle angAimbotAngles = Math::CalcAngle( vecShootPosition, m_ScanData.m_AimTarget.m_Point.m_vecPoint );

                    /* compensate recoil if we have it turned on */
                    const float flWeaponRecoilScale = SDK::EngineData::m_ConvarList[ CheatConvarList::WeaponRecoilScale ]->GetFloat( );
                    if ( flWeaponRecoilScale > 0.0f )
                        angAimbotAngles -= g_Globals->m_LocalPlayer->m_aimPunchAngle( ) * flWeaponRecoilScale;

                    /* calculate player tick */
                    int nTickCount = g_Utils->TimeToTicks( m_ScanData.m_AimTarget.m_Record.m_flSimulationTime + g_LagCompensation->GetLerpTime( ) );

                    /* set tick */
                    g_Globals->m_Packet.m_pCmd->m_nTickCount = nTickCount;

                    /* force attack */
                    g_Globals->m_Packet.m_pCmd->m_nButtons &= ~IN_USE;
                    g_Globals->m_Packet.m_pCmd->m_nButtons |= IN_ATTACK;

                    /* set angles */
                    g_Globals->m_Packet.m_pCmd->m_angViewAngles = angAimbotAngles;

                    /* force sendpacket */
                    if ( !g_Globals->m_Packet.m_bFakeDucking )
                        *g_Globals->m_Packet.m_bSendPacket = true;

                    /* get records */
                    auto& Records = g_LagCompensation->GetPlayerRecords( m_ScanData.m_AimTarget.m_Player );

                    /* Handle Ragebot fire */
                    RageShot_t* RageShot = &g_ShotSystem->m_RageShots.emplace_front( );
                    RageShot->m_Target = m_ScanData.m_AimTarget;
                    RageShot->m_nTickCount = g_Networking->GetServerTick( );
                    RageShot->m_nEstimate = g_Networking->GetServerTick( ) + g_Utils->TimeToTicks( g_Networking->GetLatency( ) ) + MAX_SIMULATION_TICKS;
                    RageShot->m_flWeaponDamage = static_cast < float > ( pWeaponData->m_iDamage );
                    RageShot->m_vecShootPosition = g_LocalAnimations->GetShootPosition( );
                    RageShot->m_nTrackedTicks = g_Utils->TimeToTicks( Records.back( ).m_flSimulationTime - m_ScanData.m_AimTarget.m_Record.m_flSimulationTime );
                #ifdef OVERSEE_DEV
                    auto GetHitboxNameFromId = [ & ] ( int id ) -> std::string
                    {
                        switch ( id )
                        {
                            case HITBOX_HEAD:
                            return _S( "head" );
                            case HITBOX_CHEST:
                            return _S( "chest" );
                            case HITBOX_STOMACH:
                            return _S( "stomach" );
                            case HITBOX_PELVIS:
                            return _S( "pelvis" );
                            case HITBOX_RIGHT_UPPER_ARM:
                            case HITBOX_RIGHT_FOREARM:
                            case HITBOX_RIGHT_HAND:
                            return _S( "left arm" );
                            case HITBOX_LEFT_UPPER_ARM:
                            case HITBOX_LEFT_FOREARM:
                            case HITBOX_LEFT_HAND:
                            return _S( "right arm" );
                            case HITBOX_RIGHT_THIGH:
                            case HITBOX_RIGHT_CALF:
                            return _S( "left leg" );
                            case HITBOX_LEFT_THIGH:
                            case HITBOX_LEFT_CALF:
                            return _S( "right leg" );
                            case HITBOX_RIGHT_FOOT:
                            return _S( "left foot" );
                            case HITBOX_LEFT_FOOT:
                            return _S( "right foot" );
                        }
                    };
                    
                    PlayerInfo_t Data;
                    SDK::Interfaces::EngineClient->GetPlayerInfo( m_ScanData.m_AimTarget.m_Player->EntIndex( ), &Data );

                    const Vector shootpos = g_LocalAnimations->GetShootPosition( );

                    /* build console message */
                    std::string szConsoleMessage =
                        ( std::string ) ( _S( "[ RageBot ] Fired shot at " ) )
                        +
                        Data.m_strName
                        +
                        _S( " | ACC: " ) + std::to_string( ( int ) ( flHitChance ) )
                        +
                        _S( " | Lethal: " ) + std::to_string( ( int ) ( m_ScanData.m_AimTarget.m_Point.m_flDamage >= m_ScanData.m_AimTarget.m_Player->m_iHealth( ) ) )
                        +
                        _S( " | Safe: " ) + std::to_string( ( int ) ( this->IsSafePoint( m_ScanData.m_AimTarget.m_Player, &m_ScanData.m_AimTarget.m_Record, g_LocalAnimations->GetShootPosition( ), m_ScanData.m_AimTarget.m_Point.m_vecPoint, m_ScanData.m_AimTarget.m_Point.m_HitboxData ) ) )
                        +
                        _S( " | Velocity: " ) + std::to_string( ( int ) ( m_ScanData.m_AimTarget.m_Record.m_flAnimationVelocity ) )
                        +
                        _S( " | Backtrack: " ) + std::to_string( RageShot->m_nTrackedTicks )
                        +
                        _S( " | Damage: " ) + std::to_string( m_ScanData.m_AimTarget.m_Point.m_flDamage )
                        +
                        _S( " | Hitbox: " ) + GetHitboxNameFromId( m_ScanData.m_AimTarget.m_Point.m_HitboxData.m_nHitbox )
                        +
                        _S( "\n" );

                    /* print console msg */
                    SDK::Interfaces::CVar->ConsolePrintf( szConsoleMessage.c_str( ) );
                #endif

                    /* Capture matrix for on shot chams */
                    g_ShotChams->OnRageBotFire( m_ScanData.m_AimTarget.m_Player, m_ScanData.m_AimTarget.m_Record.m_Matricies[ EBoneMatrix::Visual ].data( ), m_ScanData.m_AimTarget.m_Record.m_vecAbsOrigin );
                }
            }
            else
            {
                /* force weapon zoom */
                HandleAccuracyFailure( );
            }
        }
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
15 Янв 2022
Сообщения
174
Реакции[?]
27
Поинты[?]
11K
how, everything is correct there in my opinion
Код:
void STDCALL C_Hooks::hkCreateMove( int iSequence, float flFrametime, bool bIsActive, bool& bSendPacket )
{
    Hooks::o_CreateMove( iSequence, flFrametime, bIsActive );
    if ( !g_Globals->m_LocalPlayer || !g_Globals->m_LocalPlayer->IsAlive( ) || SDK::Interfaces::ClientState->m_nSignonState < 6 )
    {
        Hooks::o_CreateMove( iSequence, flFrametime, bIsActive );
        return;
    }

    /* it is required for several fixes */
    g_Globals->m_Packet.m_bInCreateMove = true;

    /* Reset Globals Data */
    g_Globals->m_Packet.m_bIsValidPacket = true;
    g_Globals->m_Packet.m_bSkipMatrix = false;

    /* reset DT state */
    g_Globals->m_Packet.m_bDoubleTap = false;

    /* Force packet */
    if ( g_Globals->m_Packet.m_bForcePacket )
        g_Globals->m_Packet.m_bIsValidPacket = false;
    g_Globals->m_Packet.m_bForcePacket = false;

    /* get sequence */
    g_Globals->m_Packet.m_nSequence = iSequence;

    /* update prediction */
    g_EnginePrediction->UpdatePrediction( );

    /* get cmd */
    g_Globals->m_Packet.m_pCmd = SDK::Interfaces::Input->GetUserCmd( g_Globals->m_Packet.m_nSequence );
    if ( !g_Globals->m_Packet.m_pCmd || !g_Globals->m_Packet.m_pCmd->m_nCommand )
    {
        Hooks::o_CreateMove( g_Globals->m_Packet.m_nSequence, flFrametime, bIsActive );
        return;
    }

    /* infinty duck */
    if ( g_SettingsManager->B[ _S( "misc.infinity_duck" ) ] )
        g_Globals->m_Packet.m_pCmd->m_nButtons |= IN_BULLRUSH;

    /* remove attack buttons in menu */
    static bool bWasVisible = false;
    if ( g_Menu->IsVisible( ) )
    {
        g_Globals->m_Packet.m_pCmd->m_nButtons &= ~( IN_ATTACK | IN_ATTACK2 );
        bWasVisible = true;
    }
    else if ( bWasVisible )
    {
        g_Globals->m_Packet.m_pCmd->m_nButtons &= ~( IN_ATTACK | IN_ATTACK2 );
        bWasVisible = false;
    }

    /* setup ragebot weapon && cache weapondata in autowall */
    g_AutoWall->CacheWeaponData( );
    g_RageBot->SetupConfiguration( );

    /* run alternative createmove here */
    g_Exploits->SetupExploits( );
    if ( g_Exploits->RunExploits( ) )
    {
        g_Globals->m_Packet.m_bInCreateMove = false;
        return;
    }

    /* save sendpacket pointer */
    g_Globals->m_Packet.m_bSendPacket = &bSendPacket;

    /* setup data for createmove features */
    {
        // backup players data
        g_LagCompensation->StartLagCompensation( );

        // reset fakelag
        g_FakeLag->GetData( )->m_bFakeLag = g_SettingsManager->B[ _S( "misc.fake_lag.enable" ) ];
        g_FakeLag->GetData( )->m_nChokeAmount = g_SettingsManager->I[ _S( "misc.fake_lag.amount" ) ];
        g_FakeLag->GetData( )->m_nPacketMode = EPacketMode::Defualt;
        g_FakeLag->GetData( )->m_bIsChoking = false;
        g_FakeLag->GetData( )->m_nCustomChoke = -1;
    }

    /* run movement features */
    {
        /* default movement features */
        g_Movement->BunnyHop( );
        g_Movement->FastAutoStop( );
        g_Movement->MouseCorrections( );
        g_Movement->AutoStrafe( );

        /* rage-related movement features */
        g_AntiAim->SlowWalk( );
        g_AntiAim->MicroMovement( );
        g_AntiAim->JitterMove( );
        g_AntiAim->LegMovement( );
    }

    /* run fakeduck and required packet fix for it*/
    {
        g_FakeLag->FakeDuck( );
        g_Networking->OnFakeDuck( );
        g_Exploits->OnFakeDuck( );
    }

    /* run LUA scripts */
    if ( g_Globals->m_Lua.m_bScriptLoaded )
        for ( auto pCurrent : g_LuaHookManager->GetHooksList( _S( "CreateMove_Start" ) ) )
            pCurrent.m_pFunc( g_Globals->m_Packet.m_pCmd );

    /* run main cheat features here */
    g_EnginePrediction->StartPrediction( );
    {
        /* setup shoot position */
        g_LocalAnimations->CopyPlayerAnimationData( false );
        g_LocalAnimations->SetupShootPosition( );

        /* run auto-stop */
        {
            g_AutoStop->Initialize( );
            g_AutoStop->RunEarlyAutoStop( );
            g_AutoStop->RunMovementPrediction( );
        }

        /* run fakelag */
        g_FakeLag->Instance( );

        /* run grenade prediction */
        g_GrenadePrediction->OnCreateMove( g_Globals->m_Packet.m_pCmd );

        /* Run exploits before rage */
        g_Exploits->BeforeRageBot( );

        /* Run RageBot things */
        g_RageBot->Instance( );

        /* Run exploits post rage */
        g_Exploits->PostRageBot( );

        /* run anti-aim */
        g_AntiAim->OnCreateMove( );
    };
    g_EnginePrediction->FinishPrediction( );

    /* finish createmove */
    g_AntiAim->FinishCreateMove( );

    /* run buybot */
    g_BuyBot->OnCreateMove( );

    /* run LUA scripts */
    if ( g_Globals->m_Lua.m_bScriptLoaded )
        for ( auto pCurrent : g_LuaHookManager->GetHooksList( _S( "CreateMove_End" ) ) )
            pCurrent.m_pFunc( g_Globals->m_Packet.m_pCmd );

    // finish packet ( Clamp choke, run local animfix, restore data, etc... "
    return g_Networking->FinishPacket( iSequence );
}
 
Начинающий
Статус
Оффлайн
Регистрация
15 Янв 2022
Сообщения
174
Реакции[?]
27
Поинты[?]
11K
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K

Вложения

Начинающий
Статус
Оффлайн
Регистрация
5 Июл 2022
Сообщения
180
Реакции[?]
26
Поинты[?]
20K
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
23 Июн 2022
Сообщения
42
Реакции[?]
7
Поинты[?]
2K
Начинающий
Статус
Оффлайн
Регистрация
15 Янв 2022
Сообщения
174
Реакции[?]
27
Поинты[?]
11K
Сверху Снизу