void Box3D(int HeadX,int HeadY,int bottomX,int bottomY,float Distance_Player,DWORD Color)
{
float drawW = 245/Distance_Player;
float drawW2 = 135/Distance_Player;
float drawW3 = 55/Distance_Player;
DrawLine(bottomX-drawW,bottomY,bottomX+drawW,bottomY,1,Color);
DrawLine(HeadX-drawW,HeadY,HeadX+drawW,HeadY,1,Color);
DrawLine(HeadX-drawW,HeadY,bottomX-drawW,bottomY,1,Color);
DrawLine(HeadX+drawW,HeadY,bottomX+drawW,bottomY,1,Color);
DrawLine(HeadX-drawW2,HeadY-drawW3,bottomX-drawW2,bottomY-drawW3,1,Color);
DrawLine(bottomX-drawW,bottomY,bottomX-drawW2,bottomY-drawW3,1,Color);
DrawLine(HeadX-drawW,HeadY,HeadX-drawW2,HeadY-drawW3,1,Color);
DrawLine((HeadX+drawW)+drawW2,HeadY-drawW3,(bottomX+drawW)+drawW2,bottomY-drawW3,1,Color);
DrawLine(bottomX+drawW,bottomY,(bottomX+drawW)+drawW2,bottomY-drawW3,1,Color);
DrawLine(HeadX+drawW,HeadY,(HeadX+drawW)+drawW2,HeadY-drawW3,1,Color);
DrawLine(HeadX-drawW2,HeadY-drawW3,(HeadX+drawW)+drawW2,HeadY-drawW3,1,Color);
DrawLine(bottomX-drawW2,bottomY-drawW3,(bottomX+drawW)+drawW2,bottomY-drawW3,1,Color);
}
float Distance = GetDistance(pPlayer->Object->origin, pPlayer->Object->Pos); if(Fun.ESPBox3D) Box3D((int)HeadScreen.x, (int)HeadScreen.y, (int)FootScreen.x, (int)FootScreen.y, Distance, ColorESP);




void InstallESP(LPDIRECT3DDEVICE9 pDevice)
{
D3DVIEWPORT9 ViewPort;
pDevice->GetViewport(&ViewPort);
GetPlayerByIndex = (lpGetPlayerByIndex)PlayerByIndex;
unsigned long ulThis = *(unsigned long *)ClientInfoMgr;
GetLocalPlayer = (lpGetLocalPlayer)LocalPlayer;
CHAR CName[50], CDistance[50];
for(INT i = 0; i < 24; i++)
{
pPlayerInfo *pLocal = GetLocalPlayer(ulThis);
pPlayerInfo *pPlayer = GetPlayerByIndex(ulThis, i, 0);
if( ValidPointer( pPlayer ) && ValidPointer( pPlayer->Object ) )
{
D3DXVECTOR3 HeadPos, FootPos, HeadScreen, FootScreen;
if( !pPlayer->IsDead )
{
HeadPos.x = pPlayer->Object->Pos.x;
HeadPos.y = pPlayer->Object->yBound2;
HeadPos.z = pPlayer->Object->Pos.z;
if( W2S( HeadPos, &HeadScreen, pDevice ) )
{
FootPos.x = pPlayer->Object->Pos.x;
FootPos.y = pPlayer->Object->yBound1;
FootPos.z = pPlayer->Object->Pos.z;
if( W2S( FootPos, &FootScreen, pDevice ) )
{
Distance = GetDistance(pPlayer->Object->origin, pPlayer->Object->Pos);
if(Fun.ESPBox3D)
ESP->Box3D((int)HeadScreen.x, (int)HeadScreen.y, (int)FootScreen.x, (int)FootScreen.y, Distance, ColorESP);
if(Fun.ESPBox)
ESP->Box2D( HeadScreen, FootScreen, ColorESP, pDevice );
if( Fun.ESPLine)
ESP->DrawLine((float)(ViewPort.Width/2)-1, 1, (int)HeadScreen.x, (int)HeadScreen.y, 1, ColorESP);
if(Fun.ESPNames)
{
sprintf(CName, "%s", pPlayer->Name);
Draw.PrintText(bFont, HeadScreen.x, HeadScreen.y - 20.0, ColorESP, CName);
}
if(Fun.ESPDistance)
{
sprintf(CDistance, "%0.2f M", GetDistance(pPlayer->Object->origin, pPlayer->Object->Pos));
Draw.PrintText(bFont, HeadScreen.x + 15.0, HeadScreen.y, ColorESP, CDistance);
}
if(pPlayer->Team != pLocal->Team)
{
ColorESP = Friend;
}else{
ColorESP = Enemy;
}
}
}
}
}
}
}