Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CESPPanel::Paint()
- {
- if (!m_bDraw)
- return;
- Drawing::BeginESPDraw(300,300, Color(200,100,200, 255));
- for (int i=0;i<m_pClientEntityList->GetHighestEntityIndex();i++)
- {
- C_BaseEntity* pBaseEntity = Zeus::Entity::GetBaseEntity(i);
- if (!pBaseEntity)
- continue;
- Vector vecOrigin = Zeus::Entity::GetEyePos(pBaseEntity);
- Vector vScreen;
- if(Drawing::WorldToScreen( vecOrigin, vScreen ))
- {
- int hp = Zeus::Entity::GetHealth(pBaseEntity);
- std::string ClassName = Zeus::Entity::TFGetClassName(pBaseEntity);
- int Distance = Zeus::Entity::DistanceTo(pBaseEntity); // Distance to a player
- std::string dist;
- std::stringstream distout;
- distout << Distance;
- dist = distout.str();
- std::string hitpoints;
- std::stringstream hpout;
- hpout << hp;
- hitpoints = hpout.str();
- if (Distance<5)
- Distance=5;
- if (hp*2>255)
- hp=255;
- else
- hp *= 2;
- if (hp > 1) { // otherwise it draws for every entity
- Drawing::DrawOutlinedRect(vScreen.x-(Distance / 2), vScreen.y-(Distance / 2), Distance, Distance, Color(200,200,200,hp));
- // Box size now dependant on distance
- Drawing::DrawString(vScreen.x,vScreen.y,Color(200,200,200,hp), ClassName);
- Drawing::DrawString(vScreen.x,vScreen.y+10,Color(200,200,200,hp), dist);
- Drawing::DrawString(vScreen.x,vScreen.y-10,Color(200,200,200,hp), hitpoints);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment