Anti-hide

Esp Warnings (c&p friendly)

Nov 11th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.41 KB | None | 0 0
  1. void CDrawnings::DrawWarnings()
  2. {
  3.     if (Settings.Visuals.bEspWarnings)
  4.     {
  5.         if (Globals.g_pEngine->IsInGame() && Globals.g_pEngine->IsConnected())
  6.         {
  7.             std::stringstream text1 = std::stringstream("");
  8.             std::stringstream text2 = std::stringstream("");
  9.  
  10.             CBasePlayer* pLocal = Globals.g_pEntList->GetClientEntity(Globals.g_pEngine->GetLocalPlayer());
  11.             if (!pLocal)
  12.                 return;
  13.             for (int i = 1; i <= Globals.g_pEngine->GetMaxClients(); i++)
  14.             {
  15.                 CBasePlayer* pPlayer = Globals.g_pEntList->GetClientEntity(i);
  16.                 if (pPlayer)
  17.                 {
  18.                     if (!pPlayer->IsValid())
  19.                         continue;
  20.                     if (pPlayer->GetTeam() == pLocal->GetTeam() && !Settings.Visuals.bTeam)
  21.                         continue;
  22.  
  23.                     player_info_t info;
  24.                     if (!Globals.g_pEngine->GetPlayerInfo(i, &info))
  25.                         continue;
  26.  
  27.  
  28.                     Vector3D src, dst, forward;
  29.                     trace_t tr;
  30.                     Ray_t ray;
  31.                     CTraceFilter filter;
  32.  
  33.                     Math.AngleVectors(pPlayer->GetEyeAngles(), forward);
  34.                     filter.pSkip = pPlayer;
  35.                     src = pPlayer->GetBestEyePos(true);
  36.                     dst = src + (forward * 8192);
  37.  
  38.                     ray.Init(src, dst);
  39.  
  40.                     Globals.g_pEngineTrace->TraceRay(ray, MASK_SHOT, &filter, &tr);
  41.  
  42.                     bool AimingToLocal = (tr.m_pEnt && tr.hitgroup > 0 && tr.hitgroup <= 7);
  43.                     bool CanSeeLocal = Math.IsVisible(pPlayer->GetBestEyePos(true) , pLocal->GetBestEyePos(true) , pPlayer , pLocal);
  44.                     if(AimingToLocal)
  45.                         text2 << info.name << " ";
  46.                     /*else */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.             Drawings.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. }
Add Comment
Please, Sign In to add comment