Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос How to draw client bullet impacts?

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
12 Июн 2025
Сообщения
39
Реакции
1
How to draw client impacts(blue ones) in cs 2. I am drawing server impacts like this
Код:
Expand Collapse Copy
if (cfg::misc_visuals->draw_server_impacts)
{
    Interfaces::Client->GetDebugOverlay()->RenderWithoutDots(true);
    Interfaces::Client->GetDebugOverlay()->AddBoxOverlay(
        ImpactPosition,
        Vector(-1.f, -1.f, -1.f),
        Vector(1.f, 1.f, 1.f),
        QAngle(0.0f, 0.0f, 0.0f),
        cfg::misc_visuals->color_server_impacts,
        cfg::misc_visuals->hiteffect_duration
    );
}
 
How to draw client impacts(blue ones) in cs 2. I am drawing server impacts like this
Код:
Expand Collapse Copy
if (cfg::misc_visuals->draw_server_impacts)
{
    Interfaces::Client->GetDebugOverlay()->RenderWithoutDots(true);
    Interfaces::Client->GetDebugOverlay()->AddBoxOverlay(
        ImpactPosition,
        Vector(-1.f, -1.f, -1.f),
        Vector(1.f, 1.f, 1.f),
        QAngle(0.0f, 0.0f, 0.0f),
        cfg::misc_visuals->color_server_impacts,
        cfg::misc_visuals->hiteffect_duration
    );
}
ok..
maybe we can do it properly but idc about that method rn
so u need to get bullet_services from the local player
also u need to get bullet_data etc
e.g
C++:
Expand Collapse Copy
// call it in frame_render
void c_visuals::process_bullets( )
{
    if ( !g_local_player->valid( ) )
        return;
    
    const auto bullet_services = g_local_player->pawn( )->bullet_services( );
    if ( !bullet_services )
        return;
    
    for ( auto i = bullet_services->data( ).size( ); i > m_last_count_bullet; --i )
    {
        auto latest_processed_bullet = bullet_services->at( i - 1 );
        
        valve::g_debug_overlay->add_box(
            latest_processed_bullet.m_pos, { -2, -2, -2 }, { 2, 2, 2 }, {}, { 255, 0, 0, 127 }
        );
    }
    
    if ( bullet_services->data( ).size( ) != m_last_count_bullet )
        m_last_count_bullet = bullet_services->data( ).size( );
}
 
Назад
Сверху Снизу