1. Under
CostInit()
add this to it
Code:
level.itemCost["@@@"] = ###;
Replace @@@ with a name that represents the item, and replace ### with the price you wish to set it at.
2.Under
menuInit()
Edit like so:
Code:
level.humanM[i] = [];
level.humanM[i][0] = "Buy No Recoil Perk - " + level.itemcost["recoil"];
level.humanM[i][1] = "Buy %%% - " + level.itemcost["@@@"];
level.humanM[i][2] = "";
i++;
Replace ### with anything that appeals to you, e.g. Buy gun, or Buy Sniper
Replace @@@ with the name you used in costInit()
*REMEMBER [0] REPRESENTS THE FIRST ITEM ON THE LIST, [1] IS THE 2nd ITEM ON THE LIST, and [2] IS THE 3rd ONE OF THE LIST, the list cannot get larger than 3 items because of the way it was set.
3.Under
HumanShop() or ZombieShop() depending on which shop you added your item to:
Find out which menu number it is under; To find out, follow like so:
Now look at these:
Code:
if(self.buttonPressed[ "+actionslot 3" ] == 1)
{
self.buttonPressed[ "+actionslot 3" ] = 0;
if(self.menu == 0){
-If your item was placed as the first slot item (level.humanM[i][0]) then the item coding will be put under +actionslot 3
-If your item was placed as the 2nd slot item (level.humanM[i][1]) then the item coding will be put under +actionslot 4
-and if your item was placed as the 3rd slot item (level.humanM[i][2]) then the item coding will be put under +actionslot 2
4. Adding your weapon/item code to humanShop() or zombieShop():
Under the correct +actionslot, place this layout anywhere in it, make sure you don't accidentally delete brackets or letters off other functions, this may make it difficult to fix later on.
Code:
if(self.menu == ##)
{
if(self.bounty >= level.itemCost["@@@"])
{
self.bounty -= level.itemCost["@@@"];
self giveWeapon("%%%", 0, false);
self switchToWeapon("%%%");
self thread maps\mp\gametypes\_hud_message::hintMessage("^^^^^^");
self notify("CASH");
}
else
{
self iPrintlnBold("^1Not Enough ^3Cash");
}
}
-Replace the ## with the number of the menu in which the item is in, (this will range from 0 onwards, refer to the menuinit() picture previously.
-Replace @@@ with the SAME item name you used in costInit()
-Replace %%% with the actual file name of the weapon, this can be found on this thread posted by Abstract,
Here.
-Now replace ^^^^^ with the text you want to appear after you buy the item.
5. Save, and lets hope you have coded the item correctly.