Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float flBlow = ent->m_flC4Blow();
- flBlow -= g_GlobalVars->interval_per_tick * g_LocalPlayer->m_nTickBase();
- int screenx, screeny;
- g_VGuiSurface->GetScreenSize(screenx, screeny);
- screenx = screenx / 2;
- screeny = screeny - 100;
- if (flBlow <= 0.0)
- flBlow = 0.0;
- if (flBlow < 40.f)
- {
- float ptc = flBlow / 40.f;
- g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
- g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx + 150, screeny + 4);
- g_VGuiSurface->DrawSetColor(194, 244, 66, 110);
- g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx - 150 + (300 * ptc), screeny + 4);
- if (flBlow > 5.f)
- {
- g_VGuiSurface->DrawSetColor(27, 120, 214, 110);
- g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx - 150 + (300 * 0.125), screeny + 4);
- }
- else
- {
- g_VGuiSurface->DrawSetColor(27, 120, 214, 110);
- g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx - 150 + (300 * ptc), screeny + 4);
- }
- g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
- g_VGuiSurface->DrawOutlinedRect(screenx - 150, screeny - 4, screenx + 150, screeny + 4);
- std::stringstream stream;
- stream << std::fixed << std::setprecision(1) << flBlow;
- std::string s = stream.str();
- std::wstring ws = std::wstring(s.begin(), s.end());
- const wchar_t* buf = ws.c_str();
- int w = 300;
- int tw, th;
- g_VGuiSurface->GetTextSize(esp_font, buf, tw, th);
- g_VGuiSurface->DrawSetTextFont(esp_font);
- g_VGuiSurface->DrawSetTextColor(Color(255, 255, 255, 110));
- g_VGuiSurface->DrawSetTextPos(screenx - tw / 2, screeny - th / 2 - 15);
- g_VGuiSurface->DrawPrintText(buf, wcslen(buf));
- if (ent->m_hBombDefuser() > 0)
- {
- float flCountdown = ent->m_flDefuseCountDown() - (g_LocalPlayer->m_nTickBase() * g_GlobalVars->interval_per_tick);
- float ptc2 = flCountdown / 10;
- std::stringstream sstream;
- sstream << std::fixed << std::setprecision(1) << flCountdown;
- std::string ss = sstream.str();
- std::wstring wss = std::wstring(ss.begin(), ss.end());
- const wchar_t* buf2 = wss.c_str();
- g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
- g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4 + 30, screenx + 150, screeny + 4 + 30);
- g_VGuiSurface->DrawSetColor(84, 169, 255, 110);
- g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4 + 30, screenx - 150 + (300 * ptc2), screeny + 4 + 30);
- g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
- g_VGuiSurface->DrawOutlinedRect(screenx - 150, screeny - 4 + 30, screenx + 150, screeny + 4 + 30);
- g_VGuiSurface->GetTextSize(esp_font, buf2, tw, th);
- g_VGuiSurface->DrawSetTextFont(esp_font);
- g_VGuiSurface->DrawSetTextColor(Color(84, 169, 255, 110));
- g_VGuiSurface->DrawSetTextPos(screenx - tw / 2, screeny - th / 2 - 15 + 30);
- g_VGuiSurface->DrawPrintText(buf2, wcslen(buf2));
- if (flCountdown > flBlow)
- {
- g_VGuiSurface->GetTextSize(esp_font, L"can't be defused", tw, th);
- g_VGuiSurface->DrawSetTextFont(esp_font);
- g_VGuiSurface->DrawSetTextColor(Color(255, 48, 79, 110));
- g_VGuiSurface->DrawSetTextPos(screenx - tw / 2, screeny - th / 2 - 15 + 60);
- g_VGuiSurface->DrawPrintText(L"can't be defused", wcslen(L"can't be defused"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement