-
Автор темы
- #1
C++:
void otheresp::automatic_peek_indicator()
{
auto weapon = g_ctx.local()->m_hActiveWeapon().Get();
if (!weapon)
return;
static auto position = ZERO;
if (!g_ctx.globals.start_position.IsZero())
position = g_ctx.globals.start_position;
if (position.IsZero())
return;
static auto alpha = 4.0f;
if (!weapon->is_non_aim() && key_binds::get().get_key_bind_state(18) || alpha)
{
if (!weapon->is_non_aim() && key_binds::get().get_key_bind_state(18))
alpha += 9.0f * m_globals()->m_frametime; //-V807
else
alpha -= 9.0f * m_globals()->m_frametime;
alpha = math::clamp(alpha, 0.0f, 1.0f);
render::get().Draw3DFilledCircle(position, 25.0f, g_cfg.esp.molotov_timer ? Color(183, 206, 232, (int)(alpha * 55.0f)) : Color(183, 206, 232, (int)(alpha * 55.0f)));
Vector screen;
if (math::world_to_screen(position, screen))
{
static auto offset = 30.0f;
if (!g_ctx.globals.fired_shot)
{
static auto switch_offset = false;
if (offset <= 30.0f || offset >= 55.0f)
switch_offset = !switch_offset;
offset += switch_offset ? 22.0f * m_globals()->m_frametime : -22.0f * m_globals()->m_frametime;
offset = math::clamp(offset, 30.0f, 55.0f);
}
}
}
}