Simple Weapon Naming
Created By: Marius
eMail: lordshoel@yahoo.com
Difficulty Scale: Easy


Ever played normal Quake nad not know what weapon your selecting? Want to have a button to tell you what weapon you have? If you do follow this really simple tutorial and in notime you'll have weapon names on selection...

Step 1.

This is a very simple tutorial. Lets get started by opening up Weapons.qc and scrolling down to the W_ChangeWeapon function. Found it? If you have paste the below code just above that function.

/*
===============
WeaponName - Prints Weapon Name
===============
*/
void() WeaponName =
{
      local string weapname;

      if (self.weapon == IT_AXE)weapname = "Double-Handed Axe";
      else if (self.weapon == IT_SHOTGUN)weapname = "Shotgun";
      else if (self.weapon == IT_SUPER_SHOTGUN)weapname = "Double Barrel Shotgun";
      else if (self.weapon == IT_NAILGUN)weapname = "Nailgun";
      else if (self.weapon == IT_SUPER_NAILGUN)weapname = "Super Nailgun";
      else if (self.weapon == IT_GRENADE_LAUNCHER)weapname = "Grenade Launcher";
      else if (self.weapon == IT_ROCKET_LAUNCHER)weapname = "Rocket Launcher";
      else if (self.weapon == IT_LIGHTNING)weapname = "Thunderbolt";

      sprint (self, weapname);
      sprint (self, "\n");
        
};

Step 2.

Once you've done that scroll down to the last line of W_ChangeWeapon. It should look like this:

//
// set weapon, set ammo
//
	self.weapon = fl;		
	W_SetCurrentAmmo ();
Now replace that code with the following code over that:

//
// set weapon, set ammo
//
	self.weapon = fl;		
	W_SetCurrentAmmo ();
	WeaponName ();			//Prints Weapon Name

Step 3.

Now scroll down to the ImpulseCommands function and above QuadCheat paste:

		if (self.impulse == 15)WeaponName ();	//Prints Current Weapon

Step 4.

Thats it! Save and Compile. Its an easy and simple tutorial that may come in handy. The best bit is it compatible with most mods so if you wish to include it go ahead, its only 4 steps and its completed. Have fun and happy gamig.