te paso como lo toy usando yo..
void User:
rawPartyHP()
{
char LifeDisplay[20];
VAngle Angle;
int PosX, PosY, LifeProgress;
for( int PartySlot = 0; PartySlot < 10; PartySlot++ )
{
PartyList PartyMember = *(PartyList*)((char*)&pPartyListStruct + 10 * PartySlot);
lpViewObj lpPartyObj = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartyMember.ViewportID);
lpViewObj lpObj = gObjUser.lpViewTarget;
// ----
if( !lpObj || lpObj->m_Model.ObjectType != emMonster || !lpObj->m_Model.Unknown4 )
{
return;
}
// ----
float LifeBarWidth = 65.0f;
// ----
Angle.X = lpObj->m_Model.VecPosX;
Angle.Y = lpObj->m_Model.VecPosY;
Angle.Z = lpObj->m_Model.VecPosZ + lpObj->m_Model.Unknown216.Z + 100.0;
// ----
pGetPosFromAngle(&Angle, &PosX, &PosY);
PosX -= (int)floor(LifeBarWidth / (double)2.0);
// ----
if( gObjUser.m_TargetLifePercent <= 0.0f )
{
return;
}
// ----
float BarWidth = (64.5f / 100.0f) * gObjUser.m_TargetLifePercent;
pDrawText(pTextThis(), PosX-1, PosY - 9, " ", 67, 0, (LPINT)0, 0);
pDrawText(pTextThis(), PosX+0.5*(66.95-(4.35*float(strlen( lpObj->Name)))), PosY - 9, lpObj->Name, 0, 0, (LPINT)0, 0);
pDrawGUI(0x7B3F, (float)PosX - 1.2, (float)PosY - 1.5, 66.95, 6);
pDrawGUI(0x7B40, (float)PosX, (float)PosY, BarWidth, 3);
// ----
pGLSwitch();
}
pGLSwitch();
glColor3f(1.0, 1.0, 1.0);
}
// ----------------------------------------------------------------------------------------------
void User:
rawSome()
{
char LifeDisplay[20];
VAngle Angle;
int PosX, PosY, LifeProgress;
// ----
float LifeBarWidth = 38.0f;
lpViewObj lpObj = gObjUser.lpViewTarget;
// ----
if( !lpObj || lpObj->m_Model.ObjectType != emMonster || !lpObj->m_Model.Unknown4 )
{
return;
}
// ----
Angle.X = lpObj->m_Model.VecPosX;
Angle.Y = lpObj->m_Model.VecPosY;
Angle.Z = lpObj->m_Model.VecPosZ + lpObj->m_Model.Unknown216.Z + 100.0;
// ----
pGetPosFromAngle(&Angle, &PosX, &PosY);
PosX -= (int)floor(LifeBarWidth / (double)2.0);
// ----
sprintf(LifeDisplay, "%s", lpObj->Name);
pSetTextColor(pTextThis(), 0xFF, 0xE6, 0xD2, 0xFF);
pDrawText(pTextThis(), PosX + 2, PosY - 6, LifeDisplay, 0, 0, (LPINT)1, 0);
// ----
pSetBlend(true);
glColor4f(0.0, 0.0, 0.0, 0.5);
pDrawBarForm((float)(PosX + 1), (float)(PosY + 1), LifeBarWidth + 4.0, 5.0, 0.0, 0);
pGLSwitchBlend();
// ----
glColor3f(0.2, 0.0, 0.0);
pDrawBarForm((float)PosX, (float)PosY, LifeBarWidth + 4.0, 5.0, 0.0, 0);
// ----
glColor3f(0.19607843, 0.039215688, 0.0);
pDrawBarForm((float)(PosX + 2), (float)(PosY + 2), LifeBarWidth, 1.0, 0.0, 0);
// ----
if( (int)(gObjUser.m_TargetLifePercent / 10) > 10 )
{
LifeProgress = 10;
}
else
{
LifeProgress = (int)(gObjUser.m_TargetLifePercent / 10);
}
// ----
glColor3f(0.98039216, 0.039215688, 0.0);
// ----
for( int i = 0; i < LifeProgress; i++ )
{
pDrawBarForm((float)(i * 4 + PosX + 2), (float)(PosY + 2), 3.0, 2.0, 0.0, 0);
}
// ----
pGLSwitch();
glColor3f(1.0, 1.0, 1.0);
}
// ----------------------------------------------------------------------------------------------