-
Автор темы
- #1
other_esp.cpp:
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;
static float hue = 0.0f;
static constexpr float rainbowSpeed = 0.50f; // Increase this value for a faster rainbow
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;
else
alpha -= 9.0f * m_globals()->m_frametime;
alpha = math::clamp(alpha, 0.0f, 1.0f);
// Calculate rainbow color based on hue value
Color rainbowColor = Color::FromHSB(hue, 1.0f, 1.0f);
render::get().Draw3DFilledCircle(position, 25.0f, rainbowColor);
// Update hue value for next frame
hue += rainbowSpeed * m_globals()->m_frametime;
// Wrap hue value within [0, 1] range
if (hue > 1.0f)
hue -= 1.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);
}
}
}
}
Пожалуйста, авторизуйтесь для просмотра ссылки.