Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » How to Turn the Ped on after a specific time
Re: How to Turn the Ped on after a specific time [message #446650 is a reply to message #446321] Sat, 07 May 2011 06:20 Go to previous messageGo to previous message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma:
General (2 Stars)

why not add a scriptzone on top of the beaconzone that will
take away a players Ion/Nuke beacon if he has one, and gives it
back when he exits the zone again...
THen they cannot place it :V

Then after 20mins you destroy the zone that does that...

something like this but im not sure how this will handle when
there are more than 1 person on the ped, probly not too well... lol

void z_Prevent_Ped_Beacons_Time::Created(GameObject *obj)
{ 
	currentguy = 0;
	ion = false;
	nuke = false;
	time = Get_Float_Parameter("Time_Seconds");
	Commands->Start_Timer(obj,this,time,1003943);
}
void z_Prevent_Ped_Beacons_Time::Entered(GameObject *obj, GameObject *enter)
{
	if (!currentguy)
	{
		currentguy = enter;
		if (Has_Weapon(enter,"CnC_Weapon_IonCannonBeacon_Player"))
		{
			ion = true;
			Remove_Weapon(enter,"CnC_Weapon_IonCannonBeacon_Player");
		}
		if (Has_Weapon(enter,"CnC_Weapon_NukeBeacon_Player"))
		{
			nuke = true;
			Remove_Weapon(enter,"CnC_Weapon_NukeBeacon_Player");
		}
	}
}
void z_Prevent_Ped_Beacons_Time::Exited(GameObject *obj, GameObject *exit)
{
	if (currentguy)
	{
		if (ion)
		{
			Commands->Give_Powerup(exit,"CnC_POW_IonCannonBeacon_Player",false);
		}
		if (nuke)
		{
			Commands->Give_Powerup(exit,"CnC_POW_Nuclear_Missle_Beacon",false);
		}
		currentguy = 0;
		ion = false;
		nuke = false;
	}
	else 
	{
		currentguy = 0;
		ion = false;
		nuke = false;
	}
}
void z_Prevent_Ped_Beacons_Time::Timer_Expired(GameObject *obj, int number)
{
	if (number == 1003943)
	{
		Destroy_Script();
	}
}

void z_Prevent_Ped_Beacons_Time::Register_Auto_Save_Variables()
{
	Auto_Save_Variable(1,5,&ion);
	Auto_Save_Variable(1,5,&nuke);
	Auto_Save_Variable(1,5,&time);
	Auto_Save_Variable(1,5,&currentguy);
}
ScriptRegistrant<z_Prevent_Ped_Beacons_Time> z_Prevent_Ped_Beacons_Time_Registrant("z_Prevent_Ped_Beacons_Time","Time_Seconds=600000:float");


class z_Prevent_Ped_Beacons_Time : public ScriptImpClass {
	void Entered(GameObject *obj, GameObject *enter);
	void Created(GameObject *obj);
	void Timer_Expired(GameObject *obj, int number);
	void Exited(GameObject *obj, GameObject *exit);
	void Register_Auto_Save_Variables();
	GameObject *currentguy;
	float time;
	bool ion;
	bool nuke;
};


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Sat, 07 May 2011 07:02]

Report message to a moderator

 
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: Need someone familiar with vehicle boning
Next Topic: Having some issues modifying the Airstrip waypoints serverside
Goto Forum:
  


Current Time: Sun Dec 29 09:44:31 MST 2024

Total time taken to generate the page: 0.00937 seconds