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,¤tguy);
}
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;
};
[Updated on: Sat, 07 May 2011 07:02]
Report message to a moderator