Jump to content

[Tutorial] Overpoch - Custom traders, all weapons/ammo/vehicles in menus


Recommended Posts

I'm trying to edit the table trader_items, and if I try to add an item which is already in the list - it gives me the following error;

1062 - Duplicate entry '30Rnd_556x45_Stanag-1' for key 'itemsntypes'

Edit:

 

Also, I can't seem to get my traders to work. They're spawned and I can interact with them just fine, but they don't have any categories. I've double-checked the database to make sure they're linking to the correct TID.

I also added the correct TID in the server_traders.sqf. Any ideas?

What version of epoch are you running? the trader_items table isn't used in 1.0.5.1

 

All you need to do is add the category to Trader_tids and make sure the item is added in the trader_data table.

 

You can actually use this excel sheet I made to easily add items to the trader:

 

you should post your missions.sqf , and server_trader file.

Link to comment
Share on other sites

Thanks for the clarification, RebelDexter! Will give the spreadsheet you made a go later.

First I added this into trader_tids table;
 

693    Overpoch Weapons    177
694    Overpoch Ammo       178

And then I tried adding those 2 items to the new traders, simply to test them out;
 

8068    ["FHQ_ACR_SNW_CCO",1]    1000    [1,"ItemGoldBar10oz",1]    [4,"ItemGoldBar",1]    0    693    trade_weapons
8069    ["FHQ_rem_30Rnd_680x43_ACR",1]    1000    [2,"ItemSilverBar",1]    [1,"ItemSilverBar",1]    0    694    trade_items

And this is what I added to server_traders.sqf;

Obviously I added them to the end of the serverTraders array as well!
 

// Overpoch Weapons
Soldier_Bodyguard_AA12_PMC = [
	[["Overpoch Weapons",693]],
	[],
	"neutral"
];
//Overpoch Ammo
Soldier_MG_PMC = [
	[["Overpoch Ammo",694]],
	[],
	"neutral"
];

Any ideas what I might have missed?

Edit:

 

It might be worth to mention that the traders spawn and I can indeed open the menu, but there are no categories to select items/weapons from.

Link to comment
Share on other sites

Thanks for the clarification, RebelDexter! Will give the spreadsheet you made a go later.

First I added this into trader_tids table;

 

693    Overpoch Weapons    177
694    Overpoch Ammo       178

And then I tried adding those 2 items to the new traders, simply to test them out;

 

8068    ["FHQ_ACR_SNW_CCO",1]    1000    [1,"ItemGoldBar10oz",1]    [4,"ItemGoldBar",1]    0    693    trade_weapons
8069    ["FHQ_rem_30Rnd_680x43_ACR",1]    1000    [2,"ItemSilverBar",1]    [1,"ItemSilverBar",1]    0    694    trade_items

And this is what I added to server_traders.sqf;

Obviously I added them to the end of the serverTraders array as well!

 

// Overpoch Weapons
Soldier_Bodyguard_AA12_PMC = [
	[["Overpoch Weapons",693]],
	[],
	"neutral"
];
//Overpoch Ammo
Soldier_MG_PMC = [
	[["Overpoch Ammo",694]],
	[],
	"neutral"
];

Any ideas what I might have missed?

Edit:

 

It might be worth to mention that the traders spawn and I can indeed open the menu, but there are no categories to select items/weapons from.

I only see one issue with this data,  

 

This is what your statements should look like, I put my change in big red, the 3:

8068 ["FHQ_ACR_SNW_CCO",3] 1000 [1,"ItemGoldBar10oz",1] [4,"ItemGoldBar",1] 0 693 trade_weapons

8069 ["FHQ_rem_30Rnd_680x43_ACR",1] 1000 [2,"ItemSilverBar",1] [1,"ItemSilverBar",1] 0 694 trade_items

 

Also, did you add the trader to the table that lists their skin? I can't remember for the life of me the name, but it is where you list what skin they have and their trader name.

Link to comment
Share on other sites

Ah, right. Good spot :P

 

And yeah, they're added, otherwise they wouldn't spawn...?

177    Soldier_Bodyguard_AA12_PMC    24    neutral    (Empty)    Overpoch Weapons
178    Soldier_MG_PMC    24    neutral    (Empty)    Overpoch Ammo

Edit:

Changed the type to weapon(3) but no categories still...

Link to comment
Share on other sites

Ah, right. Good spot :P

 

And yeah, they're added, otherwise they wouldn't spawn...?

177    Soldier_Bodyguard_AA12_PMC    24    neutral    (Empty)    Overpoch Weapons
178    Soldier_MG_PMC    24    neutral    (Empty)    Overpoch Ammo

Edit:

Changed the type to weapon(3) but no categories still...

Try adding in a category that already exists to the trader to attempt to debug what the issue is. Add like the blackmarket weapon to 

 

// Overpoch Weapons

Soldier_Bodyguard_AA12_PMC = [

    [["Overpoch Weapons",693]],

    [],

    "neutral"

];

 

to see if it's  the actual trader or the category that's causing the issue.

Link to comment
Share on other sites

Cheers for the suggestion, tried it but to no success. Any other ideas? :(

Yeah, check for typos, if you don't see anything I would start completely from scratch.

 

Delete everything you have done and try again, or put copies/screenshots of your files so we can see exactly what is in your files.

 

I'd double check your mission.sqf as well make sure everything looks good there, seems like something is wrong in the server_traders file.

Link to comment
Share on other sites

Managed to solve it, it was indeed in server_traders.sqf. I had forgotten to add the menu_ prefix;

 

// Overpoch Weapons
menu_Soldier_Bodyguard_AA12_PMC = [
	[["Overpoch Weapons",693]],
	[],
	"neutral"
];
//Overpoch Ammo
menu_Soldier_MG_PMC = [
	[["Overpoch Ammo",694],["Chem-lites/Flares",669]],
	[],
	"neutral"
];
Link to comment
Share on other sites

INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7596, '["RH_massdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7595, '["RH_massdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7594, '["RH_massd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7593, '["RH_maseotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7592, '["RH_masbsdeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7591, '["RH_masbsdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7590, '["RH_masbsdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7589, '["RH_masbsd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7588, '["RH_masbeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7587, '["RH_masbaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7586, '["RH_masbacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7585, '["RH_masb",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7584, '["RH_masaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7583, '["RH_masacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7582, '["RH_mas",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');

 
Thats my data base entries. Basically im trying to add them to the Bandit Trader cause im changing that to an overpoch only trader.
Heres my server traders 

// Overpoch Vendor
menu_GUE_Soldier_MG = [
[["Masada Variants",577],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627]],
[],
"neutral"
];

Obviously im just trying to change one category at a time, so masada variants is the old ammunation. But the weapons dont show.
 
Hope this is what you meant :)
Link to comment
Share on other sites

 

INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7596, '["RH_massdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7595, '["RH_massdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7594, '["RH_massd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7593, '["RH_maseotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7592, '["RH_masbsdeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7591, '["RH_masbsdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7590, '["RH_masbsdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7589, '["RH_masbsd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7588, '["RH_masbeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7587, '["RH_masbaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7586, '["RH_masbacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7585, '["RH_masb",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7584, '["RH_masaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7583, '["RH_masacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');
INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES (7582, '["RH_mas",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]', 0, 577, 'trade_weapons');

 
Thats my data base entries. Basically im trying to add them to the Bandit Trader cause im changing that to an overpoch only trader.
Heres my server traders 

// Overpoch Vendor
menu_GUE_Soldier_MG = [
[["Masada Variants",577],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627]],
[],
"neutral"
];

Obviously im just trying to change one category at a time, so masada variants is the old ammunation. But the weapons dont show.
 
Hope this is what you meant :)

 

Did you create the Masada Variant Trader TID?

Link to comment
Share on other sites

1.0.5.1 and Overwatch obviously :)

Alright it seems like you are using the wrong SQL statements to insert the weapons...

 

Try using this:

INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES
('["RH_massdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_massdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_massd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_maseotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsdeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masb",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_mas",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons')
Also, I created an Excel sheet that will create these statements automatically for you, here a link to the forum post for that:

Link to comment
Share on other sites

Its saying i have a syntax error in that query. This is really annoying the crap out of me :P.

 

Must carry on!!

 

Also havent i got to put " before and after the gold?

What are the columns of your trader_data table?

 

AND YES there should be ""

INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES
('["RH_massdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_massdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_massd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_maseotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsdeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsdaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsdacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbsd",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbeotech",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masbaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masb",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masaim",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_masacog",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons'),
('["RH_mas",3]', 250, '[4,"ItemGoldBar10oz",1]', '[2,"ItemGoldBar10oz",1]',0, 577, 'trade_weapons')

Link to comment
Share on other sites

id item qty buy sell order tid afile

 

Ive just added them with your coding and still nothing. Weird thing is i deleted the ammunation, well i thought i did and its back??

 

Weird stuff :P

Your database is sent up differently from mine, which host do you use?

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...