Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [CODE]Beaconing prevention script zone
[CODE]Beaconing prevention script zone [message #448619] Fri, 10 June 2011 12:13 Go to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
You need to compile a version of scripts.dll with this to be able to use it within LevelEdit, and of course the server needs to have this script.



In the header:

class Iran_Beaconing_Prevention_Zone : public ScriptImpClass {
	void Entered(GameObject *obj,GameObject *enter);
	void Timer_Expired(GameObject *obj,int number);
};

In the .cpp:


void Iran_Beaconing_Prevention_Zone::Entered(GameObject *obj,GameObject *enter) 
{																		 
	Commands->Start_Timer(obj,this,0.1,Commands->Get_ID(enter));
}

void Iran_Beaconing_Prevention_Zone::Timer_Expired(GameObject *obj,int number)
{
	GameObject* checkplayerobj = Commands->Find_Object(number);
	if ( IsInsideZone(obj,checkplayerobj)) 
	{	
		if (Get_Total_Bullets(checkplayerobj, "CnC_Weapon_NukeBeacon_Player"))
		{
			const char* currentweapon = Get_Current_Weapon(checkplayerobj);
			if (strcmp(currentweapon, "CnC_Weapon_NukeBeacon_Player") == 0 && Get_Current_Bullets(checkplayerobj) > 0) 
			{
				Remove_Weapon(checkplayerobj,"CnC_Weapon_NukeBeacon_Player");
				Grant_Powerup(checkplayerobj,"CnC_POW_Nuclear_Missle_Beacon");
			}
		Commands->Start_Timer(obj,this,0.1,number);	
		}
		else if (Get_Total_Bullets(checkplayerobj, "CnC_Weapon_IonCannonBeacon_Player"))
		{
			const char* currentweapon = Get_Current_Weapon(checkplayerobj);
			if(strcmp(currentweapon,"CnC_Weapon_IonCannonBeacon_Player") == 0 && Get_Current_Bullets(checkplayerobj) > 0) 
			{
				Remove_Weapon(checkplayerobj,"CnC_Weapon_IonCannonBeacon_Player");
				Grant_Powerup(checkplayerobj,"CnC_POW_IonCannonBeacon_Player");
			}
		Commands->Start_Timer(obj,this,0.5,number);	
		}		
	}
}

ScriptRegistrant<Iran_Beaconing_Prevention_Zone> Iran_Beaconing_Prevention_Zone_Registrant("Iran_Beaconing_Prevention_Zone", "");


EDIT: Forgot to credit Blacky for helping me out and testing it, lol sorry dude


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Wed, 10 August 2011 15:59]

Report message to a moderator

Re: [CODE]Beaconing prevention script [message #448637 is a reply to message #448619] Sat, 11 June 2011 01:26 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
It's easier to just block beacon purchases in the purchases hook

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: [CODE]Beaconing prevention script [message #448640 is a reply to message #448619] Sat, 11 June 2011 02:27 Go to previous messageGo to next message
renalpha is currently offline  renalpha
Messages: 1000
Registered: January 2007
Location: Holland - Zuid-Holland - ...
Karma: 0
General (1 Star)
what is the grand powerup. you take something away buy you give a pow version of the powerup. dont understand :S

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

Re: [CODE]Beaconing prevention script zone [message #448643 is a reply to message #448619] Sat, 11 June 2011 07:23 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
@Hex: It's a script zone script.

@renalpha: it has something to do with when a man loves a woman Big Grin


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Beaconing prevention script zone [message #448676 is a reply to message #448619] Sun, 12 June 2011 03:58 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Here's a video:

http://www.youtube.com/watch?v=NMmyAhLyYM0

The BHS.DLL documentation states that Remove_Weapon() only works when the client has bhs.dll, but from my testing with the WW scripts that's not the case.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Beaconing prevention script zone [message #448794 is a reply to message #448619] Tue, 14 June 2011 23:29 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
It's very specific, but does was it's supposed to do for that specific purpose. It wouldn't work for APB or the 10 second beacons, but for stock renegade on an unmodified server it seems to do what it says on the tin.

Vloktboky would be proud. Smile



Re: [CODE]Beaconing prevention script zone [message #448822 is a reply to message #448619] Wed, 15 June 2011 14:23 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Thanks, I'm not sure about the APB beacons but it'll more than likely be really easy to modify the script to work with those beacons.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: [CODE]Beaconing prevention script zone [message #451776 is a reply to message #448822] Tue, 16 August 2011 23:44 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Alternatively, you could have just moved the zones so the players could not plant in them, but clearly, it was easier to ignore my advice so, have fun with that.

Regardless if you were looking for a beacon prevent zone you should have done select weapon instead of adding and removing it, beings the server can still randomly crash if you are landed with empty hands when your beacon is removed.


[Updated on: Tue, 16 August 2011 23:46]

Report message to a moderator

Previous Topic: [Renegade Map] C&C_Enterway
Next Topic: Renegade 3D Logo
Goto Forum:
  


Current Time: Thu Nov 21 14:20:28 MST 2024

Total time taken to generate the page: 0.00832 seconds