Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CDrawnings::DrawWarnings()
- {
- if (Settings.Visuals.bEspWarnings)
- {
- if (Globals.g_pEngine->IsInGame() && Globals.g_pEngine->IsConnected())
- {
- std::stringstream text1 = std::stringstream("");
- std::stringstream text2 = std::stringstream("");
- CBasePlayer* pLocal = Globals.g_pEntList->GetClientEntity(Globals.g_pEngine->GetLocalPlayer());
- if (!pLocal)
- return;
- for (int i = 1; i <= Globals.g_pEngine->GetMaxClients(); i++)
- {
- CBasePlayer* pPlayer = Globals.g_pEntList->GetClientEntity(i);
- if (pPlayer)
- {
- if (!pPlayer->IsValid())
- continue;
- if (pPlayer->GetTeam() == pLocal->GetTeam() && !Settings.Visuals.bTeam)
- continue;
- player_info_t info;
- if (!Globals.g_pEngine->GetPlayerInfo(i, &info))
- continue;
- Vector3D src, dst, forward;
- trace_t tr;
- Ray_t ray;
- CTraceFilter filter;
- Math.AngleVectors(pPlayer->GetEyeAngles(), forward);
- filter.pSkip = pPlayer;
- src = pPlayer->GetBestEyePos(true);
- dst = src + (forward * 8192);
- ray.Init(src, dst);
- Globals.g_pEngineTrace->TraceRay(ray, MASK_SHOT, &filter, &tr);
- bool AimingToLocal = (tr.m_pEnt && tr.hitgroup > 0 && tr.hitgroup <= 7);
- bool CanSeeLocal = Math.IsVisible(pPlayer->GetBestEyePos(true) , pLocal->GetBestEyePos(true) , pPlayer , pLocal);
- if(AimingToLocal)
- text2 << info.name << " ";
- /*else */if(CanSeeLocal)
- text1 << info.name << " ";
- }
- }
- text2 << "Aiming to You";
- text1 << "Can see You";
- int screensizeX , screensizeY;
- Globals.g_pEngine->GetScreenSize(screensizeX , screensizeY);
- Drawings.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());
- }
- }
- }
Add Comment
Please, Sign In to add comment