Power-Up Menu System
by : Error

Step 1)
	Create a new file named menu.qc and add all of the following to that file.


float A_CODE;


void() CheatMenuPopUp =
{
	if (A_CODE == 1)
	{
		centerprint (self, " Power-Ups \n for \n Cells \n\n    \n  Pent   50c\n  Enviro 50c\n  Ring   50c\n\n");
	}
	else if (A_CODE == 2)
	{
		centerprint (self, " Power-Ups \n for \n Cells \n\n  Quad   50c\n    \n  Enviro 50c\n  Ring   50c\n\n");
	}
	else if (A_CODE == 3)
	{
		centerprint (self, " Power-Ups \n for \n Cells \n\n  Quad   50c\n  Pent   50c\n  \n  Ring   50c\n\n");
	}
	else if (A_CODE == 4)
	{
		centerprint (self, " Power-Ups \n for \n Cells \n\n  Quad   50c\n  Pent   50c\n  Enviro 50c\n    \n\n");
	}
	else
	{
		centerprint (self, " Power-Ups \n for \n Cells \n\n  Quad   50c\n  Pent   50c\n  Enviro 50c\n  Ring   50c\n\n");
	}
};


void() SelectCht =
{
	if (A_CODE > 4)
	{
		sound (self, CHAN_VOICE, "misc/menu1.wav", 1, ATTN_NORM);
		A_CODE = A_CODE - 4;
		CheatMenuPopUp();
	}
	else
	{
		sound (self, CHAN_VOICE, "misc/menu1.wav", 1, ATTN_NORM);
		A_CODE = A_CODE + 1;
		CheatMenuPopUp();
	}
};


void() GiveCht =
{
	if (self.ammo_cells < 50)
	{
		sprint (self, "Not Enough Cells\n");
	}
	else
	{
	if (A_CODE == 1)
	{
		self.ammo_cells = self.ammo_cells - 50;
		sound (self, CHAN_VOICE, "misc/menu2.wav", 1, ATTN_NORM);
		self.super_time = 1;
		self.super_damage_finished = time + 30;
		self.items = self.items | IT_QUAD;
		sprint (self, "Thank you for buying the Quad Damage.\n");
	}
	else if (A_CODE == 2)
	{
		self.ammo_cells = self.ammo_cells - 50;
		sound (self, CHAN_VOICE, "misc/menu2.wav", 1, ATTN_NORM);
		self.invincible_time = 1;
		self.invincible_finished = time + 30;
		self.items = self.items | IT_INVULNERABILITY;
		sprint (self, "Thank you for buying the Pentagram.\n");
	}
	else if (A_CODE == 3)
	{
		self.ammo_cells = self.ammo_cells - 50;
		sound (self, CHAN_VOICE, "misc/menu2.wav", 1, ATTN_NORM);
		self.rad_time = 1;
		self.radsuit_finished = time + 30;
		self.items = self.items | IT_SUIT;
		sprint (self, "Thank you for buying the Enviro-Suit.\n");
	}
	else if (A_CODE == 4)
	{
		self.ammo_cells = self.ammo_cells - 50;
		sound (self, CHAN_VOICE, "misc/menu2.wav", 1, ATTN_NORM);
		self.invisible_time = 1;
		self.invisible_finished = time + 30;
		self.items = self.items | IT_INVISIBILITY;
		sprint (self, "Thank you for buying the Ring of Shadows.\n");
	}
	else
	{
		sprint (self, "No Power-Up Selected.\n");
		CheatMenuPopUp();
	}
}
};



Step 2)
	Now open the progs.src file and put "menu.qc" at the end of it.

Step 3)
	Now open the weapons.qc file and add this to the bottom of the
	function "W_Precache".


		precache_sound("items/inv1.wav");
		precache_sound("items/inv2.wav");
		precache_sound("items/inv3.wav");
		precache_sound("misc/menu1.wav");
		precache_sound("misc/menu2.wav");
		precache_sound("items/protect2.wav");
		precache_sound("items/suit2.wav");
		precache_sound("items/damage2.wav");


Step 4)
	Now find the function "ImpulseCommands" and add this BEFORE that function.


		void() CheatMenuPopUp;
		void() SelectCht;
		void() GiveCht;


Step 5)
	Now actually in the function "ImpulseCommands" add the following.


	if (self.impulse == 20)
		CheatMenuPopUp ();
	if (self.impulse == 21)
		SelectCht ();
	if (self.impulse == 22)
		GiveCht ();


Step 6)
	Now compile and you have yourself a cool Menu System.