Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. void eexomiindicatorKeybinds() {
  2.  
  3. if (!g_Menu.Config.TopInfoBar)
  4. return;
  5.  
  6. static int spec_x;
  7. static int spec_y;
  8.  
  9. int pos_x = spec_x;
  10. int pos_y = spec_y;
  11. static int _drag_x = 300;
  12. static int _drag_y = 300;
  13.  
  14. static bool _dragging = false;
  15. bool _click = false;
  16.  
  17. if (GetAsyncKeyState(VK_LBUTTON))
  18. _click = true;
  19.  
  20. Vector2D _mouse_pos = g_pSurface->GetMousePosition();
  21.  
  22. if (_dragging && !_click)
  23. _dragging = false;
  24.  
  25. if (_dragging && _click)
  26. {
  27. pos_x = _mouse_pos.x - _drag_x;
  28. pos_y = _mouse_pos.y - _drag_y;
  29. spec_x = pos_x;
  30. spec_y = pos_y;
  31. }
  32.  
  33. int spec_width = 150;
  34.  
  35.  
  36. int spec_height = 160;
  37.  
  38. if ((g_pSurface->MouseInRegion(pos_x + 50, pos_y + 50, 100, 60))) {
  39. _dragging = true;
  40. _drag_x = _mouse_pos.x - pos_x;
  41. _drag_y = _mouse_pos.y - pos_y;
  42. }
  43.  
  44. int wa, ha;
  45. g_pEngine->GetScreenSize(wa, ha);
  46.  
  47. auto local_player = g::pLocalEntity;
  48. if (!local_player) return;
  49. if (!local_player->IsAlive()) return;
  50. auto weapon = local_player->GetActiveWeapon();
  51. int w = 0, h = 0;
  52. g_pEngine->GetScreenSize(w, h);
  53.  
  54. static auto draw_bar = [](int x, int y, float val, float max, const char* name, DWORD zalupa)
  55. {
  56. if (val > max)
  57. val = max;
  58.  
  59.  
  60. g_pSurface->DrawT(x + 12, y + 65, Color(255, 255, 255, 255), zalupa, true, name);
  61. g_pSurface->FilledRect(x, y, 25, 65, Color(30, 25, 29));
  62. g_pSurface->OutlinedRect(x, y, 25, 65, Color(0, 0, 0));
  63. g_pSurface->FilledRect(x, y, 25, 65 * (max / val), Color(255, 3, 20));
  64. };
  65. float desyncAmt = MaxDelta(g::pLocalEntity);
  66. static auto last_fake_origin = Vector();
  67. static auto last_origin = Vector();
  68. auto NetChannel = g_pEngine->GetNetChannel();
  69. if (!NetChannel) return;
  70. if (!NetChannel->m_nChokedPackets) {
  71. last_fake_origin = last_origin;
  72. last_origin = local_player->GetOrigin();
  73. }
  74. auto nci = g_pEngine->GetNetChannelInfo();
  75. if (!nci)
  76. return;
  77.  
  78.  
  79. g_pSurface->FilledRect(10, 450, 150, 90, Color(30, 25, 29));
  80. g_pSurface->OutlinedRect(10, 450, 150, 90, Color(255, 3, 20));
  81. draw_bar(25, 460, NetChannel->m_nChokedPackets, 1.0f, "CHOKE", g::EspTahoma);
  82. draw_bar(75, 460, desyncAmt, 1.0f, "DESYNC", g::EspTahoma);
  83. draw_bar(125, 460, NetChannel->m_nChokedPackets, 1.0f, "choke", g::EspTahoma);
  84.  
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement