Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Code Release - God Crate
Code Release - God Crate [message #315988] Thu, 07 February 2008 12:12 Go to previous message
ExEric3 is currently offline  ExEric3
Messages: 746
Registered: February 2005
Location: Slovakia
Karma:
Colonel
Maybe others have another codes but I decide release my own. This code was taken from SSAOW v1.3.4 but I added here something.

This is for people who like to mod their server scripts.dll and are running SSGM.
Main Code:

			else if ((RandomIntCrate <= (percent+=Settings->CrateGod)) && (Settings->CrateGod > 0)) {
				StrFormat2(message2,"%ls picked up a God Crate.",Get_Wide_Player_Name(sender));
				if (Commands->Get_Player_Type(sender) == 1) {
					Change_Character(sender,"CnC_GDI_RocketSoldier_2SF_Secret");
					Commands->Clear_Weapons(sender);
					Commands->Give_Powerup(sender,"POW_VoltAutoRifle_Player",true);
					Commands->Give_Powerup(sender,"POW_RamjetRifle_Player",true);
					Commands->Give_Powerup(sender,"POW_Railgun_Player",true);
					Commands->Select_Weapon(sender,"Weapon_RamjetRifle_Player");
					StrFormat2(message1,"ppage %d [Crate]: You just got a God Crate. You will be have more power to kill others.",Get_Player_ID(sender));
					Console_Input(StrFormat("msg [Crate]: Warning! A %ls player just got a God Crate, better watch your base %ls!",Get_Wide_Team_Name(Team),Get_Wide_Team_Name(PTTEAM(Team))).c_str());
				}
				else if (Commands->Get_Player_Type(sender) == 0) {
					Change_Character(sender,"CnC_Nod_RocketSoldier_3Boss_Secret");
					Commands->Clear_Weapons(sender);
					Commands->Give_Powerup(sender,"POW_VoltAutoRifle_Player",true);
					Commands->Give_Powerup(sender,"POW_RamjetRifle_Player",true);
					Commands->Give_Powerup(sender,"POW_Railgun_Player",true);
					Commands->Select_Weapon(sender,"Weapon_RamjetRifle_Player");
					StrFormat2(message1,"ppage %d [Crate]: You just got a God Crate. You will be have more power to kill others.",Get_Player_ID(sender));
					Console_Input(StrFormat("msg [Crate]: Warning! A %ls player just got a God Crate, better watch your base %ls!",Get_Wide_Team_Name(Team),Get_Wide_Team_Name(PTTEAM(Team))).c_str());
				}
				
				Commands->Set_Health(sender,800);
				Commands->Set_Shield_Strength(sender,800);
				
				Commands->Give_Powerup(sender,"POW_Pistol_Player",true);
				Commands->Give_Powerup(sender,"CnC_POW_MineRemote_02",true);
				Commands->Give_Powerup(sender,"CnC_POW_MineTimed_Player_02",true);
				Commands->Give_Powerup(sender,"CnC_MineProximity_05",true);

				Commands->Give_Powerup(sender,"CnC_POW_Ammo_ClipMax",false);
				Commands->Give_Powerup(sender,"CnC_POW_Ammo_ClipMax",false);
				Commands->Give_Powerup(sender,"CnC_POW_Ammo_ClipMax",false);
				Commands->Give_Powerup(sender,"CnC_POW_Ammo_ClipMax",false);
								
				if (Settings->Gamelog) {
					Vector3	pos	= Commands->Get_Position(sender);
					StrFormat2(message3,"CRATE;God;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
				}
			}


You can add it under this crate code in gmcrate.cpp:

			else if ((RandomIntCrate <= (percent+=Settings->CrateThief)) && (Settings->CrateThief > 0)) {
				Commands->Give_Money(sender,(Commands->Get_Money(sender) * -1),false);
				StrFormat2(message2,"%ls picked up a Thief Crate.",Get_Wide_Player_Name(sender));
				StrFormat2(message1,"ppage %d [Crate]: You got the Thief Crate, you have lost all of your credits.",Get_Player_ID(sender));
				Console_Input(StrFormat("msg [Crate]: %ls picked up a Thief Crate and he lost all credits.",Get_Wide_Player_Name(sender)).c_str());
				Create_2D_Sound_Player(sender,"m00evag_dsgn0028i1evag_snd.wav");
				if (Settings->Gamelog) {
					Vector3	pos	= Commands->Get_Position(sender);
					StrFormat2(message3,"CRATE;THIEF;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
				}
			}


Now, inside the definition of "void CrateSettings::Load()" copy and paste the following: (next under "CrateThief = INI->Get_Int("Crates","Thief",0);")

CrateGod = INI->Get_Int("Crates","God",0);


Now, inside the definition of "void Crate_Defaults()" copy and paste the following: (change any values needed to make them all add up to 100. Again next unde "Settings->CrateThief = 2;")

Settings->CrateGod = 1;


Now, inside the definition of "void Crate_Level_Loaded()" copy and paste the following: (next "+ Settings->ThiefCrate" and if its your last crate in your scripts)

+ Settings->CrateGod;


So thats all in gmcrate.cpp No we must edit gmcrate.h So now, inside the definition of "struct CrateSettings" copy and paste the following: (again next under "int CrateThief;")

int CrateThief;


You'll need to add some entries to the Crate Section in ssgm.ini So under [Crate] add (you can set higher number max to 100:

God=1


Thanks to reborn for help and his time.
I hope you will enjoy this.

Thanks.

ExEric3
 
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: Server Side Unlimited ammo mod
Next Topic: Battle For Dune update 13.
Goto Forum:
  


Current Time: Fri Dec 20 15:00:44 MST 2024

Total time taken to generate the page: 0.00801 seconds