Command and Conquer: Renegade Official Forums - RDF feed
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
#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
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.
We do this using a stack and saving the presets of all picked up weapons, its simple enough to do
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 . 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.
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.
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...
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); };
lol, i realy want to play on your server again
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???
thanks a lot campa i will go test it soon
It's not in 4.0 yet, (But they could add it if they want ) 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".
Cool I've added and compiled them
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
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());
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
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?
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. 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); } }
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 This is always FALSE because the random number can't become 0. The range is only 1-100 (for all ppl that don't know much about programming)
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. 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); } } }
That's true but i had seen my way as easier 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.
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; }
I attached it to MDB_SSGM_Player backpack script and used your script instead of using MDB_SSGM_Drop_Weapon.
Your code void Backpack_Weapon_Drop::Created(GameObject *obj) { Commands->Start_Timer(obj,this,8.0f,1); 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 Backpack_Weapon_Drop::Custom(GameObject *obj, int message, int param, GameObject *sender) { //if (message == 1000000025) { 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); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_POW_MineRemote_02")) { Create_2D_WAV_Sound_Player(sender,"m00pac4_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_AutoRifle_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwar_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_AutoRifle_Player_Nod")) { Create_2D_WAV_Sound_Player(sender,"m00pwar_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_Chaingun_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwcg_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_Chaingun_Player_Nod")) { Create_2D_WAV_Sound_Player(sender,"m00pwcg_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_ChemSprayer_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwcs_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_Flamethrower_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwft_aqob0001i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_GrenadeLauncher_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwgl_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_LaserChaingun_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwlc_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_LaserRifle_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwlr_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_RepairGun_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwrp_aqob0001i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_PersonalIonCannon_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwpi_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_Railgun_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwrg_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_RamjetRifle_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwrj_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_RocketLauncher_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwrl_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_Shotgun_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwps_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_SniperRifle_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwsr_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_SniperRifle_Player_Nod")) { Create_2D_WAV_Sound_Player(sender,"m00pwsr_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_TiberiumAutoRifle_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwtr_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_TiberiumFlechetteGun_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwtf_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"POW_VoltAutoRifle_Player")) { Create_2D_WAV_Sound_Player(sender,"m00pwvr_aqob0004i1evag_snd.wav"); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_POW_VoltAutoRifle_Player_Nod")) { Create_2D_WAV_Sound_Player(sender,"m00pwvr_aqob0004i1evag_snd.wav"); Commands->Start_Timer(obj,this,6.0f,2); } } void Backpack_Weapon_Drop::Timer_Expired(GameObject *obj, int number) { if (number == 1) { Commands->Expire_Powerup(obj); Commands->Destroy_Object(obj); } else if (number == 2) { Commands->Create_Object("Spawner Created Special Effect",Commands->Get_Position(obj)); } } ssgm Player with your script attached void MDB_SSGM_Player::Destroyed(GameObject *obj) { if (Settings->DestroyPlayerVeh && Get_Vehicle(obj)) { GameObject *Veh = Get_Vehicle(obj); if (Get_Vehicle_Driver(Veh) == obj) { Commands->Apply_Damage(Veh,99999,"Death",false); } } if (!Data->Mod && Settings->DropWeapons && WasKilled) { WasKilled = false; Vector3 DeathPlace = Commands->Get_Position(obj); int RandomNum = Commands->Get_Random_Int(1,5); GameObject *BackpackScript = 0; if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_MiniGunner_0")) { BackpackScript = Commands->Create_Object("Weapon_AutoRifle_Player",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_Minigunner_0")) { BackpackScript = Commands->Create_Object("Weapon_AutoRifle_Player_Nod",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_MiniGunner_1Off")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_Chaingun_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_MiniGunner_1Off")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_Chaingun_Player_Nod",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_1Off")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_ChemSprayer_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_0")) { BackpackScript = Commands->Create_Object("POW_Flamethrower_Player",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_Grenadier_0")) { BackpackScript = Commands->Create_Object("POW_GrenadeLauncher_Player",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_RocketSoldier_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("POW_LaserChaingun_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("POW_LaserRifle_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_Technician_0")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_RepairGun_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_Engineer_2SF")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_RepairGun_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_Engineer_0")) { BackpackScript = Commands->Create_Object("CnC_POW_MineRemote_02",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_Engineer_0")) { BackpackScript = Commands->Create_Object("CnC_POW_MineRemote_02",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Sydney_PowerSuit")) { if (RandomNum == 1) { BackpackScript = Commands->Create_Object("POW_PersonalIonCannon_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_RocketSoldier_3Boss")) { if (RandomNum == 1) { BackpackScript = Commands->Create_Object("POW_Railgun_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_Minigunner_3Boss")) { if (RandomNum == 1) { BackpackScript = Commands->Create_Object("POW_RamjetRifle_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_MiniGunner_3Boss")) { if (RandomNum == 1) { BackpackScript = Commands->Create_Object("POW_RamjetRifle_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_RocketSoldier_1Off")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_RocketLauncher_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_RocketSoldier_1Off")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_RocketLauncher_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_RocketSoldier_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("CnC_POW_RocketLauncher_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_RocketSoldier_0")) { BackpackScript = Commands->Create_Object("POW_Shotgun_Player",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_RocketSoldier_0")) { BackpackScript = Commands->Create_Object("POW_Shotgun_Player",DeathPlace); } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_MiniGunner_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("POW_SniperRifle_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_Minigunner_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("POW_SniperRifle_Player_Nod",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Sydney")) { if (RandomNum == 1 || RandomNum == 2 || RandomNum == 3) { BackpackScript = Commands->Create_Object("POW_TiberiumAutoRifle_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_Minigunner_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("POW_SniperRifle_Player_Nod",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_Grenadier_2SF")) { if (RandomNum == 1 || RandomNum == 2) { BackpackScript = Commands->Create_Object("POW_TiberiumFlechetteGun_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Ignatio_Mobius")) { if (RandomNum == 1) { BackpackScript = Commands->Create_Object("POW_VoltAutoRifle_Player",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else if (strstr(Commands->Get_Preset_Name(obj),"CnC_Nod_FlameThrower_3Boss")) { if (RandomNum == 1) { BackpackScript = Commands->Create_Object("CnC_POW_VoltAutoRifle_Player_Nod",DeathPlace); } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } } else { BackpackScript = Commands->Create_Object("POW_Armor_100",DeathPlace); } Commands->Attach_Script(BackpackScript,"Backpack_Weapon_Drop",""); } if (Find_My_Veh(obj)) { Commands->Send_Custom_Event(obj,Find_My_Veh(obj),1111,0,0); } } Im not sure if im even close of doing this right but it was something I tried. I would have to edit the drop script but i was just trying to find out why its crashing
Uhm the code where you attach my script.
i did lol Commands->Attach_Script(BackpackScript,"Backpack_Weapon_Drop",""); bottom of MDB_SSGM_Player
My script needs the parameter from the player's ID. Try this: char script[32]; _snprintf(script,sizeof(script),"%d",Get_Player_ID(obj)); Commands->Attach_Script(BackpackScript,"cAMpa_Weapon_BackPack",script); And don't rename the script name.
lol sorry what i did is just copy MDB_SSGM_Drop_Weapon and put your code in it and renamed MDB_SSGM_Drop_Weapon to Backpack_Weapon_Drop ill put campa in front of it to make you happy.
It still crashes it doesn't crash for spawn character but it crashes on any other charter
Best is you catch me on atomix IRC.
Woah dude, that has to be the worst code EVER.
sorry to bump a old old post however Im starting to play with the code a bit and am getting a Has_weapon error. has this been updated or has it been abandoned? I would like so do a similar backpack add-on ti Atomix's
I made a drop weapon system and released it some time ago. It's different to what Camp kindly provided, but basically means when a player dies, they drop a back-pack with all there weapons. It's on my download page, here: http://spencerelliott.co.uk/downloads.html I think I made it so SBH can't pick them up, but I can't remember now.
yes, I installed that one, Love it. but I wasn't sure, but if they have aquired other weapons, will they stay in the back as well? Is there a way to add "special items" in the packs? and yes, SBH's cant pick them up.... I like that, when im not a SBH
Khyron263 wrote on Fri, 12 February 2010 09:53 yes, I installed that one, Love it. but I wasn't sure, but if they have aquired other weapons, will they stay in the back as well? Is there a way to add "special items" in the packs? and yes, SBH's cant pick them up.... I like that, when im not a SBH Yes, weapons are persistant with this system. You can add other weapons to the pack if you wanted to, but you would have to edit the plugin itself.
cool, ill give it a try thanks
nevermind
aww, leave the guy alone, that was over a year ago
playing around some, is there a way.... instead of a weapon, to also add a random element to it? Like, most of the time you pick up a pack and get the weapon from the person that got killed... or, instead of the weapon you can get turned into another char. or call in an airstrike, or money, something like that. Kind of incoporate a crate element into it as well.... but only a low percentage. maybe 10% of the time you get a random event.
If your using reborn weapon drop just make a random to drop a power up or whatever instead of the backpack, or you could make a random to add the special power up to the backpack.
ummm, so if i want to use a crate , and im using reborns plugin, how do i make a call from a plug-in to the crates that are in ssmg? im still learning, so please bear with me. a sample of code would help if you have the time, so i can reproduce it and work with it? I tryed to replace a weapon with a crate, just to see how it will work before i try to do a random, but it didnt take, the pack apeared but it didnt do anything.
disregaurd, i got it.... took a little thinking on my part