-
Автор темы
- #1
это в world_esp.cpp
SS :
C++:
void worldesp::bomb_timer(entity_t* entity)
{
if (!g_cfg.esp.bomb_timer)
return;
if (!g_ctx.globals.bomb_timer_enable)
return;
static auto mp_c4timer = m_cvar()->FindVar(crypt_str("mp_c4timer"));
auto bomb = (CCSBomb*)entity;
auto c4timer = mp_c4timer->GetFloat();
auto bomb_timer = bomb->m_flC4Blow() - m_globals()->m_curtime;
if (bomb_timer < 0.0f)
return;
static int width, height;
m_engine()->GetScreenSize(width, height);
auto factor = bomb_timer / c4timer * 25;
auto factor2 = bomb_timer / c4timer * 52;
auto red_factor = (int)(255.0f - bomb_timer / c4timer * 255.0f);
auto green_factor = (int)(bomb_timer / c4timer * 255.0f);
render::get().rect_filled(width / 2 - 100, height / 6 - factor2 + 16, 2, factor2, Color(red_factor, green_factor, 0, 100));
render::get().rect_filled(width / 2 + 98, height / 6 - factor2 + 16, 2, factor2, Color(red_factor, green_factor, 0, 100));
render::get().rect_filled(width / 2 - 100, height / 6 + 15, 2, factor2, Color(red_factor, green_factor, 0, 100));
render::get().rect_filled(width / 2 + 98, height / 6 + 15, 2, factor2, Color(red_factor, green_factor, 0, 100));
render::get().rect_filled(width / 2 - 100, height / 6 - 35, 200, 100, Color(20, 20, 20, 100));
render::get().text(fonts[WEAPONS], width / 2 + 55, height / 6 + 13, Color(red_factor, green_factor, 0), HFONT_CENTERED_X | HFONT_CENTERED_Y, "o");
render::get().circle_filled(width / 2 + 55, height / 6 + 13, 50, factor / 2 + 15, Color(red_factor, green_factor, 0, 100));
auto text_position = height - factor + 11;
if (text_position > height - 9)
text_position = height - 9;
render::get().text(fonts[BOMB], width / 2 - 35, height / 6 + 30, Color::White, HFONT_CENTERED_X | HFONT_CENTERED_Y, "%0.1f", bomb_timer);
Vector screen;
if (math::world_to_screen(entity->GetAbsOrigin(), screen))
render::get().text(fonts[BOMB], width / 2 - 35, height / 6, Color(red_factor, green_factor, 0), HFONT_CENTERED_X | HFONT_CENTERED_Y, "BOMB");
}
SS :