Created By: Wampey
eMail: wampey@planetquake.com
Difficulty Scale: Easy


This tut will teach you how to make something like Militia Quake.
So, lets get Started.


Step 1



first open up your defs.qc and at the bottom add:
	.float ammo_money; //defines ammo_money

then make a new .qc file and call it buyrocket.qc
in that add:
void() BuyRocket = //declaring the void function
{
	if (self.ammo_money >= 90) //declaring how much ammo_money you need to have
      {
		self.ammo_money = self.ammo_money - 90; /declaring how much ammo_money it costs
            self.items = self.items | //gives you a new item
		   IT_ROCKET_LAUNCHER; //which is the rocket launcher
		sprint (self, "You bought the rocket launcher\n"); //states on your screen that you bought the rl
		self.ammo_rockets = self.ammo_rockets+ 5; // how much ammo comes with it
      } 
};
save that as buyrocket.qc

open up your progs.src and add:

weapons.qc
buyrocket.qc //add this

now open up your weapons.qc and add:
void() BuyRocket;
under
void() SuperDamageSound;
then at the impulse command part add:
if (self.impulse == 20)
	BuyRocket ();
save that.

now open your item.qc and scroll down to weapon_touch and then goto 
if (self.classname == "weapon_nailgun") and replace all of the nailgun stuff with this:
if (self.classname == "weapon_nailgun")
{
	other.ammo_money = other.ammo_money + 30; //now when you get to the 
}

then if you you downloaded the money.mdl (link to http://www.planetquake.com/census/militia/money.zip) and would like to use that to replace you nailgun spinning 
model scroll down until you get to void() weapon_nailgun = and replace all of it with this:
void() weapon_nailgun =
{
	precache_model ("progs/money.mdl");
	setmodel (self, "progs/money.mdl");
	self.weapon = IT_NAILGUN;
	self.netname = "nailgun";
	self.touch = weapon_touch;
	setsize (self, '-16 -16 0', '16 16 56');
	StartItem ();
};
then save it and close it.
to be able to see how much money have go to step 2 or skip that and compile it.




Step 2


Now open your weapon.qc and scroll down to ServerflagsCommand and add these next lines 
under the quadcheat stuff.
void() MoneyAmount = //declares moneyamount
{
	local string s; //does something
	sprint (self, "You have "); //prints you have
	s = ftos (self.ammo_money); //pretty much binds the letter s in this moneyamount stuff to show money amount
	sprint (self,s); //tells it to say the money amount
	sprint (self, " dollars\n"); //says dollars
};
dont worry it will come out on the top lefthand side saying you have *** dollars (*** meaning money you have)

then goto impulse commands and add this at the bottom
if (self.impulse == 15)
   	MoneyAmount ();

that is all you have to do
send feedback and maybe you will get some more addon stuff to this
 wampey@planetquake.com

HTMLized by Adrian "Mr. Pink" Finol