Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.74 KB | None | 0 0
  1. void CEsp::DrawWarnings()
  2. {
  3. if (Settings::Esp::esp_Warnings)
  4. {
  5. if (Interfaces::Engine()->IsInGame() && Interfaces::Engine()->IsConnected())
  6. {
  7. std::stringstream text1 = std::stringstream("");
  8. std::stringstream text2 = std::stringstream("");
  9.  
  10. CBaseEntity* pLocal = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(Interfaces::Engine()->GetLocalPlayer());
  11. if (!pLocal)
  12. return;
  13. for (int i = 1; i <= Interfaces::Engine()->GetMaxClients(); i++)
  14. {
  15. CBaseEntity* pPlayer = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(i);
  16. if (pPlayer)
  17. {
  18. if (!pPlayer->IsValid())
  19. continue;
  20. if (pPlayer->GetTeam() == pLocal->GetTeam() && !Settings::Esp::esp_Team)
  21. continue;
  22.  
  23. PlayerInfo Pinfo;
  24. if (!Interfaces::Engine()->GetPlayerInfo(i, &Pinfo))
  25. continue;
  26.  
  27.  
  28. Vector src, dst, vForward;
  29. trace_t tr;
  30. Ray_t ray;
  31. CTraceFilter filter;
  32.  
  33. AngleVectors(pPlayer->GetRenderAngles(), vForward);
  34. filter.pSkip = pPlayer;
  35. src = pPlayer->GetHitboxPosition(true);
  36. dst = src + (vForward * 8192);
  37.  
  38. ray.Init(src, dst);
  39.  
  40. Interfaces::EngineTrace()->TraceRay(ray, MASK_SHOT, &filter, &tr);
  41.  
  42. bool AimingToLocal = (tr.m_pEnt && tr.hitgroup > 0 && tr.hitgroup <= 7);
  43. bool CanSeeLocal = pPlayer->IsVisible(pPlayer->GetHitboxPosition(true), pLocal->GetHitboxPosition(true), pPlayer, pLocal);
  44. if (AimingToLocal)
  45. text2 « info.name « " ";
  46. if (CanSeeLocal)
  47. text1 « info.name « " ";
  48.  
  49. }
  50. }
  51. text2 « "Aiming to You";
  52. text1 « "Can see You";
  53. int screensizeX, screensizeY;
  54. Globals.g_pEngine->GetScreenSize(screensizeX, screensizeY);
  55. g_pRender->DrawText(screensizeX / 2, 100, Color::Red(), B1gFont, true, text2.str().c_str());
  56. Drawings.DrawText(screensizeX / 2, 140, Color::Green(), B1gFont, true, text1.str().c_str());
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement