Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Weapon Drops/Keeping the Weapon
Weapon Drops/Keeping the Weapon [message #361001] Mon, 01 December 2008 20:35 Go to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
#1 basically i want it so when a player picks up a drop weapon or spawn weapon and when they buy a new character they keep those weapons.

#2 when the player dies it drops all the weapons the player currently had in a weapons pack

are the scripts for these public


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Weapon Drops/Keeping the Weapon [message #361013 is a reply to message #361001] Tue, 02 December 2008 00:18 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)
There's possibly some early version of the DA release's that include the start of this shaping up. But I don't believe there are any public scripts that do what you want in 3.4.4 or SSGM.

I need something right now to boost my self esteem after Crocadile Dundee made me a recluse for two days. I think I can help you.



Re: Weapon Drops/Keeping the Weapon [message #361018 is a reply to message #361001] Tue, 02 December 2008 01:11 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
We do this using a stack and saving the presets of all picked up weapons, its simple enough to do

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

[Updated on: Tue, 02 December 2008 01:11]

Report message to a moderator

Re: Weapon Drops/Keeping the Weapon [message #361020 is a reply to message #361001] Tue, 02 December 2008 01:48 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)
Obviously if you're prepared to release your working solution to the problem to Gen, then that's great. You're not stepping on my toes at all, shoot away man Smile.

I can't remember how the early version of DA did this, and I don't have the source anymore since my external hard drive broke down. But it's probably still hosted somewhere, I am happy to give it a go and use that as a base for re-creating it if you're reluctant to hand him your source/plug-in/whatever.



Re: Weapon Drops/Keeping the Weapon [message #361071 is a reply to message #361001] Tue, 02 December 2008 08:40 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
I also once had the scripts for this but wasn't sure sure who originally made them but I lost them long ago. That would be cool if someone would help me with this since im not a reny scripter.

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Weapon Drops/Keeping the Weapon [message #361079 is a reply to message #361001] Tue, 02 December 2008 09:46 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)
I'm happy to help, but I'm not sure if Hex was offering his or just giving you a general pointer in what direction to go...
If he is happy to share then go with that obviously. Otherwise, I'll provide the source here, if I can reproduce it that is...



Re: Weapon Drops/Keeping the Weapon [message #361164 is a reply to message #361001] Wed, 03 December 2008 01:16 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
here, this is my backpack script:

.cpp

void cAMpa_Weapon_BackPack::Created(GameObject *obj)
{
	Commands->Start_Timer(obj,this,6.0f,2);
	GameObject *player = Get_GameObj(Get_Int_Parameter("ID"));

	if (Has_Weapon(player,"Weapon_AutoRifle_Player"))
		this->miniGunGdi = true;
	else
		this->miniGunGdi = false;
	if (Has_Weapon(player,"Weapon_AutoRifle_Player_Nod"))
		this->miniGunNod = true;
	else
		this->miniGunNod = false;
	if (Has_Weapon(player,"Weapon_Chaingun_Player"))
		this->chainGunGdi = true;
	else
		this->chainGunGdi = false;
	if (Has_Weapon(player,"Weapon_Chaingun_Player_Nod"))
		this->chainGunNod = true;
	else
		this->chainGunNod = false;
	if (Has_Weapon(player,"Weapon_ChemSprayer_Player"))
		this->chemSprayer = true;
	else
		this->chemSprayer = false;
	if (Has_Weapon(player,"CNC_Weapon_Flamethrower_Player"))
		this->flameThrower = true;
	else
		this->flameThrower = false;
	if (Has_Weapon(player,"Weapon_GrenadeLauncher_Player"))
		this->grenadeLauncher = true;
	else
		this->grenadeLauncher = false;
	if (Has_Weapon(player,"Weapon_LaserChaingun_Player"))
		this->laserChainGun = true;
	else
		this->laserChainGun = false;
	if (Has_Weapon(player,"Weapon_LaserRifle_Player"))
		this->laserRifle = true;
	else
		this->laserRifle = false;
	if (Has_Weapon(player,"Weapon_MineProximity_Player"))
		this->mineProxy = true;
	else
		this->mineProxy = false;
	if (Has_Weapon(player,"Weapon_PersonalIonCannon_Player"))
		this->persIonCannon = true;
	else
		this->persIonCannon = false;
	if (Has_Weapon(player,"Weapon_Railgun_Player"))
		this->railGun = true;
	else
		this->railGun = false;
	if (Has_Weapon(player,"Weapon_RamjetRifle_Player") || Has_Weapon(player,"CnC_Weapon_RamjetRifle_Player"))
		this->ramjet = true;
	else
		this->ramjet = false;
	if (Has_Weapon(player,"Weapon_RepairGun_Player") || Has_Weapon(player,"CnC_Weapon_RepairGun_Player_Special"))
		this->repairGun = true;
	else
		this->repairGun = false;
	if (Has_Weapon(player,"Weapon_RocketLauncher_Player"))
		this->rocketLauncher = true;
	else
		this->rocketLauncher = false;
	if (Has_Weapon(player,"CnC_Weapon_RocketLauncher_Player"))
		this->rocketGunner = true;
	else
		this->rocketGunner = false;
	if (Has_Weapon(player,"Weapon_Shotgun_Player"))
		this->shotGun = true;
	else
		this->shotGun = false;
	if (Has_Weapon(player,"Weapon_SniperRifle_Player"))
		this->sniperRifle = true;
	else
		this->sniperRifle = false;
	if (Has_Weapon(player,"Weapon_TiberiumAutoRifle_Player"))
		this->tibAutoRifle = true;
	else
		this->tibAutoRifle = false;
	if (Has_Weapon(player,"Weapon_TiberiumFlechetteGun_Player"))
		this->flechetteGun = true;
	else
		this->flechetteGun = false;
	if (Has_Weapon(player,"Weapon_VoltAutoRifle_Player"))
		this->voltAutoRifleGdi = true;
	else
		this->voltAutoRifleGdi = false;
	if (Has_Weapon(player,"Weapon_VoltAutoRifle_Player_Nod"))
		this->voltAutoRifleNod = true;
	else
		this->voltAutoRifleNod = false;
}

void cAMpa_Weapon_BackPack::Custom(GameObject *obj, int message, int param, GameObject *sender)
{
	if (message == 1000000025) 
	{
		int rnd = Commands->Get_Random_Int(1,100);
		if (rnd <= 5)
		{
			Commands->Apply_Damage(sender,99999,"Explosion_Mine_Remote_01",0);
			page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false);
		}
		else
		{
			Create_2D_WAV_Sound_Player(sender,"m00psbk_aqob0004i1evag_snd.wav");
			if (this->miniGunGdi)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player",false);
			if (this->miniGunNod)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player_Nod",false);
			if (this->chainGunGdi)      Commands->Give_Powerup(sender,"POW_Chaingun_Player",false);
			if (this->chainGunNod)      Commands->Give_Powerup(sender,"POW_Chaingun_Player_Nod",false);
			if (this->chemSprayer)      Commands->Give_Powerup(sender,"POW_ChemSprayer_Player",false);
			if (this->flameThrower)     Commands->Give_Powerup(sender,"POW_Flamethrower_Player",false);
			if (this->grenadeLauncher)  Commands->Give_Powerup(sender,"POW_GrenadeLauncher_Player",false);
			if (this->laserChainGun)    Commands->Give_Powerup(sender,"POW_LaserChaingun_Player",false);
			if (this->laserRifle)       Commands->Give_Powerup(sender,"POW_LaserRifle_Player",false);
			if (this->mineProxy)        Commands->Give_Powerup(sender,"POW_MineProximity_Player",false);
			if (this->persIonCannon)    Commands->Give_Powerup(sender,"POW_PersonalIonCannon_Player",false);
			if (this->railGun)          Commands->Give_Powerup(sender,"POW_Railgun_Player",false);
			if (this->ramjet)           Commands->Give_Powerup(sender,"POW_RamjetRifle_Player",false);
			if (this->repairGun)        Commands->Give_Powerup(sender,"POW_RepairGun_Player",false);
			if (this->rocketLauncher)   Commands->Give_Powerup(sender,"POW_RocketLauncher_Player",false);
			if (this->rocketGunner)     Commands->Give_Powerup(sender,"CnC_POW_RocketLauncher_Player",false);
			if (this->shotGun)          Commands->Give_Powerup(sender,"POW_Shotgun_Player",false);
			if (this->sniperRifle)      Commands->Give_Powerup(sender,"POW_SniperRifle_Player",false);
			if (this->tibAutoRifle)     Commands->Give_Powerup(sender,"POW_TiberiumAutoRifle_Player",false);
			if (this->flechetteGun)     Commands->Give_Powerup(sender,"POW_TiberiumFlechetteGun_Player",false);
			if (this->voltAutoRifleGdi) Commands->Give_Powerup(sender,"POW_VoltAutoRifle_Player",false);
			if (this->voltAutoRifleNod) Commands->Give_Powerup(sender,"CnC_POW_VoltAutoRifle_Player_Nod",false);
		}
	}
}

void cAMpa_Weapon_BackPack::Timer_Expired(GameObject *obj, int number)
{
	if (number == 1) 
	{
		Commands->Expire_Powerup(obj);
		Commands->Destroy_Object(obj);
	}
	else if (number == 2)
	{
		Commands->Start_Timer(obj,this,2.0f,1);
		Commands->Create_Object("Spawner Created Special Effect",Commands->Get_Position(obj));
	}
}

ScriptRegistrant<cAMpa_Weapon_BackPack>cAMpa_Weapon_BackPack_Registrant("cAMpa_Weapon_BackPack","ID:int");


.h

class cAMpa_Weapon_BackPack : public ScriptImpClass 
{
private:
	bool miniGunGdi;
	bool miniGunNod;
	bool chainGunGdi;
	bool chainGunNod;
	bool chemSprayer;
	bool flameThrower;
	bool grenadeLauncher;
	bool laserChainGun;
	bool laserRifle;
	bool mineProxy;
	bool persIonCannon;
	bool railGun;
	bool ramjet;
	bool repairGun;
	bool rocketLauncher;
	bool rocketGunner;
	bool shotGun;
	bool sniperRifle;
	bool tibAutoRifle;
	bool flechetteGun;
	bool voltAutoRifleGdi;
	bool voltAutoRifleNod;
public:
	void Created(GameObject *obj);
	void Custom(GameObject *obj, int message, int param, GameObject *sender);
	void Timer_Expired(GameObject *obj, int number);
};


Bückstabü!
Re: Weapon Drops/Keeping the Weapon [message #361165 is a reply to message #361164] Wed, 03 December 2008 01:17 Go to previous messageGo to next message
Scrin is currently offline  Scrin
Messages: 1310
Registered: January 2007
Location: Cold City
Karma: 0
General (1 Star)

lol, i realy want to play on your server again Rocked Over

Re: Weapon Drops/Keeping the Weapon [message #361205 is a reply to message #361001] Wed, 03 December 2008 10:15 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
He Campa, will this script be in 4.0 or would we have to compile ourself??

If i may compile myself, what are the names of the .h + .cpp files i may add this code too or a new file name or doesn't mind you???


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Weapon Drops/Keeping the Weapon [message #361208 is a reply to message #361001] Wed, 03 December 2008 11:28 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
thanks a lot campa i will go test it soon

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Weapon Drops/Keeping the Weapon [message #361210 is a reply to message #361001] Wed, 03 December 2008 11:38 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
It's not in 4.0 yet, (But they could add it if they want Tell Me)
you can add it where you want.

Create new files, or for example if you are using SSGM copy it in "gmscripts.cpp" / "gmscripts.h".



Bückstabü!
Re: Weapon Drops/Keeping the Weapon [message #361212 is a reply to message #361001] Wed, 03 December 2008 11:44 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
Cool Big Ups
I've added and compiled them Big Grin


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Weapon Drops/Keeping the Weapon [message #361213 is a reply to message #361001] Wed, 03 December 2008 12:01 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
what did i do wrong

on this line

page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false)

error C3861: 'page': identifier not found


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Wed, 03 December 2008 12:03]

Report message to a moderator

Re: Weapon Drops/Keeping the Weapon [message #361214 is a reply to message #361001] Wed, 03 December 2008 12:06 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
NVM

http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Wed, 03 December 2008 12:09]

Report message to a moderator

Re: Weapon Drops/Keeping the Weapon [message #361215 is a reply to message #361213] Wed, 03 December 2008 12:16 Go to previous messageGo to next message
MacKinsey is currently offline  MacKinsey
Messages: 83
Registered: March 2008
Karma: 0
Recruit
Gen_Blacky wrote on Wed, 03 December 2008 13:01

what did i do wrong

on this line

page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false)

error C3861: 'page': identifier not found


Try
Console_Input(StrFormat("ppage %d You picked up a bomb-backpack, haha its blowed.",ID).c_str());

Re: Weapon Drops/Keeping the Weapon [message #361217 is a reply to message #361215] Wed, 03 December 2008 12:27 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
MacKinsey wrote on Wed, 03 December 2008 13:16

Gen_Blacky wrote on Wed, 03 December 2008 13:01

what did i do wrong

on this line

page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false)

error C3861: 'page': identifier not found


Try
Console_Input(StrFormat("ppage %d You picked up a bomb-backpack, haha its blowed.",ID).c_str());




gave me 2 errors


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Weapon Drops/Keeping the Weapon [message #361224 is a reply to message #361217] Wed, 03 December 2008 13:12 Go to previous messageGo to next message
YazooGang is currently offline  YazooGang
Messages: 742
Registered: August 2008
Location: US
Karma: 0
Colonel
Gen_Blacky wrote on Wed, 03 December 2008 13:27

MacKinsey wrote on Wed, 03 December 2008 13:16

Gen_Blacky wrote on Wed, 03 December 2008 13:01

what did i do wrong

on this line

page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false)

error C3861: 'page': identifier not found


Try
Console_Input(StrFormat("ppage %d You picked up a bomb-backpack, haha its blowed.",ID).c_str());




gave me 2 errors

that messsage says that its a bomb... is that true?
Re: Weapon Drops/Keeping the Weapon [message #361305 is a reply to message #361001] Thu, 04 December 2008 02:56 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
Oh yes, i forgot that.

Delete

page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false);



and replace it with

char input[256];
_snprintf(input,sizeof(input), "ppage %d [RC] You picked up a bomb-backpack, haha its blowed.", Get_Player_ID(sender));
Console_Input(input);


Quote:

that messsage says that its a bomb... is that true?


Yes, there is a 5% chance to pickup the bomb. Tell Me
If you don't want that, replace:

void cAMpa_Weapon_BackPack::Custom(GameObject *obj, int message, int param, GameObject *sender)
{
	if (message == 1000000025) 
	{
		int rnd = Commands->Get_Random_Int(1,100);
		if (rnd <= 5)
		{
			Commands->Apply_Damage(sender,99999,"Explosion_Mine_Remote_01",0);
			page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false);
		}
		else
		{
			Create_2D_WAV_Sound_Player(sender,"m00psbk_aqob0004i1evag_snd.wav");
			if (this->miniGunGdi)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player",false);
			if (this->miniGunNod)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player_Nod",false);
			if (this->chainGunGdi)      Commands->Give_Powerup(sender,"POW_Chaingun_Player",false);
			if (this->chainGunNod)      Commands->Give_Powerup(sender,"POW_Chaingun_Player_Nod",false);
			if (this->chemSprayer)      Commands->Give_Powerup(sender,"POW_ChemSprayer_Player",false);
			if (this->flameThrower)     Commands->Give_Powerup(sender,"POW_Flamethrower_Player",false);
			if (this->grenadeLauncher)  Commands->Give_Powerup(sender,"POW_GrenadeLauncher_Player",false);
			if (this->laserChainGun)    Commands->Give_Powerup(sender,"POW_LaserChaingun_Player",false);
			if (this->laserRifle)       Commands->Give_Powerup(sender,"POW_LaserRifle_Player",false);
			if (this->mineProxy)        Commands->Give_Powerup(sender,"POW_MineProximity_Player",false);
			if (this->persIonCannon)    Commands->Give_Powerup(sender,"POW_PersonalIonCannon_Player",false);
			if (this->railGun)          Commands->Give_Powerup(sender,"POW_Railgun_Player",false);
			if (this->ramjet)           Commands->Give_Powerup(sender,"POW_RamjetRifle_Player",false);
			if (this->repairGun)        Commands->Give_Powerup(sender,"POW_RepairGun_Player",false);
			if (this->rocketLauncher)   Commands->Give_Powerup(sender,"POW_RocketLauncher_Player",false);
			if (this->rocketGunner)     Commands->Give_Powerup(sender,"CnC_POW_RocketLauncher_Player",false);
			if (this->shotGun)          Commands->Give_Powerup(sender,"POW_Shotgun_Player",false);
			if (this->sniperRifle)      Commands->Give_Powerup(sender,"POW_SniperRifle_Player",false);
			if (this->tibAutoRifle)     Commands->Give_Powerup(sender,"POW_TiberiumAutoRifle_Player",false);
			if (this->flechetteGun)     Commands->Give_Powerup(sender,"POW_TiberiumFlechetteGun_Player",false);
			if (this->voltAutoRifleGdi) Commands->Give_Powerup(sender,"POW_VoltAutoRifle_Player",false);
			if (this->voltAutoRifleNod) Commands->Give_Powerup(sender,"CnC_POW_VoltAutoRifle_Player_Nod",false);
		}
	}
}


with:

void cAMpa_Weapon_BackPack::Custom(GameObject *obj, int message, int param, GameObject *sender)
{
	if (message == 1000000025) 
	{
		Create_2D_WAV_Sound_Player(sender,"m00psbk_aqob0004i1evag_snd.wav");
		if (this->miniGunGdi)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player",false);
		if (this->miniGunNod)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player_Nod",false);
		if (this->chainGunGdi)      Commands->Give_Powerup(sender,"POW_Chaingun_Player",false);
		if (this->chainGunNod)      Commands->Give_Powerup(sender,"POW_Chaingun_Player_Nod",false);
		if (this->chemSprayer)      Commands->Give_Powerup(sender,"POW_ChemSprayer_Player",false);
		if (this->flameThrower)     Commands->Give_Powerup(sender,"POW_Flamethrower_Player",false);
		if (this->grenadeLauncher)  Commands->Give_Powerup(sender,"POW_GrenadeLauncher_Player",false);
		if (this->laserChainGun)    Commands->Give_Powerup(sender,"POW_LaserChaingun_Player",false);
		if (this->laserRifle)       Commands->Give_Powerup(sender,"POW_LaserRifle_Player",false);
		if (this->mineProxy)        Commands->Give_Powerup(sender,"POW_MineProximity_Player",false);
		if (this->persIonCannon)    Commands->Give_Powerup(sender,"POW_PersonalIonCannon_Player",false);
		if (this->railGun)          Commands->Give_Powerup(sender,"POW_Railgun_Player",false);
		if (this->ramjet)           Commands->Give_Powerup(sender,"POW_RamjetRifle_Player",false);
		if (this->repairGun)        Commands->Give_Powerup(sender,"POW_RepairGun_Player",false);
		if (this->rocketLauncher)   Commands->Give_Powerup(sender,"POW_RocketLauncher_Player",false);
		if (this->rocketGunner)     Commands->Give_Powerup(sender,"CnC_POW_RocketLauncher_Player",false);
		if (this->shotGun)          Commands->Give_Powerup(sender,"POW_Shotgun_Player",false);
		if (this->sniperRifle)      Commands->Give_Powerup(sender,"POW_SniperRifle_Player",false);
		if (this->tibAutoRifle)     Commands->Give_Powerup(sender,"POW_TiberiumAutoRifle_Player",false);
		if (this->flechetteGun)     Commands->Give_Powerup(sender,"POW_TiberiumFlechetteGun_Player",false);
		if (this->voltAutoRifleGdi) Commands->Give_Powerup(sender,"POW_VoltAutoRifle_Player",false);
		if (this->voltAutoRifleNod) Commands->Give_Powerup(sender,"CnC_POW_VoltAutoRifle_Player_Nod",false);
	}
}




Bückstabü!
Re: Weapon Drops/Keeping the Weapon [message #361319 is a reply to message #361001] Thu, 04 December 2008 06:44 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
You could also replace

		if (rnd <= 5)
		{
			Commands->Apply_Damage(sender,99999,"Explosion_Mine_Remote_01",0);

			char input[256];
			_snprintf(input,sizeof(input), "ppage %d [RC] You picked up a bomb-backpack, haha its blowed.", Get_Player_ID(sender));
			Console_Input(input);
		}


With

		if (rnd <= 0)
		{
			Commands->Apply_Damage(sender,99999,"Explosion_Mine_Remote_01",0);

			char input[256];
			_snprintf(input,sizeof(input), "ppage %d [RC] You picked up a bomb-backpack, haha its blowed.", Get_Player_ID(sender));
			Console_Input(input);
		}


So you can easily set it back on if you deside to use it later Wink
This is always FALSE because the random number can't become 0. The range is only 1-100 Razz (for all ppl that don't know much about programming)


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Weapon Drops/Keeping the Weapon [message #361335 is a reply to message #361305] Thu, 04 December 2008 07:46 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3813
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
If you didn't want any bombs all you have to do is:
char input[256];
_snprintf(input,sizeof(input), "ppage %d [RC] You picked up a bomb-backpack, haha its blowed.", Get_Player_ID(sender));
Console_Input(input);


Quote:

that messsage says that its a bomb... is that true?


Yes, there is a 5% chance to pickup the bomb. Tell Me
If you don't want that, replace:

void cAMpa_Weapon_BackPack::Custom(GameObject *obj, int message, int param, GameObject *sender)
{
	if (message == 1000000025) 
	{
		/*int rnd = Commands->Get_Random_Int(1,100);
		if (rnd <= 5)
		{
			Commands->Apply_Damage(sender,99999,"Explosion_Mine_Remote_01",0);
			page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false);
		}
		else*/
		{
			Create_2D_WAV_Sound_Player(sender,"m00psbk_aqob0004i1evag_snd.wav");
			if (this->miniGunGdi)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player",false);
			if (this->miniGunNod)       Commands->Give_Powerup(sender,"POW_AutoRifle_Player_Nod",false);
			if (this->chainGunGdi)      Commands->Give_Powerup(sender,"POW_Chaingun_Player",false);
			if (this->chainGunNod)      Commands->Give_Powerup(sender,"POW_Chaingun_Player_Nod",false);
			if (this->chemSprayer)      Commands->Give_Powerup(sender,"POW_ChemSprayer_Player",false);
			if (this->flameThrower)     Commands->Give_Powerup(sender,"POW_Flamethrower_Player",false);
			if (this->grenadeLauncher)  Commands->Give_Powerup(sender,"POW_GrenadeLauncher_Player",false);
			if (this->laserChainGun)    Commands->Give_Powerup(sender,"POW_LaserChaingun_Player",false);
			if (this->laserRifle)       Commands->Give_Powerup(sender,"POW_LaserRifle_Player",false);
			if (this->mineProxy)        Commands->Give_Powerup(sender,"POW_MineProximity_Player",false);
			if (this->persIonCannon)    Commands->Give_Powerup(sender,"POW_PersonalIonCannon_Player",false);
			if (this->railGun)          Commands->Give_Powerup(sender,"POW_Railgun_Player",false);
			if (this->ramjet)           Commands->Give_Powerup(sender,"POW_RamjetRifle_Player",false);
			if (this->repairGun)        Commands->Give_Powerup(sender,"POW_RepairGun_Player",false);
			if (this->rocketLauncher)   Commands->Give_Powerup(sender,"POW_RocketLauncher_Player",false);
			if (this->rocketGunner)     Commands->Give_Powerup(sender,"CnC_POW_RocketLauncher_Player",false);
			if (this->shotGun)          Commands->Give_Powerup(sender,"POW_Shotgun_Player",false);
			if (this->sniperRifle)      Commands->Give_Powerup(sender,"POW_SniperRifle_Player",false);
			if (this->tibAutoRifle)     Commands->Give_Powerup(sender,"POW_TiberiumAutoRifle_Player",false);
			if (this->flechetteGun)     Commands->Give_Powerup(sender,"POW_TiberiumFlechetteGun_Player",false);
			if (this->voltAutoRifleGdi) Commands->Give_Powerup(sender,"POW_VoltAutoRifle_Player",false);
			if (this->voltAutoRifleNod) Commands->Give_Powerup(sender,"CnC_POW_VoltAutoRifle_Player_Nod",false);
		}
	}
}



Re: Weapon Drops/Keeping the Weapon [message #361346 is a reply to message #361001] Thu, 04 December 2008 08:18 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
That's true but i had seen my way as easier Tell Me

Except this:
Jerad Gray wrote on Thu, 04 December 2008 15:46

If you didn't want any bombs all you have to do is:
char input[256];
_snprintf(input,sizeof(input), "ppage %d [RC] You picked up a bomb-backpack, haha its blowed.", Get_Player_ID(sender));
Console_Input(input);



This is only the correct code for displaying the message.
This was not working:
page(sender,"[RC] You picked up a bomb-backpack, haha its blowed.", false);

That other code does.


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Thu, 04 December 2008 08:21]

Report message to a moderator

Re: Weapon Drops/Keeping the Weapon [message #363099 is a reply to message #361001] Sun, 14 December 2008 01:22 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Bump

This part of the code keeps crashing the server when a player dies does anyone know why.



	GameObject *player = Get_GameObj(Get_Int_Parameter("ID"));

	if (Has_Weapon(player,"Weapon_AutoRifle_Player"))
		this->miniGunGdi = true;
	else
		this->miniGunGdi = false;
	if (Has_Weapon(player,"Weapon_AutoRifle_Player_Nod"))
		this->miniGunNod = true;
	else
		this->miniGunNod = false;
	if (Has_Weapon(player,"Weapon_Chaingun_Player"))
		this->chainGunGdi = true;
	else
		this->chainGunGdi = false;
	if (Has_Weapon(player,"Weapon_Chaingun_Player_Nod"))
		this->chainGunNod = true;
	else
		this->chainGunNod = false;
	if (Has_Weapon(player,"Weapon_ChemSprayer_Player"))
		this->chemSprayer = true;
	else
		this->chemSprayer = false;
	if (Has_Weapon(player,"CNC_Weapon_Flamethrower_Player"))
		this->flameThrower = true;
	else
		this->flameThrower = false;
	if (Has_Weapon(player,"Weapon_GrenadeLauncher_Player"))
		this->grenadeLauncher = true;
	else
		this->grenadeLauncher = false;
	if (Has_Weapon(player,"Weapon_LaserChaingun_Player"))
		this->laserChainGun = true;
	else
		this->laserChainGun = false;
	if (Has_Weapon(player,"Weapon_LaserRifle_Player"))
		this->laserRifle = true;
	else
		this->laserRifle = false;
	if (Has_Weapon(player,"Weapon_MineProximity_Player"))
		this->mineProxy = true;
	else
		this->mineProxy = false;
	if (Has_Weapon(player,"Weapon_PersonalIonCannon_Player"))
		this->persIonCannon = true;
	else
		this->persIonCannon = false;
	if (Has_Weapon(player,"Weapon_Railgun_Player"))
		this->railGun = true;
	else
		this->railGun = false;
	if (Has_Weapon(player,"Weapon_RamjetRifle_Player") || Has_Weapon(player,"CnC_Weapon_RamjetRifle_Player"))
		this->ramjet = true;
	else
		this->ramjet = false;
	if (Has_Weapon(player,"Weapon_RepairGun_Player") || Has_Weapon(player,"CnC_Weapon_RepairGun_Player_Special"))
		this->repairGun = true;
	else
		this->repairGun = false;
	if (Has_Weapon(player,"Weapon_RocketLauncher_Player"))
		this->rocketLauncher = true;
	else
		this->rocketLauncher = false;
	if (Has_Weapon(player,"CnC_Weapon_RocketLauncher_Player"))
		this->rocketGunner = true;
	else
		this->rocketGunner = false;
	if (Has_Weapon(player,"Weapon_Shotgun_Player"))
		this->shotGun = true;
	else
		this->shotGun = false;
	if (Has_Weapon(player,"Weapon_SniperRifle_Player"))
		this->sniperRifle = true;
	else
		this->sniperRifle = false;
	if (Has_Weapon(player,"Weapon_TiberiumAutoRifle_Player"))
		this->tibAutoRifle = true;
	else
		this->tibAutoRifle = false;
	if (Has_Weapon(player,"Weapon_TiberiumFlechetteGun_Player"))
		this->flechetteGun = true;
	else
		this->flechetteGun = false;
	if (Has_Weapon(player,"Weapon_VoltAutoRifle_Player"))
		this->voltAutoRifleGdi = true;
	else
		this->voltAutoRifleGdi = false;
	if (Has_Weapon(player,"Weapon_VoltAutoRifle_Player_Nod"))
		this->voltAutoRifleNod = true;
	else
		this->voltAutoRifleNod = false;
}


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Weapon Drops/Keeping the Weapon [message #363126 is a reply to message #361001] Sun, 14 December 2008 09:32 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
How do you attach that script?

Bückstabü!
Re: Weapon Drops/Keeping the Weapon [message #363143 is a reply to message #361001] Sun, 14 December 2008 12:40 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
I attached it to MDB_SSGM_Player backpack script and used your script instead of using MDB_SSGM_Drop_Weapon.

http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Sun, 14 December 2008 12:41]

Report message to a moderator

Re: Weapon Drops/Keeping the Weapon [message #363144 is a reply to message #361001] Sun, 14 December 2008 12:44 Go to previous messageGo to previous message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
Code.

Bückstabü!
Previous Topic: How to animate a flag?
Next Topic: Help installing LUA 5?
Goto Forum:
  


Current Time: Sun Dec 22 00:20:28 MST 2024

Total time taken to generate the page: 0.01680 seconds