C++ Simple Anti-Brute LW

get good get legendware
Участник
Статус
Оффлайн
Регистрация
22 Сен 2020
Сообщения
437
Реакции[?]
201
Поинты[?]
48K
code:-
C++:
void antiaim::anti_brute(bool flip)
{
    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 pWeapon = e->m_hActiveWeapon().Get();
        if (!pWeapon)
            continue;
        if (pWeapon->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 == nullptr)
            return;
       
        // method 1 variables
        auto simtime = target->m_flSimulationTime();
        auto oldsimtime = target->m_flOldSimulationTime();
        float m_flLastShotTime;
        bool m_shot;
        m_flLastShotTime = pWeapon ? pWeapon->m_fLastShotTime() : 0.f;
        m_shot = m_flLastShotTime > oldsimtime && m_flLastShotTime <= simtime;
        bool match = false;


        // method 2 variables
        float shoot_time = -1.f;

        if (pWeapon)
            shoot_time = weapon->m_fLastShotTime() + m_globals()->m_intervalpertick;

        if (TIME_TO_TICKS(shoot_time) == TIME_TO_TICKS(simtime))
            match = true;

        if (match || m_flLastShotTime <= simtime && m_shot)
            flip = !flip;
    }
}



usage :-

C++:
        //example
        
        if (g_cfg.antiaim.anti_brute)
            anti_brute(flip);
 
Thigh destr0yer
Пользователь
Статус
Оффлайн
Регистрация
25 Ноя 2019
Сообщения
272
Реакции[?]
68
Поинты[?]
0
have fun losing fps with this lol...
m_flLastShotTime <= simtime
this is all you need to check for lol
 
get good get legendware
Участник
Статус
Оффлайн
Регистрация
22 Сен 2020
Сообщения
437
Реакции[?]
201
Поинты[?]
48K
have fun losing fps with this lol...
m_flLastShotTime <= simtime
this is all you need to check for lol
oh yea checking simtime for each player in the server is definitely better than choosing a single target, lol
what if a target is shooting another entity in mid and im just chilling in long? why would i want to invert lol
u can optimize this more ofc this is not perfect but i can’t predict which entity the enemy will target unless u do some complex calculations to see if the bullet shot by the enemy is near you or targeted at you,
hint:- u can do this with local->absorigin near target bullet tracer by a specific value
 
Последнее редактирование:
Thigh destr0yer
Пользователь
Статус
Оффлайн
Регистрация
25 Ноя 2019
Сообщения
272
Реакции[?]
68
Поинты[?]
0
oh yea checking simtime for each player in the server is definitely better than choosing a single target, lol
what if a target is shooting another entity in mid and im just chilling in long? why would i want to invert lol
u can optimize this more ofc this is not perfect but i can’t predict which entity the enemy will target unless u do some complex calculations to see if the bullet shot by the enemy is near you or targeted at you,
hint:- u can do this with local->absorigin near target bullet tracer by a specific value
????????????
where did you get a single target from????
 
Похожие темы
Сверху Снизу