Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Question...
Re: Question... [message #466329 is a reply to message #465856] Wed, 18 April 2012 08:18 Go to previous messageGo to previous message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma:
Recruit
what am i doing wrong? cause my script wont work Sad



					Vector3 Size = Vector3(35.0f,35.0f,500.0f); //Size of the script zone.
					Matrix3 Rotation(true);
					Rotation.Rotate_Z(Commands->Get_Facing(o)); //Set the rotation of the script zone to the same as the beacon.
					Vector3 Pos = Commands->Get_Position(o);
					Pos.Z -= 100;//lowering postion of box to make sure to cover whole base
					OBBoxClass Box(Pos,Size,Rotation); //Create the bounding box with the position of the beacon, and the size and rotation defined earlier.
					GameObject* Zone = Create_Zone("Script_Zone_All",Box);
					Attach_Script_Once(Zone,"",Team);


void KB_Base_Zone::Entered(GameObject *obj, GameObject *enterer)
{
	int Team = Get_Int_Parameter("Team");
	if (Is_Soldier(enterer))
	{		
		StringClass Msg;
		if(Team == Commands->Get_Player_Type(enterer))
		{
			Commands->Set_Is_Visible(obj,false);
			Attach_Script_Once(enterer,"KB_Friendly_Zone_Generated","");
			Msg.Format("CMSGP %d 0,255,0 You've moved in range of your base, enemy defences will ignore you from here!",Get_Player_ID(obj));
			Console_Input(Msg);
		}
		else
		{
			Attach_Script_Once(enterer,"KB_Enemy_Zone_Generated","");
			Msg.Format("CMSGP %d 255,0,0 You've moved in range of enemy base you can't build active defenses here!",Get_Player_ID(obj));
			Console_Input(Msg);
		}
	}
	if (Is_Vehicle(enterer) && Team == Commands->Get_Player_Type(enterer))
	{
		Set_Vehicle_Is_Visible(obj,false);
	}
}

void KB_Base_Zone::Exited(GameObject *obj, GameObject *exiter)
{
	StringClass Msg;
	if (Is_Soldier(exiter) && Is_Script_Attached(exiter,"KB_Friendly_Zone_Generated"))
	{
		if(Is_Script_Attached(exiter,"KB_GAP_Generated")||Is_Script_Attached(exiter,"KB_Char_Spy"))
		{
			Msg.Format("CMSGP %d 255,0,0 You've moved out of your base",Get_Player_ID(exiter));
			Remove_Script(exiter,"KB_Friendly_Zone_Generated");
			Console_Input(Msg);
		}		
		else
		{
			Commands->Set_Is_Visible(exiter,true);
			Msg.Format("CMSGP %d 255,0,0 You've moved out of your base, enemy defences will automatically attack you from here!",Get_Player_ID(exiter));
			Console_Input(Msg);			
			Remove_Script(exiter,"KB_Friendly_Zone_Generated");
		}		
	}
	if (Is_Vehicle(exiter))
	{
		if(Is_Script_Attached(exiter,"KB_GAP_Generated")||Is_Script_Attached(exiter,"KB_GAP_Generator")){}
		else{Set_Vehicle_Is_Visible(exiter,true);}
	}

	if (Is_Soldier(obj) && Is_Script_Attached(exiter,"KB_Enemy_Zone_Generated") )
	{	
		Msg.Format("CMSGP %d 255,0,0 You've moved out of the enemy base",Get_Player_ID(exiter));
		Console_Input(Msg);
		Remove_Script(exiter,"KB_Enemy_Zone_Generated");
	}
}
ScriptRegistrant<KB_Base_Zone> KB_Base_Zone_Reg("KB_Base_Zone","Team:int");


its supposed to make ppl invisible in their own base

and unable to build stuff in the enemies

but it does nothing at all not even the message does this mean i made a mistake with the zone somewhere?


Owner of kambot TT server

kambot.freeforums.org
 
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: scripts when changing character
Next Topic: C&C Hourglass Amsterdam's Red Light District Progress
Goto Forum:
  


Current Time: Fri Dec 20 23:31:48 MST 2024

Total time taken to generate the page: 0.00937 seconds