for (int i = 1; i < 32; i++) {
Entity* currentEntity = hack->entityList->ents[i].ent;
if (!hack->CheckValidEntity(currentEntity))
continue;
D3DCOLOR color;
if (currentEntity->iTeamNum == hack->localEntity->iTeamNum)
color = D3DCOLOR_ARGB(100, 0, 255, 0);
else
color = D3DCOLOR_ARGB(100, 255, 0, 0);
Vector3 entHead3D = hack->GetBonePos(currentEntity, 8);
entHead3D.z += 8;
Vector2 entPos2D, entHead2D;
if (hack->W2S(currentEntity->vecOrigin, entPos2D)) {
DrawLine(entPos2D.x, entPos2D.y, windowWidth / 2, windowHeight, 2, color);
if (hack->W2S(entHead3D, entHead2D)) {
DrawBox(entPos2D, entHead2D, 2, color);
int height = ABS(entPos2D.y - entHead2D.y);
int dX = (entPos2D.x - entHead2D.x);
float healthPerc = currentEntity->iHealth / 100.f;
float armorPerc = currentEntity->armorValue / 100.f;
Vector2 botHealth, topHealth, botArmor, topArmor;
int healthHeight = height * healthPerc;
int armorHeight = height * armorPerc;
botHealth.y = botArmor.y = entPos2D.y;
botHealth.x = entPos2D.x - (height / 4) - 2;
botArmor.x = entPos2D.x + (height / 4) + 2;
topHealth.y = entHead2D.y + height - healthHeight;
topArmor.y = entHead2D.y + height - armorHeight;
topHealth.x = entPos2D.x - (height / 4) - 2 - (dX * healthPerc);
topArmor.x = entPos2D.x + (height / 4) + 2 - (dX * armorPerc);
DrawLine(botHealth, topHealth, 2, D3DCOLOR_ARGB(255, 46, 139, 87));
DrawLine(botArmor, topArmor, 2, D3DCOLOR_ARGB(255, 30, 144, 255));
}
}
}