void HealthInfoItemClass::Render()
{
if ((!Enabled) && (!Enabled2)) return;
GameObject *obj = Get_Vehicle_Return((GameObject *)(*TheStar)->obj);
float health = Commands->Get_Health(obj);
float shield = Commands->Get_Shield_Strength(obj);
unsigned int current_time = *SyncTime;
unsigned int color = HealthInfoColor;
Render2DText->Reset();
RectClass *r = (RectClass *)((char *)Render2DText+0x5B8);
r->Top = TextPosition.Y;
r->Left = TextPosition.X;
r->Bottom = TextPosition.Y;
r->Right = TextPosition.X;
char temp[64];
if(current_time > StopTime)
{
HealthVisible = !HealthVisible;
StopTime = current_time + 5000;
}
if(HealthVisible)
{
sprintf(temp,"+%03d",(unsigned int)(health + 0.5f));
}
else
{
sprintf(temp, "*_%03d", (unsigned int)(shield + 0.5f));
}
Render2DText->Draw_Text(temp, color);
Render2DText->Render();
};
You should try replacing your render code with that one. I just changed it in notepad, so hopefully it works. Make sure the variables HealthVisible(bool) and StopTime(unsigned int) are declared at the top. ^^