Jump to content

[Release] Quick and easy way to sell your Gemstones


Recommended Posts

Quick and easy Gemstone Trade

Epoch 1.0.4.2

 

trader_gems_zpse329f61d.png

 

____________________________________________________________________________________________________________________________________________

 

What is this?

This is a very simple way to quickly allow players to sell Gemstones. It's nothing new or custom, in fact, most experienced modders are likely already aware of this method.

It makes use of the same code that allows you to trade 1 Empty Whiskey Bottle for one 1 1oz Copper Bar.

 

Why am I releasing this?

Because it's nice to give back to people who spend time making awesome mods that I couldn't make myself.

Also, when searching for a way to sell Gems my options were hacking files and code around or adding a new "Gems" category to the trader and inserting them to

the database. Okay, fine, that does indeed work, but this also allows you to Buy the gems, which I didn't want or need. I finally stumbled upon this Empty Whiskey -> Copper Bar

code and had a eureka moment.

 

Limitations

This method only checks your personal inventory, this means this method cannot be used to sell any primary or secondary weapons, including the Chainsaw (I tried). If it is possible, I've missed it completely.

You cannot trade for multiple items. That is, trading one item, for two different items, you can however trade for multiple of the same item.

E.g. Trade 1 Emerald for 4 Gold Bar - Possible!

E.g. Trade 1 Emerald for 5 Gold Bar and 2 Silver Bar - Not Possible!

 

How to make use of this method

  • Start by extracting your server_traders.sqf from your mission.pbo and open the file in your text editor of choice.
  • Look through the code and decide which trader you wish to use for the Gemstone Trade. I decided the Black-market Trader was a good choice.
// Black market, Stary
menu_FR_Rodriguez = [
    [["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529]],
    [],
    "neutral"
];
  • Change to the following
// Black market, Stary
menu_FR_Rodriguez = [
[["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529]],
    [
	["ItemGoldBar10oz","ItemRuby",1,1,"buy","Ruby","Gold Bar (10oz)",101],
	["ItemGoldBar10oz","ItemObsidian",1,1,"buy","Obsidian","Gold Bar (10oz)",101],
	["ItemGoldBar10oz","ItemAmethyst",1,1,"buy","Amethyst","Gold Bar (10oz)",101],
	["ItemGoldBar10oz","ItemTopaz",1,1,"buy","Topaz","Gold Bar (10oz)",101],
	["ItemGoldBar10oz","ItemCitrine",1,1,"buy","Citrine","Gold Bar (10oz)",101],
	["ItemGoldBar10oz","ItemEmerald",1,1,"buy","Emerald","Gold Bar (10oz)",101],
        ["ItemGoldBar10oz","ItemSapphire",1,1,"buy","Sapphire","Gold Bar (10oz)",101]
    ],
    "neutral"
];

Updates

29th March 14 - Sapphire added to the list, thanks for Snakeeyes for spotting

Link to comment
Share on other sites

I just tried your mod and it works great! I'm adding Sapphire to the list of Gemstones that can be sold at the Black Market trader. I'm going to get out my sledgehammer and do some mining this weekend.

 

Thanks!

 

:)

 

Well spotted, didn't realize I missed Sapphire, I'll update the original post a little later.

Link to comment
Share on other sites

I've got the same problem here. Tried everthing, but I've just tried changing the class of the trader. 

 

// Black market
menu_GUE_Woodlander2 = [
[["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529]],
[],
"neutral"
];
 
I'll let you know if it works. 
 
- EDIT - 
 
It worked, change the class name back to the original name.
Link to comment
Share on other sites

  • 3 months later...

Excuse me for this question but... if i want they sell for more then 1 goldbar , what value i need change? thanks in advance and sorry for disturb

["ItemBriefcase100oz","ItemRuby",1,1,"buy","Ruby","Briefcase (100oz)",101],

 

Haven't tried it but I would imagine the parts in red is what you would want to change. You could probably also change the 1,1 to say 1,2 to make 1 ruby sell for 2 gold or briefcases. <-- This part is a guess since OP did not include an example of how to make it sell for more than 1.

 

You can also just add a gems section to your traders, give it a TID and then enter the gems prices into the database. Works well if you want stuff to sell for more than the standard 12 briefcases. For example on our server all the heavily armed vehicles are bought with gems & a M1A2 Tusk is 12 rubies. Rubies cost 12 briefcase each so the tank actually costs 144 briefcases.

 

This method isn't as easy as OP's but works well.

 

In server_traders.sqf, add the part in red: (Make sure the number you use is not already in use by one of the other traders)

 

// Black market, Stary

menu_FR_Rodriguez = [

    [["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529],["Gems",530]],

    [],

    "neutral"

];

 

Then you would run a database query and add this: INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemRuby",3]', 5000, '[12,"ItemBriefcase100oz",1]', '[10,"ItemBriefcase100oz",1]', 530, 'trade_items');

 

That will make it so a ruby will sell for 10 briefcases and you can buy for 12.

 

Lastly you would change the buy & sell item line in the database for the specific vehicle to [12,"ItemRuby",1] to buy it & [6,"ItemRuby",1] to sell it.

These are of course examples, you can have them buy & sell for whatever you want.

 

Someone made a more detailed post on how to do the database method but I can't find it.

Link to comment
Share on other sites

  • 1 month later...

Was looking for the smelting fix and stumbled upon this lil gem tonight. I could never get smelting to work so decided to give this a go using gold, silver and iron ore. I added 5 lines to a trader allowing the trade of 1 gold ore for 1 gold bar, 10 gold ore for 1 10oz bar, 1 silver ore for 1 silver bar, 10 silver ore for 1 10oz silver bar and lastly 1 iron ore for 1 10oz gold bar (after a bit of mining, I only had the one so....yeah). Mind you, that was after trying out the gems first. Worked like a charm so onward I went. Item names are PartOreGold, PartOreSilver and ParOre for gold ore, silver ore and iron ore respectively. Just input 1 for 1 and 1 for 10 where applicable. Might be a real quick way to offload unused ammo and other items. 

 

Thanks for the share. 

 

Updating, smelting fix in forums does work. I just forgot to redirect the sqf directory in the compiles. So will remove this from the server traders for the ore items and retaining the gem additions. Once again, much appreciated.

Edited by TheRedAfro
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...