Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » C++ Help request
Re: C++ Help request [message #421003 is a reply to message #420409] Fri, 26 February 2010 17:32 Go to previous messageGo to previous message
Tunaman
Messages: 1190
Registered: January 2005
Karma:
General (1 Star)
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. ^^


http://img694.imageshack.us/img694/9055/tunamanlmao.png
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help installing LUA 5?
Next Topic: C&C Volcano
Goto Forum:
  


Current Time: Sun Dec 22 07:42:52 MST 2024

Total time taken to generate the page: 0.00771 seconds