Jump to content

[Release] Adding higher end currency to traders. v1.1 -working


NAIL

Recommended Posts

woah! i found a serous bug! i have it so you can buy a BTR90 for 6 rubys, and when someone buys it the rubys doesn't get removed from your inventory. this means that you can buy vehicles over and over again..

 

 

You need to add "_old" to the end of your afile in the traders_data for the items you want sold with custom currency.

 

for vehicles the afile would have to be "trade_any_vehicle_old"

Link to comment
Share on other sites

Hey, i can't seem to get this to work.. :( the trade materials menu doesn't show up. maybe i did something wrong? here is the part i edited in my fn_selfActions:

 

 

              
                // Static Menu
                {
                    //diag_log format["DEBUG TRADER: %1", _x];
                    _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
                    s_player_parts set [count s_player_parts,_buy];
                
                } forEach (_traderMenu select 1);
                // Database menu
                _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
                s_player_parts set [count s_player_parts,_buy];

                // Add static metals trader options under sub menu
                _metals_trader = player addAction [localize "STR_EPOCH_PLAYER_301", "init\trade_metals.sqf",["na"], 0, true, false, "",""];
                s_player_parts set [count s_player_parts,_metals_trader];
            };
            s_player_parts_crtl = 1;
            
        };
    } else {
        {player removeAction _x} forEach s_player_parts;s_player_parts = [];
        s_player_parts_crtl = -1;
    };
 

Link to comment
Share on other sites

Hey, i can't seem to get this to work.. :( the trade materials menu doesn't show up. maybe i did something wrong? here is the part i edited in my fn_selfActions:

 

Only thing I can think of is maybe the string is missing from the vanilia code.  try replacing 

_metals_trader = player addAction [localize "STR_EPOCH_PLAYER_301", "init\trade_metals.sqf",["na"], 0, true, false, "",""];

with 

_metals_trader = player addAction ["Trade Gems", "scripts\trade_metals.sqf",["na"], 0, true, false, "",""];

sorry about the untested code, I was waiting for my natural server restart in 30 minutes.

Link to comment
Share on other sites

@Nail: thank you for your first post. It worked easily on my Napf server and it's injected a whole new paradigm to the server because players have something to 'quest' towards. Thank you for detailed instructions and sharing.

Link to comment
Share on other sites

I dont need the conversion stuff as i created a Gem Trader Seperately. HOWEVER that said the _old does not work. It now makes it so you must have the currency but it just hangs there. Puts you in a permanent Trade. You can walk around and such but until you relog you can not trade again. Anyone know how to get around this?

Link to comment
Share on other sites

Gonna try this _old for the stuff that cost rubys on my server and see if I get this permanent trade problem...atm without _old it does not take the rubys out of your inventory and everything that cost rubys you can buy without any rubys in your inventory.

 

 

 

Edit:   _old worked fine for me. I added  new categories to current traders for trading briefcases for rubys then added end game vehicles/weapons to hero, bandit, and aircraft traders that cost rubys. Everything has work fine. Atleast after I added  _old to the afile in the database all is good.

 

Also I placed a trade for the rest of the gems for briefs like this

//Hero Trader
menu_Functionary1 = [
	[["Ammunition",478],["Clothes",476],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",477]],
	[["ItemBriefcase100oz","ItemAmethyst",1,1,"buy","Amethyst","Brief case (100oz)",101],
	["ItemBriefcase100oz","ItemCitrine",1,1,"buy","Citrine","Brief case (100oz)",101],
	["ItemBriefcase100oz","ItemEmerald",1,1,"buy","Emerald","Brief case (100oz)",101],
	["ItemBriefcase100oz","ItemObsidian",1,1,"buy","Obsidian","Brief case (100oz)",101],
	["ItemBriefcase100oz","ItemSapphire",1,1,"buy","Sapphire","Brief case (100oz)",101],	
	["ItemBriefcase100oz","ItemTopaz",1,1,"buy","Topaz","Brief case (100oz)",101]],
	"hero"
];
Link to comment
Share on other sites

I dont need the conversion stuff as i created a Gem Trader Seperately. HOWEVER that said the _old does not work. It now makes it so you must have the currency but it just hangs there. Puts you in a permanent Trade. You can walk around and such but until you relog you can not trade again. Anyone know how to get around this?

I made a ruby trader rather than add it in self actions and use _old extension and everything works fine so .....

Not sure where your problem is but It does work by just adding new traders. 

Link to comment
Share on other sites

Yes you could use trade ruby for briefcases. Also you could add "Gems" category to trader. And trade Gems for Briefcase in normal trading. But be carefull, Veins drop Ruby as well, so your player could find a jackpot in a mine.

 

On my server, AI missions drop Topaz, and 5 topaz could trade for Ruby. And for ruby you could get premium vehicles.

 

Also ItemTopaz is used for Rearm vehicles at service point. And for Topaz you could buy m107 bullets at traders.

 

I only use the trick of "_old" category names.

Link to comment
Share on other sites

Yes you could use trade ruby for briefcases. Also you could add "Gems" category to trader. And trade Gems for Briefcase in normal trading. But be carefull, Veins drop Ruby as well, so your player could find a jackpot in a mine.

 

On my server, AI missions drop Topaz, and 5 topaz could trade for Ruby. And for ruby you could get premium vehicles.

 

Also ItemTopaz is used for Rearm vehicles at service point. And for Topaz you could buy m107 bullets at traders.

 

I only use the trick of "_old" category names.

Can you tell me how to add a "gems" category to a trader?

Link to comment
Share on other sites

Can you tell me how to add a "gems" category to a trader?

The Easyst was use the TraderConfigTool - what is provided by the Official Server  package. ( Php tool configure traders. )

 

Or harder way, check your database look for : trader_tids -  add new line to like 

 

INSERT INTO `trader_tids` (`id`, `name`, `trader`) VALUES (NULL, 'Gems', '168');

 

 trader means the ID of the trader from the Server_traders table. ( be the skin of the trader you could identify your traders. ) 

 

After insert Check the traders_tids ID what have you created right now. 

 

Then modify your server_traders.sqf in your mission folder:

Like:

// Neutral Building/Parts 168
menu_Woodlander3 = [
	[["Building Supplies",662],["Toolbelt Items",663],["Vehicle Parts",664],["Gems",704]],
	[],
	"neutral"
];

menu_Woodlander3 means show trader menu if you looking a body which wear Woodlander3 skin. Even if an AI mission use this clothing.

 

Repack your mission.pbo then now you have new category at the Woodlander3 trader, in this case.

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
×
×
  • Create New...