Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripting Help
Re: Scripting Help [message #420744 is a reply to message #418187] Wed, 24 February 2010 00:22 Go to previous messageGo to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma:
General (3 Stars)
Im trying block players from refilling even when they buy a new character. They can buy new characters without the script effecting the players heath if they don't get damaged.

When the Player goes outside of the zone and get's damaged I want the script to somehow return a Boolean value or number to the refill zone. The refill zone will get the players health when they enter the zone and when they exit the zone it will see that they where damaged. It will then set the player health back to what it was when they entered the zone.


Code

void B_Refill_Zone::Entered(GameObject *obj,GameObject *enter)
{
	int x;
	x = Get_Int_Parameter("Player_Type");
	if (CheckPlayerType(enter,x))
	{
		return;
	}
	if (Commands->Is_A_Star(enter))
	{
		//Commands->Start_Timer(obj,this,5,Commands->Get_ID(enter));
		return
	}
	Console_Output("enter.\n");
	health = Commands->Get_Health(enter);
	shield = Commands->Get_Shield_Strength(enter);
	Console_Output("[Refill] Health %d Shiled %d.\n",health, shield );

}

void B_Refill_Zone::Exited(GameObject *obj,GameObject *exit)
{
	int x;
	x = Get_Int_Parameter("Player_Type");
	int player = Get_Player_ID(exit);
	if (CheckPlayerType(exit,x))
	{
		return;
	}
	if (!Commands->Is_A_Star(exit))
	{
		return;
	}

	else if (Commands->Get_Health(exit) > health || Commands->Get_Shield_Strength(exit) > shield ) 
	{
		if ( Damage > 0 )
		{
			Commands->Set_Health(exit,health);
			Commands->Set_Shield_Strength(exit,shield);

			char message[1000];
			sprintf(message,"ppage %d Do Not Refill",Get_Player_ID(exit));
			Console_Input(message);
			Console_Output("[Refill] %s tried to refill.\n",Get_Player_Name_By_ID(player));
			Console_Output("[Refill] is Damaged  %d.\n",Get_Player_Name_By_ID(player), Damage);
		}
		else
		{
			Console_Output("[Refill] %s Not Damaged %d.\n",Get_Player_Name_By_ID(player),Damage);
		}
	}

	else
	{
		Console_Output("[Refill] %s did not try to refill.\n",Get_Player_Name_By_ID(player));
	}
}



Example of what i want the script to do.

index.php?t=getfile&id=12470&private=0


http://s18.postimage.org/jc6qbn4k9/bricks3.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
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: how to add startup spawners and spawners etc!!! help!
Next Topic: Cables of the transport.
Goto Forum:
  


Current Time: Sat Nov 30 07:58:40 MST 2024

Total time taken to generate the page: 0.00988 seconds