Posted by pinki185. Code:
class CHelicopter
{
public:
__int32 EntityNum; //0x0000
__int32 SnapShot; //0x0004
vec3_t vOrigin; //0x0008
__int32 Team; //0x0014
};
Code:
CHelicopter* GetHeliByIndex(int iIndex)
{
return (CHelicopter*)(HELI_BASE + HELI_SIZE * iIndex );
}
Code:
void HeliEsp()
{
float screenX, screenY;
for(int i = 0; i<8; i++)
{
CHelicopter* Heli = GetHeliByIndex( i );
Ccentity_t* pEnt = c_Esp.GetEntityIndex( Heli->EntityNum );
int MyTeam =cClientInfo[cg->clientNum].iTeam;
float Distance = c_Math.GetDistance(ref->viewOrg,pEnt->Origin ) / 48.0f;
if(! pEnt->alive)
continue;
bool bIsEnemy = ( Heli->Team != MyTeam );
if(c_Math.NewWorldToScreen( pEnt->Origin , &screenX, &screenY))
{
if((pEnt->type==TYPE_HELICOPTER)&&(pEnt->alive==257))
{
if ((UINT) xMenu.Items[ENTITYESP]->Value)
{
if( bIsEnemy )
{
DrawString(screenX,screenY,Media.BoldFont,&tengRed,"Heli");
DrawString(screenX,screenY+15,Media.BoldFont,&tengRed,"%.0f%",Distance);
}
else
{
DrawString(screenX,screenY,Media.BoldFont,&tengBlue,"Heli");
DrawString(screenX,screenY+15,Media.BoldFont,&tengBlue,"%.0f%",Distance);
}
}
}
}
}
}
u have to find the Heli_base and Size look into cg_init for it hint..
credits to
cardoow for his dog Esp