Jump to content

[Release]Higher Currency at Traders.


Recommended Posts

ok so to add gems and all to traders what you have to do is make a currency catergory at one of the traders. so to do this go to your mission folder and open up your server_traders.sqf

now select what trader you want the new currency category to be in. when i say category i mean like the different menu the each trader have. so the weapon trader have assult rifles. lmg and snipers and so on.

 

so on mine im doing it for black market.

// Black market
menu_GUE_Woodlander2 = [
	[["Ammo",527],["Weapons",526],["Explosives",529]],
	[],
	"neutral"
];

ok so after the ["Explosives",529] or the last entry in any of the other traders. add a , then do ["currency",randomenumber] so mine look like this now

// Black market
menu_GUE_Woodlander2 = [
	[["Ammo",527],["Weapons",526],["Explosives",529],["Currency",702]],
	[],
	"neutral"
];

the 702 is my random number, you have to make sure its 3 digits and only that trader has it. so make sure no other trader has the number you chose(ie. 702) now save that and go to your database. and go to the Trader_DATA

and insert this into it

INSERT INTO `Traders_DATA` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES
('["ItemEmerald",1]', 100, '[10,"ItemBriefcase100oz",1]', '[10,"ItemBriefcase100oz",1]',0,702, 'trade_items_old')
you can change the itembriefcase to the about on how much you want to buy it or sell it for
the itememrald can also be ItemTopaz or ItemCitrine or ItemAmethyst or ItemObsidian or ItemRuby
 
 
please thank  this person, because i got the thing from him/her
Link to comment
Share on other sites

how can I make the ItemRuby a form of payment ??

this looks to me like it only lets you exchange it for gold ?? or am I wrong ?

 

like I want a player to have to mine and find a ruby to purchase a rare weapon like

 

INSERT INTO Traders_DATA (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES

('["SCAR_H_STD_TWS_SD",3]', 200, '[2,"ItemRuby",1]', '[1,"ItemRuby",1]', 526, 'trade_weapons');
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 month later...

I've tried to add rubys but doesn't works :\ When I go to currency nothing appear... 

You added rubys to the traders in your database as well? I've added all the gems to mine and it's working perfectly. This is an easy thing to implement if you follow the directions.

BTW, thanks Hellgamer for a great way to use the in game items & make it easy for tanks and stuff cost more than 12 briefcases!!!

Link to comment
Share on other sites

Does anyone know the chance for gems to spawn by breaking a mine?

 

Also, can anyone rate the gemstones for value? My assumption is, from lowest value to highest, Obsidian, Topaz, Amethyst, Citrine, Emerald, and Ruby?

Link to comment
Share on other sites

Hmm. So it's just RNG for what gem will drop. Does it make sense to make them all the same price then considering?

 

Well, there's an equal chance for any gem to drop so I guess they're all worth the same. Maybe you could change it so only a couple types can be mined and the rest need to be purchased from a vendor for briefcases?

Link to comment
Share on other sites

When I tried this I was able to buy the item with an emerald, but it consumed the emerald out of my backpack, which is an issue.

 

I just tried it again and it doesn't remove the gem from my backpack but does give me the item.

 

not using sql, i am doing the CfgTraderCategory hpp files instead.

 

class Category_4005 {
    class AKS_74_kobra {type = "trade_weapons";buy[] = {1,"ItemRuby"};sell[] = {1,"ItemEmerald"};};
};

Link to comment
Share on other sites

That % is adjustable though, if you wanted to make gems super rare.

Hi, if I wanted to make them rarer than 40%, as they are currently set in remove.sqf to:

if((random 10) <= 4) then {

 

could I change that line to read like this:

if((random 100) <= 4) then {

 

or this:

if((random 10) <= 0.4) then {

 

Would this make it a 4% chance? Or, am I way off piste! 

 

Any help would be gratefully received.

Link to comment
Share on other sites

if((random 100) <= 4) then {

 

That would mean they have a 4% chance to spawn

Hi Cen, this doesn't seem to have worked. The miners on my server reckon they might be slightly more rare but nothing under 35%.....

 

I pulled remove into my mission/custom folder and changed the call in compiles.sqf to point to the customised file. I can also confirm I am only running one compiles override.

 

Any ideas.....

Link to comment
Share on other sites

Hi, I followed this tutorial but am getting this error message in my server rpt:

 9:43:02 "EPOCH SERVERTRADE: Player: ShermaN_TanK (76561STEAM1567) sold a ItemRuby in/at trader city Stary for <null>x <null>"
 9:43:02 Error in expression <urrency = _this select 5;
_qty = _this select 6;
_clientID = owner _player;
_p>
 9:43:02   Error position: <select 6;
_clientID = owner _player;
_p>
 9:43:02   Error Zero divisor
 9:43:02 File z\addons\dayz_server\compile\server_tradeObject.sqf, line 9
 
Anyone know how to fix this?
 
Thanks
Link to comment
Share on other sites

Hi Cen, this doesn't seem to have worked. The miners on my server reckon they might be slightly more rare but nothing under 35%.....

 

I pulled remove into my mission/custom folder and changed the call in compiles.sqf to point to the customised file. I can also confirm I am only running one compiles override.

 

Any ideas.....

if((random 100) <= 4) then...

This is a random number generator, it's picking a number between 1 and 100. If the number picked is 1 2 3 or 4, it continues to THEN which is the code that generates the gem.

 

Now it's fairly well known random number generators are not perfect, but it's highly improbable your players are seeing gems drop 35% of the time. Unless, of course, you're using...random 10) <= 4 which would equate to a 40% chance the gems spawn. I have to believe your players are giving you statistics from before the change.

Link to comment
Share on other sites

 

Hi, I followed this tutorial but am getting this error message in my server rpt:

 9:43:02 "EPOCH SERVERTRADE: Player: ShermaN_TanK (76561STEAM1567) sold a ItemRuby in/at trader city Stary for <null>x <null>"
 9:43:02 Error in expression <urrency = _this select 5;
_qty = _this select 6;
_clientID = owner _player;
_p>
 9:43:02   Error position: <select 6;
_clientID = owner _player;
_p>
 9:43:02   Error Zero divisor
 9:43:02 File z\addons\dayz_server\compile\server_tradeObject.sqf, line 9
 
Anyone know how to fix this?
 
Thanks

 

 We all get this error message. It doesn't break anything. It is safe to ignore.

Link to comment
Share on other sites

When I tried this I was able to buy the item with an emerald, but it consumed the emerald out of my backpack, which is an issue.

 

I just tried it again and it doesn't remove the gem from my backpack but does give me the item.

 

not using sql, i am doing the CfgTraderCategory hpp files instead.

 

class Category_4005 {

    class AKS_74_kobra {type = "trade_weapons";buy[] = {1,"ItemRuby"};sell[] = {1,"ItemEmerald"};};

};

 

Just edit trade_weapons to trade_weapons_old

 

Wait, I don't see the Type identifier, saying whether it's an item, vehicle, or weapon.

 

Well, adding _old should work.

Link to comment
Share on other sites

if((random 100) <= 4) then...

This is a random number generator, it's picking a number between 1 and 100. If the number picked is 1 2 3 or 4, it continues to THEN which is the code that generates the gem.

 

Now it's fairly well known random number generators are not perfect, but it's highly improbable your players are seeing gems drop 35% of the time. Unless, of course, you're using...random 10) <= 4 which would equate to a 40% chance the gems spawn. I have to believe your players are giving you statistics from before the change.

 

Thanks for the reply Cen and I appreciate the explanation of the code.

EDIT Thanks for the reply Ped!

 

I'll have a go myself as it was one of my players who tested after the change but, maybe he just got lucky..! :)

Link to comment
Share on other sites

if((random 100) <= 4) then...

This is a random number generator, it's picking a number between 1 and 100. If the number picked is 1 2 3 or 4, it continues to THEN which is the code that generates the gem.

 

Now it's fairly well known random number generators are not perfect, but it's highly improbable your players are seeing gems drop 35% of the time. Unless, of course, you're using...random 10) <= 4 which would equate to a 40% chance the gems spawn. I have to believe your players are giving you statistics from before the change.

 

Hi Ped, well I went mining and with it set to random 100 <=4 I hit gems on 2 out of 3 attempts. With it set to 100 <=1 I hit gems 1 out of 3 attempts!

 

I promise this is all called properly with one override. Could it have something to do with the amount of other stuff that is dropped. For instance when mined, the vein drops other stuff too like 20 gold ore, 6 tin etc etc... Sorry for my complete lack of understanding of the code but, could that mean those items are using up numbers in that 100 already. Or, have I got you laughing now.... :)

 

Can I try random 1000?

 

Appreciate your help on this.

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
  • Advertisement
  • Discord

×
×
  • Create New...