Draay Posted March 12, 2015 Report Share Posted March 12, 2015 Hey there, So basically to save time adding a bunch of traders to every trade zone, i was wondering if it's possible to create something like "trade metals" where it gives you the option to trade any gold you have for coins? Not sure if it's possible but would be great to replace the trade metals for it. Anyone know how to go about doing this? Thanks in advance, Dray Link to comment Share on other sites More sharing options...
ElDubya Posted March 12, 2015 Report Share Posted March 12, 2015 More information needed. You can just create a "Trade Gold" option under any trader? class ItemBriefcase100oz { type = "trade_items"; buy[] ={100000,"Coins"}; sell[] ={100000,"Coins"}; }; class ItemGoldBar { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemGoldBar10oz { type = "trade_items"; buy[] ={10000,"Coins"}; sell[] ={10000,"Coins"}; }; class ItemSilverBar { type = "trade_items"; buy[] ={10,"Coins"}; sell[] ={10,"Coins"}; }; class ItemSilverBar10oz { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemTinBar { type = "trade_items"; buy[] ={20,"Coins"}; sell[] ={20,"Coins"}; }; Link to comment Share on other sites More sharing options...
Draay Posted March 13, 2015 Author Report Share Posted March 13, 2015 Yeah i suppose i could do that, it's just adding it to every single trader, but it's easier than placing more traders down. Thanks anyhow :D I wanted to edit the "trade_metals.sqf" file to convert bars to coins intead of what it currently does: private ["_buy","_metals_conversion","_cancel"]; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; {player removeAction _x} forEach s_player_parts;s_player_parts = []; s_player_parts_crtl = 1; _metals_conversion = [ ["ItemTinBar","ItemAluminumBar",1,2,"buy","Aluminum","Tin",108], ["ItemAluminumBar","ItemTinBar",2,1,"buy","Tin","Aluminum",107], ["ItemCopperBar","ItemTinBar",1,2,"buy","Tin","Copper",106], ["ItemTinBar","ItemCopperBar",2,1,"buy","Copper","Tin",105], ["ItemSilverBar","ItemCopperBar10oz",1,3,"buy","10oz Copper","Silver",104], ["ItemCopperBar10oz","ItemSilverBar",3,1,"buy","Silver","10oz Copper",103], ["ItemGoldBar","ItemSilverBar10oz",1,3,"buy","10oz Silver","Gold",102], ["ItemSilverBar10oz","ItemGoldBar",3,1,"buy","Gold","10oz Silver",101], ["ItemBriefcase100oz","ItemGoldBar10oz",1,12,"buy","10oz Gold","Full Briefcase",99] ]; { _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 _metals_conversion; _cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""]; s_player_parts set [count s_player_parts,_cancel]; DZE_ActionInProgress = false; Link to comment Share on other sites More sharing options...
ElDubya Posted March 13, 2015 Report Share Posted March 13, 2015 Are you using config traders? That is honestly the easiest way. Link to comment Share on other sites More sharing options...
Draay Posted March 13, 2015 Author Report Share Posted March 13, 2015 I am indeed. Link to comment Share on other sites More sharing options...
illclint Posted March 13, 2015 Report Share Posted March 13, 2015 Just find your server traders script in the root of your mission folder (assuming this is where it's called in your setup) and add the category to each trader. For example: This dude doesn't buy metals: ]; menu_CIV_EuroMan02_EP1 = [ [["Assault Rifle Ammo",609],["Light Machine Gun Ammo",610],["Pistol Ammo",611],["Shotguns And Single Shot Ammo",613],["Sniper Rifle Ammo",614],["Submachine Gun Ammo",612],["Overwatch Pistol Ammo",1012],["Overwatch Gun Ammo",1013]], [], "neutral" ]; Now he does! ]; menu_CIV_EuroMan02_EP1 = [ [["Assault Rifle Ammo",609],["Light Machine Gun Ammo",610],["Pistol Ammo",611],["Shotguns And Single Shot Ammo",613],["Sniper Rifle Ammo",614],["Submachine Gun Ammo",612],["Overwatch Pistol Ammo",1012],["Overwatch Gun Ammo",1013],["Metals",700]], [], "neutral" ]; Your setup might be different, but it's all the same. Edit: I realized you don't even have the trade metals for coins. Which SC script are you running? Link to comment Share on other sites More sharing options...
illclint Posted March 13, 2015 Report Share Posted March 13, 2015 Alright here's my metals.hpp class Category_700 { class ItemBriefcase100oz { type = "trade_items"; buy[] ={100000,"Coins"}; sell[] ={100000,"Coins"}; }; class ItemGoldBar { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemGoldBar10oz { type = "trade_items"; buy[] ={10000,"Coins"}; sell[] ={10000,"Coins"}; }; class ItemSilverBar { type = "trade_items"; buy[] ={10,"Coins"}; sell[] ={10,"Coins"}; }; class ItemSilverBar10oz { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemCopperBar10oz { type = "trade_items"; buy[] ={1,"Coins"}; sell[] ={1,"Coins"}; }; class ItemTinBar { type = "trade_items"; buy[] ={2,"Coins"}; sell[] ={2,"Coins"}; }; class ItemAluminumBar { type = "trade_items"; buy[] ={2,"Coins"}; sell[] ={2,"Coins"}; }; class ItemObsidian{ type = "trade_items"; buy[] ={100000,"Coins"}; sell[] ={100000,"Coins"}; }; class PartOre { type = "trade_items"; buy[] ={20,"Coins"}; sell[] ={20,"Coins"}; }; class PartOreSilver { type = "trade_items"; buy[] ={30,"Coins"}; sell[] ={30,"Coins"}; }; class PartOreGold { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; }; Save that file as metals.hpp, include it in your trader defines and add the category to your traders script. Profit. Link to comment Share on other sites More sharing options...
Draay Posted March 15, 2015 Author Report Share Posted March 15, 2015 @illclint: Yeah that's what i have right now, i appreciate you putting effort into your posts. What i was looking for was to make the "trade metals" option trade metals for coins and the other way around. Instead of metals for metals. It's a useless option because we're running the coin system now, and it saves me adding metal-to-coin traders since trade metals is implemented to every trader. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now