Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. float flBlow = ent->m_flC4Blow();
  2. flBlow -= g_GlobalVars->interval_per_tick * g_LocalPlayer->m_nTickBase();
  3.  
  4. int screenx, screeny;
  5. g_VGuiSurface->GetScreenSize(screenx, screeny);
  6.  
  7. screenx = screenx / 2;
  8. screeny = screeny - 100;
  9.  
  10. if (flBlow <= 0.0)
  11. flBlow = 0.0;
  12.  
  13. if (flBlow < 40.f)
  14. {
  15. float ptc = flBlow / 40.f;
  16.  
  17. g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
  18. g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx + 150, screeny + 4);
  19.  
  20. g_VGuiSurface->DrawSetColor(194, 244, 66, 110);
  21. g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx - 150 + (300 * ptc), screeny + 4);
  22.  
  23. if (flBlow > 5.f)
  24. {
  25. g_VGuiSurface->DrawSetColor(27, 120, 214, 110);
  26. g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx - 150 + (300 * 0.125), screeny + 4);
  27. }
  28. else
  29. {
  30. g_VGuiSurface->DrawSetColor(27, 120, 214, 110);
  31. g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4, screenx - 150 + (300 * ptc), screeny + 4);
  32. }
  33.  
  34. g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
  35. g_VGuiSurface->DrawOutlinedRect(screenx - 150, screeny - 4, screenx + 150, screeny + 4);
  36.  
  37. std::stringstream stream;
  38. stream << std::fixed << std::setprecision(1) << flBlow;
  39.  
  40. std::string s = stream.str();
  41. std::wstring ws = std::wstring(s.begin(), s.end());
  42.  
  43. const wchar_t* buf = ws.c_str();
  44.  
  45. int w = 300;
  46. int tw, th;
  47. g_VGuiSurface->GetTextSize(esp_font, buf, tw, th);
  48. g_VGuiSurface->DrawSetTextFont(esp_font);
  49. g_VGuiSurface->DrawSetTextColor(Color(255, 255, 255, 110));
  50. g_VGuiSurface->DrawSetTextPos(screenx - tw / 2, screeny - th / 2 - 15);
  51. g_VGuiSurface->DrawPrintText(buf, wcslen(buf));
  52.  
  53. if (ent->m_hBombDefuser() > 0)
  54. {
  55. float flCountdown = ent->m_flDefuseCountDown() - (g_LocalPlayer->m_nTickBase() * g_GlobalVars->interval_per_tick);
  56.  
  57. float ptc2 = flCountdown / 10;
  58.  
  59. std::stringstream sstream;
  60. sstream << std::fixed << std::setprecision(1) << flCountdown;
  61.  
  62. std::string ss = sstream.str();
  63. std::wstring wss = std::wstring(ss.begin(), ss.end());
  64.  
  65. const wchar_t* buf2 = wss.c_str();
  66.  
  67. g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
  68. g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4 + 30, screenx + 150, screeny + 4 + 30);
  69.  
  70. g_VGuiSurface->DrawSetColor(84, 169, 255, 110);
  71. g_VGuiSurface->DrawFilledRect(screenx - 150, screeny - 4 + 30, screenx - 150 + (300 * ptc2), screeny + 4 + 30);
  72.  
  73. g_VGuiSurface->DrawSetColor(Color(0, 0, 0, 110));
  74. g_VGuiSurface->DrawOutlinedRect(screenx - 150, screeny - 4 + 30, screenx + 150, screeny + 4 + 30);
  75.  
  76. g_VGuiSurface->GetTextSize(esp_font, buf2, tw, th);
  77. g_VGuiSurface->DrawSetTextFont(esp_font);
  78. g_VGuiSurface->DrawSetTextColor(Color(84, 169, 255, 110));
  79. g_VGuiSurface->DrawSetTextPos(screenx - tw / 2, screeny - th / 2 - 15 + 30);
  80. g_VGuiSurface->DrawPrintText(buf2, wcslen(buf2));
  81.  
  82. if (flCountdown > flBlow)
  83. {
  84. g_VGuiSurface->GetTextSize(esp_font, L"can't be defused", tw, th);
  85. g_VGuiSurface->DrawSetTextFont(esp_font);
  86. g_VGuiSurface->DrawSetTextColor(Color(255, 48, 79, 110));
  87. g_VGuiSurface->DrawSetTextPos(screenx - tw / 2, screeny - th / 2 - 15 + 60);
  88. g_VGuiSurface->DrawPrintText(L"can't be defused", wcslen(L"can't be defused"));
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement