Гайд Autopeek for lw

[HvH ✡ Player] aka B1gPaster
Участник
Статус
Оффлайн
Регистрация
28 Дек 2017
Сообщения
943
Реакции[?]
265
Поинты[?]
0
Мне нехуй делать нормальных тем нету и нет идей так что сделал юзелес хуйня за пару секунд но как по мне будет прикольно если сделать выбор какой эффект хочешь к примеру без анимки или просто круг но здесь я сделал это (мб есть у кого то идее что можно прикольное реализовать напишите снизу или мне в лс):


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 = 0.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 += 3.0f * m_globals()->m_frametime;
        else
            alpha -= 3.0f * m_globals()->m_frametime;

        alpha = math::clamp(alpha, 0.0f, 1.0f);
        
        render::get().Draw3DRainbowCircle(position, 25.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);

                render::get().rect_filled(screen.x - 10.0f, screen.y - offset - 59.0f, 20.0f, 45.0f, Color(240, 30, 30, (int)(alpha * 168.0f)));
                render::get().triangle(Vector2D(screen.x, screen.y - offset), Vector2D(screen.x - 10.5f, screen.y - offset - 14.5f), Vector2D(screen.x + 9.5f, screen.y - offset - 14.5f), Color(240, 30, 30, (int)(alpha * 168.0f)));
            }
        }
    }
}

Если кому то надо Draw3DRainbowCircle

void render::Draw3DRainbowCircle(const Vector& origin, float radius)
{
    static auto hue_offset = 0.0f;
    static auto prevScreenPos = ZERO; //-V656
    static auto step = M_PI * 2.0f / 72.0f;

    auto screenPos = ZERO;

    for (auto rotation = 0.0f; rotation <= M_PI * 2.0f; rotation += step) //-V1034
    {
        Vector pos(radius * cos(rotation) + origin.x, radius * sin(rotation) + origin.y, origin.z);
        Ray_t ray;
        trace_t trace;
        CTraceFilterWorldOnly filter;
        ray.Init(origin, pos);
        m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace);
        if (math::world_to_screen(trace.endpos, screenPos))
        {
            if (!prevScreenPos.IsZero())
            {
                auto hue = RAD2DEG(rotation) + hue_offset;

                float r, g, b;
                ColorConvertHSVtoRGB(hue / 360.0f, 1.0f, 1.0f, r, g, b);
                render::get().circle_filled(prevScreenPos.x, prevScreenPos.y, 10, g_cfg.esp.taser_size, Color(r, g, b));
            }

            prevScreenPos = screenPos;
        }
    }
    hue_offset += m_globals()->m_frametime * 200.0f;
}
 
Начинающий
Статус
Оффлайн
Регистрация
16 Ноя 2019
Сообщения
42
Реакции[?]
4
Поинты[?]
0
dlight лучше будет. Особенно если это именно пик асист который тебя трекает к точке.(сам не понял чё спизданул но что то хотел донести)
 
ЧВК EB_LAN
Забаненный
Статус
Оффлайн
Регистрация
12 Янв 2019
Сообщения
838
Реакции[?]
298
Поинты[?]
17K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Для просмотра содержимого вам необходимо авторизоваться.
Мне нехуй делать нормальных тем нету и нет идей так что сделал юзелес хуйня за пару секунд но как по мне будет прикольно если сделать выбор какой эффект хочешь к примеру без анимки или просто круг но здесь я сделал это (мб есть у кого то идее что можно прикольное реализовать напишите снизу или мне в лс):


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 = 0.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 += 3.0f * m_globals()->m_frametime;
        else
            alpha -= 3.0f * m_globals()->m_frametime;

        alpha = math::clamp(alpha, 0.0f, 1.0f);
     
        render::get().Draw3DRainbowCircle(position, 25.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);

                render::get().rect_filled(screen.x - 10.0f, screen.y - offset - 59.0f, 20.0f, 45.0f, Color(240, 30, 30, (int)(alpha * 168.0f)));
                render::get().triangle(Vector2D(screen.x, screen.y - offset), Vector2D(screen.x - 10.5f, screen.y - offset - 14.5f), Vector2D(screen.x + 9.5f, screen.y - offset - 14.5f), Color(240, 30, 30, (int)(alpha * 168.0f)));
            }
        }
    }
}

Если кому то надо Draw3DRainbowCircle

void render::Draw3DRainbowCircle(const Vector& origin, float radius)
{
    static auto hue_offset = 0.0f;
    static auto prevScreenPos = ZERO; //-V656
    static auto step = M_PI * 2.0f / 72.0f;

    auto screenPos = ZERO;

    for (auto rotation = 0.0f; rotation <= M_PI * 2.0f; rotation += step) //-V1034
    {
        Vector pos(radius * cos(rotation) + origin.x, radius * sin(rotation) + origin.y, origin.z);
        Ray_t ray;
        trace_t trace;
        CTraceFilterWorldOnly filter;
        ray.Init(origin, pos);
        m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace);
        if (math::world_to_screen(trace.endpos, screenPos))
        {
            if (!prevScreenPos.IsZero())
            {
                auto hue = RAD2DEG(rotation) + hue_offset;

                float r, g, b;
                ColorConvertHSVtoRGB(hue / 360.0f, 1.0f, 1.0f, r, g, b);
                render::get().circle_filled(prevScreenPos.x, prevScreenPos.y, 10, g_cfg.esp.taser_size, Color(r, g, b));
            }

            prevScreenPos = screenPos;
        }
    }
    hue_offset += m_globals()->m_frametime * 200.0f;
}
 
Содер
Участник
Статус
Оффлайн
Регистрация
23 Мар 2021
Сообщения
571
Реакции[?]
227
Поинты[?]
17K
Попробуй реализовать с материалом sprites/physbeam.vmt
dlight лучше будет. Особенно если это именно пик асист который тебя трекает к точке.(сам не понял чё спизданул но что то хотел донести)
quick peek?
 
Содер
Участник
Статус
Оффлайн
Регистрация
23 Мар 2021
Сообщения
571
Реакции[?]
227
Поинты[?]
17K
Сверху Снизу