Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Low Health
Re: Low Health [message #315827 is a reply to message #315780] Wed, 06 February 2008 13:11 Go to previous messageGo to previous message
Genesis2001
Messages: 1397
Registered: August 2006
Karma:
General (1 Star)
**Note: I wrote this during school just now and it hasn't been tested.
***(also) Note: I'm not clear on a couple of the functions in the Commands->(function) class. Someone who has access to scripts.h can correct me if I'm wrong.
Tell Me

Header File:
class zbl_Health_Level : public ScriptImpClass {
	void Created(GameObject *obj);
	void Timer_Expired(GameObject *obj, int number);
	int ID;
};


Source File:
void zbl_Health_Level::Created(GameObject *obj) {
	ID = Get_Player_ID(obj);
	Commands->Start_Timer(obj, this, 1.0f, 123);
}
void zbl_Health_Level::Timer_Expired(GameObject *obj, int number) {
	if (number == 123) {
		if (Commands->Get_Health(obj) <= 25) {
			Commands->Create_2D_WAV_Sound("correction_3.wav"); // Change this to whatever sound j00 want.
			char Msg1[150];
			sprintf(Msg1, "ppage %d Warning: Health Level Critical", ID);
			Console_Input(Msg1);
		}
		else if (Commands->Get_Sheild_Strength(obj) <= 50) {
			Commands->Create_2D_WAV_Sound("correction_3.wav"); // again, change this...
			char Msg1[150];
			sprintf(Msg1, "ppage %d Warning: Shield strength critical", ID);
		}
		Commands->Start_Timer(obj, this, 1.0f, 123);
	}
}



****(another) Note: I'll include this in Serverside Co-Op also. Smile
~Zack
 
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
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
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
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
Read Message
Read Message
Previous Topic: GDI Guard Tower(s)?
Next Topic: RenX - protected models?
Goto Forum:
  


Current Time: Fri Dec 20 15:40:30 MST 2024

Total time taken to generate the page: 0.01366 seconds