pimpinjuice
11-19-2009, 03:07 PM
for(int x=1;x<65;x++)
{
C_BaseEntity *pent=(C_BaseEntity*)m_pEntList->GetClientEntity(x);
if(pent && pent!=us && !pent->IsDormant() && pent->IsPlayer() && res->IsConnected(x) && res->IsAlive(x))
{
C_BasePlayer *pplayer=ToBasePlayer(pent);
Color clr=res->GetTeamColor(res->GetTeam(x));
int hp=res->GetHealth(x);
int armor=GetArmor(pplayer);
Vector to_2d;
GetBonePosition(pent->GetIClientEntity(),14,to_2d);
to_2d.z+=20.0f;
int valX, valY;
if(CalcScreen(to_2d,valX,valY))
{
if(m_iESPHealth)
{
m_pGUI->drawRect(valX-25,valY-4,51,9,clr.r(),clr.g(),clr.b(),255,255,255);
m_pGUI->drawRect(valX-25 + 1,valY-4 + 1,(int)(hp/2)-1,3,255,0,0,255,0,0);
m_pGUI->drawRect(valX-25 + 1,valY-4 + 5,(int)(armor/2)-1,3,0,0,255,0,0,255);
}
}
}
}
Credits: sp0rky (CalcScreen)
Obviously you have to get a armor value that works (GetArmor for me just does pent+armor offset) and make sure you have a drawRect() type of deal. Mine has these params:
drawRect(start_x,start_y,width,height,border_r,border_g,border_b,r,g,b );
Looks pretty cool
http://i.imagehost.org/0721/hp_esp.png
Oh, you might wanna do if(hp>100) hp=100
Or something along these lines to combat hp that goes over 100.
If you use this, a thank you would be nice :]
Enjoy
{
C_BaseEntity *pent=(C_BaseEntity*)m_pEntList->GetClientEntity(x);
if(pent && pent!=us && !pent->IsDormant() && pent->IsPlayer() && res->IsConnected(x) && res->IsAlive(x))
{
C_BasePlayer *pplayer=ToBasePlayer(pent);
Color clr=res->GetTeamColor(res->GetTeam(x));
int hp=res->GetHealth(x);
int armor=GetArmor(pplayer);
Vector to_2d;
GetBonePosition(pent->GetIClientEntity(),14,to_2d);
to_2d.z+=20.0f;
int valX, valY;
if(CalcScreen(to_2d,valX,valY))
{
if(m_iESPHealth)
{
m_pGUI->drawRect(valX-25,valY-4,51,9,clr.r(),clr.g(),clr.b(),255,255,255);
m_pGUI->drawRect(valX-25 + 1,valY-4 + 1,(int)(hp/2)-1,3,255,0,0,255,0,0);
m_pGUI->drawRect(valX-25 + 1,valY-4 + 5,(int)(armor/2)-1,3,0,0,255,0,0,255);
}
}
}
}
Credits: sp0rky (CalcScreen)
Obviously you have to get a armor value that works (GetArmor for me just does pent+armor offset) and make sure you have a drawRect() type of deal. Mine has these params:
drawRect(start_x,start_y,width,height,border_r,border_g,border_b,r,g,b );
Looks pretty cool
http://i.imagehost.org/0721/hp_esp.png
Oh, you might wanna do if(hp>100) hp=100
Or something along these lines to combat hp that goes over 100.
If you use this, a thank you would be nice :]
Enjoy