Code:
void Esp(LPDIRECT3DDEVICE9 pDevice)
{
if(!pClassManager.GetBase( ))
return;
CPlayerBase* pBase = pClassManager.GetPlayerBase( );
if(!pBase)
return;
CPlayer *pMyInfo = pClassManager.GetPlayerByIndex( pClassManager.GetMyIndex() );
for(int i = 0; i < 16; i++)
{
if(i == pClassManager.GetMyIndex())
continue;
bool ally = pClassManager.SameTeam(i);
if(opt.esp.oespn && ally)
continue;
CPlayer *pInfo = pClassManager.GetPlayerByIndex(i);
if(pInfo)
{
if(pInfo->health - 625 < 1)
continue;
D3DXVECTOR3 PositionMe( pMyInfo->lx, pMyInfo->ly, pMyInfo->lz);
D3DXVECTOR3 Screen( 0, 0, 0 );
D3DXVECTOR3 Position( pInfo->x2, pInfo->y2, pInfo->z2);
GetScreenCoordFromWorld(pDevice, Position, &Screen);
D3DXVECTOR3 PositionBot( pInfo->x, pInfo->y, pInfo->z);
D3DXVECTOR3 ScreenBot( 0, 0, 0 );
GetScreenCoordFromWorld2(pDevice, PositionBot, &ScreenBot);//just calls D3DXVec3Project without the other shit
float fDistance = Distance(&PositionBot, &PositionMe);
if( Screen.z > 1.0f && ScreenBot.z > 1.0f )
continue;
int boxsize = (int)(ScreenBot.y - Screen.y);
int boxwidth = boxsize/3;
int topleftx = (int)Screen.x - (boxwidth/2);
int toplefty = (int)Screen.y;
CPlayer *pTarget = pClassManager.GetPlayerByIndex(Close);
if()
{
if(aimbot.active && Close == i)
{
DrawBorder( topleftx, toplefty, boxwidth, boxsize, 2, pDevice, 0xFF, 0xFF, 0xFF);
}
else
{
if(ally)
DrawBorder( topleftx, toplefty, boxwidth, boxsize, 2, pDevice, 0x00, 0x00, 0xCD);
else
DrawBorder( topleftx, toplefty, boxwidth, boxsize, 2, pDevice, 0xB2, 0x22, 0x22 );
}
}
if()
{
char Info_Health[30];
sprintf(Info_Health, "[HP: %d]", pInfo->health - 625);
int Health = pInfo->health - 625;
int hboxwidth = 100/3;
int hboxstartx = ScreenBot.x - (hboxwidth/2);
int hboxstarty = ScreenBot.y + 4;
int percentOfWidth
//Menu.font->DrawText(Screen.x, Screen.y - 3, 0xFFFFFFFF, Info_Health, DT_CENTER );
}
if(esp.espi)
{
Menu.font->DrawText(Screen.x, Screen.y - 10, 0xFFFFFFFF, pInfo->_Name, DT_CENTER );
}
else if()
{
char Info_D[255];
sprintf(Info_D, "[%dF]", (int)fDistance / 10);;
Menu.font->DrawText(Screen.x, Screen.y - 24, 0xFFFFFFFF, Info_D, DT_CENTER );
}
else if()
{
char Info_D[255];
sprintf(Info_D, "%s [%dF]", pInfo->_Name, (int)fDistance / 10);
Menu.font->DrawText(Screen.x, Screen.y - 24, 0xFFFFFFFF, Info_D, DT_CENTER );
}
}
}
}