get good get legendware
-
Автор темы
- #1
code:-
usage :-
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);