Code:
bool GetTagPos(Entity_T *pEnt,char *szTag,float flOut[3])
{
WORD wTag=GetTagByName(szTag);
if(!wTag)
return false;
DWORD dwCall=0x00571790;
__asm
{
MOV ESI,pEnt;
MOVZX EDI,wTag;
PUSH flOut;
CALL dwCall;
ADD ESP,0x4
}
return true;
}
How about this:
void ESP()
{
float Screen[2];
float Origin[3];
char* cor = "^1";
w2s_t * calc = GetCalc();
for(int i = 0; i < ENTITIESMAX; i++)
{
if (Entities[i]->Type != ET_PLAYER)
continue;
if ((i < PLAYERMAX) && Entities[i]->Valid && (Entities[i]->IsAlive & 1) && !(Cg->ClientNumber == Entities[i]->ClientNumber))
{
cor = "^1";
for(int j = 0;j < 20;j++)
{
GetTagPos(Entities[i], Bones[j], BonePos[j]);
if (w2s(0, calc, BonePos[j], Screen))
{
if(j==0 && CanBeKilled(Entities[i]->Origin)){
cor = "^3";
}
if (((Clients[i]->Team == 1) || (Clients[i]->Team == 2)) && (Clients[i]->Team == MyTeam))
{
if(j == 0)
{
DrawText(true,Screen[0], Screen[1]-10,pFont, WHITE, "^7[^2%s^7]", Clients[i]->Name);
DrawText(true,Screen[0], Screen[1]-20,pFont, RED, "^7[^2%.2f^7]", PegarDistancia(RefDef->Origin, Entities[i]->Origin));
}
}
else
{
if(j == 0)
{
DrawText(true,Screen[0], Screen[1]-10,pFont, WHITE, "^7[%s%s^7]",cor, Clients[i]->Name);
DrawText(true,Screen[0], Screen[1]-20,pFont, RED, "^7[^2%.2f^7]", PegarDistancia(RefDef->Origin, Entities[i]->Origin));
Make3DBox(BonePos[j], GetBoxWidth(Entities[i]), -GetBoxHeight(Entities[i]), RED);
}
}
}
}
}
}
}