Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Low Health
Re: Low Health [message #325049 is a reply to message #315858] Thu, 03 April 2008 10:50 Go to previous messageGo to previous message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma:
General (1 Star)
Zack wrote on Wed, 06 February 2008 15:52

Angry

One mistake and spammed to death with complaints Sad

I was writing it notepad because I don't have my development environment at school :/

*hopefully fixed* :v If not, someone else can make it while I take the blame for bad scripting. :/

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


Source File:
void zbl_Health_Level::Created(GameObject *obj) {
	ID = Get_Player_ID(obj);
	SentHealth = false;
	SentArmour = false;
	Commands->Start_Timer(obj, this, 1.0f, 123);
}
void zbl_Health_Level::Timer_Expired(GameObject *obj, int number) {
	if (number == 123) {
		if (!SentHealth && !SentArmour) {
			if (Commands->Get_Health(obj) <= 25 && !SentHealth) {
				Commands->Create_2D_WAV_Sound("correction_3.wav"); // Change this
				char Msg1[150];
				sprintf(Msg1, "ppage %d Warning: Health Level Critical", ID);
				Console_Input(Msg1);
				SentHealth = true; // To avoid spamming the player! :/
			}
			else if (Commands->Get_Shield_Strength(obj) <= 50 && !SentArmour) {
				Commands->Create_2D_WAV_Sound("correction_3.wav"); // again, change this...
				char Msg1[150];
				sprintf(Msg1, "ppage %d Warning: Armour strength critical", ID);
				Console_Input(Msg1);
				SentArmour = true; // avoid spamming the player >_>
			}
			Sent = true;
			Commands->Start_Timer(obj, this, 1.0f, 123);
		}
		else { // already sent...Check to see if their health is above 25 and set it back to false
			if (Commands->Get_Health(obj) > 25) {
				SentHealth = false;
			}
			else if (Commands->Get_Shield_Strength(obj) > 50) {
				SentArmour = false;
			}
		}
	}
}


when compiling that i get
.\scripts.cpp(310) : error C2065: 'Sent' : undeclared identifier


Aircraftkiller wrote on Fri, 18 February 2011 23:50

I figured some people will still go LOLOLOL STARVING CATS LOOOOLZ UR A FAG or some dumb shit like that. Thanks for not disappointing! Smile

 
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: Wed Jul 31 03:24:32 MST 2024

Total time taken to generate the page: 0.01310 seconds