Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CEsp::DrawWarnings()
- {
- if (Settings::Esp::esp_Warnings)
- {
- if (Interfaces::Engine()->IsInGame() && Interfaces::Engine()->IsConnected())
- {
- std::stringstream text1 = std::stringstream("");
- std::stringstream text2 = std::stringstream("");
- CBaseEntity* pLocal = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(Interfaces::Engine()->GetLocalPlayer());
- if (!pLocal)
- return;
- for (int i = 1; i <= Interfaces::Engine()->GetMaxClients(); i++)
- {
- CBaseEntity* pPlayer = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(i);
- if (pPlayer)
- {
- if (!pPlayer->IsValid())
- continue;
- if (pPlayer->GetTeam() == pLocal->GetTeam() && !Settings::Esp::esp_Team)
- continue;
- PlayerInfo Pinfo;
- if (!Interfaces::Engine()->GetPlayerInfo(i, &Pinfo))
- continue;
- Vector src, dst, vForward;
- trace_t tr;
- Ray_t ray;
- CTraceFilter filter;
- AngleVectors(pPlayer->GetRenderAngles(), vForward);
- filter.pSkip = pPlayer;
- src = pPlayer->GetHitboxPosition(true);
- dst = src + (vForward * 8192);
- ray.Init(src, dst);
- Interfaces::EngineTrace()->TraceRay(ray, MASK_SHOT, &filter, &tr);
- bool AimingToLocal = (tr.m_pEnt && tr.hitgroup > 0 && tr.hitgroup <= 7);
- bool CanSeeLocal = pPlayer->IsVisible(pPlayer->GetHitboxPosition(true), pLocal->GetHitboxPosition(true), pPlayer, pLocal);
- if (AimingToLocal)
- text2 « info.name « " ";
- if (CanSeeLocal)
- text1 « info.name « " ";
- }
- }
- text2 « "Aiming to You";
- text1 « "Can see You";
- int screensizeX, screensizeY;
- Globals.g_pEngine->GetScreenSize(screensizeX, screensizeY);
- g_pRender->DrawText(screensizeX / 2, 100, Color::Red(), B1gFont, true, text2.str().c_str());
- Drawings.DrawText(screensizeX / 2, 140, Color::Green(), B1gFont, true, text1.str().c_str());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement