Jump to content
  • 0

How do i add items to traders?


Ephox

Question

I want to add some building materials to all regular traders, like lumberpacks, locks, mortar and cinder blocks, the basics really. And im unsure how. Can anyone give me an explination on how the adding works? and maybe give me some codes to add the materials?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

TID is the Trader ID. It determines what menu the item will be added to. Look in the server_traders.sqf in your mission files to find the TID.

 

For example:

// Jacks Weapons
menu_Soldier_Sniper_KSVK_PMC = [
	[["Assault Rifle",485],["Light Machine Gun",486],["Pistols",489],["Shotguns and Single-shot",574],["Sniper Rifle",487],["Submachine Guns",488]],
	[],
	"friendly"
];

This is a weapons trader. Next to each menu name is the TID. So if you wanted to add an assault rifle, you'd put 485 as the TID.

Link to comment
Share on other sites

  • 0

TID is the Trader ID. It determines what menu the item will be added to. Look in the server_traders.sqf in your mission files to find the TID.

 

For example:

// Jacks Weapons
menu_Soldier_Sniper_KSVK_PMC = [
	[["Assault Rifle",485],["Light Machine Gun",486],["Pistols",489],["Shotguns and Single-shot",574],["Sniper Rifle",487],["Submachine Guns",488]],
	[],
	"friendly"
];

This is a weapons trader. Next to each menu name is the TID. So if you wanted to add an assault rifle, you'd put 485 as the TID.

Yeah, but looking at the TID for building supplies, there is more than just one TID.

Link to comment
Share on other sites

  • 0

If i have it correct, this is the code to put in when i add the item.

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

('["",3]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["",3]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,530,'trade_items'),
('["",3]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,662,'trade_items'),
('["",3]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["",3]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,530,'trade_items'),
('["",3]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,662,'trade_items'),

But i dont understand.. what is the number 3 right after the name of the item, and what is the 0 before the TID? also where can i find names of items? i want to add lumber pack, plywood pack, mortar, cinder block and a lock

Link to comment
Share on other sites

  • 0

That's explained on the page I linked before. The number after the item name is the type of item. 3 is weapons (or tools), 2 is vehicles/backpacks, and 1 is magazines (this means anything that takes up main or secondary inventory slots in the gear menu). The number before the TID determines the order it appears on the menu. 0 is low-priority, so it'll go towards the bottom. This page has many of the item names. You can also check the wiki for classnames. These are the name for those items though:

 

PartPlankPack

ParkPlywoodPack

MortarBucket

CinderBlocks

ItemComboLock

Link to comment
Share on other sites

  • 0

That's explained on the page I linked before. The number after the item name is the type of item. 3 is weapons (or tools), 2 is vehicles/backpacks, and 1 is magazines (this means anything that takes up main or secondary inventory slots in the gear menu). The number before the TID determines the order it appears on the menu. 0 is low-priority, so it'll go towards the bottom. This page has many of the item names. You can also check the wiki for classnames. These are the name for those items though:

 

PartPlankPack

ParkPlywoodPack

MortarBucket

CinderBlocks

ItemComboLock

I tried putting this in the database to the Traders_Data and i got an error saying:

  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 17

Line 17 is the last line.

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

('["PartPlankPack",1]',100,'[4,"ItemSilverBar",1]','[2,"ItemSilverBar",1]',0,508,'trade_items'),
('["PartPlankPack",1]',100,'[4,"ItemSilverBar",1]','[2,"ItemSilverBar",1]',0,530,'trade_items'),
('["PartPlankPack",1]',100,'[4,"ItemSilverBar",1]','[2,"ItemSilverBar",1]',0,662,'trade_items'),
('["ParkPlywoodPack",1]',100,'[4,"ItemSilverBar",1]','[2,"ItemSilverBar",1]',0,508,'trade_items'),
('["ParkPlywoodPack",1]',100,'[4,"ItemSilverBar",1]','[2,"ItemSilverBar",1]',0,530,'trade_items'),
('["ParkPlywoodPack",1]',100,'[4,"ItemSilverBar",1]','[2,"ItemSilverBar",1]',0,662,'trade_items'),
('["MortarBucket",1]',100,'[1,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["MortarBucket",1]',100,'[1,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,530,'trade_items'),
('["MortarBucket",1]',100,'[1,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,662,'trade_items'),
('["CinderBlocks",1]',100,'[1,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["CinderBlocks",1]',100,'[1,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,530,'trade_items'),
('["CinderBlocks",1]',100,'[1,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,662,'trade_items'),
('["ItemComboLock",1]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemComboLock",1]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,530,'trade_items'),
('["ItemComboLock",1]',100,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,662,'trade_items'),
Link to comment
Share on other sites

  • 0

whenever i try to enter mine i just get this #1136 - Column count doesn't match value count at row 3

 

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

 
 
('["ItemComboLock",1]',10,'[3,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemCorrugated",1]',10,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemPole",1]',10,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',508,'trade_items'),
('["ItemGunRackKit",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["metal_floor_kit",1]',10,'[6,"ItemGoldBar",1]','[3,"ItemGoldBar",1]',508,'trade_items'),
('["cinder_wall_kit",1]',10,'[6,"ItemGoldBar",1]','[3,"ItemGoldBar",1]',0,508,'trade_items'),
('["cinder_garage_kit",1]',10,'[6,"ItemGoldBar",1]','[3,"ItemGoldBar",1]',0,508,'trade_items'),
('["cinder_door_kit",1]',10,'[6,"ItemGoldBar",1]','[3,"ItemGoldBar",1]',508,'trade_items'),
('["metal_panel_kit",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["fuel_pump_kit",1]',10,'[6,"ItemGoldBar",1]','[4,"ItemGoldBar",1]',508,'trade_items'),
('["wooden_shed_kit",1]',10,'[8,"ItemGoldBar",1]','[4,"ItemGoldBar",1]',0,508,'trade_items'),
('["wood_shack_kit",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["rusty_gate_kit",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',508,'trade_items'),
('["outhouse_kit",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["storage_shed_kit",1]',10,'[8,"ItemGoldBar",1]','[4,"ItemGoldBar",1]',508,'trade_items'),
('["ItemWoodFloor",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemWoodFloorHalf",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemWoodFloorQuarter",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',508,'trade_items'),
('["ItemWoodStairs",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemWoodStairsSupport",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',508,'trade_items'),
('["ItemWoodLadder",1]',10,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemWoodWallWithDoor",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemWoodWallWindow",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',508,'trade_items'),
('["ItemWoodWallGarageDoor",1]',10,'[4,"ItemGoldBar",1]','[2,"ItemGoldBar",1]',0,508,'trade_items'),
('["PartPlankPack",1]',10,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',508,'trade_items'),
('["MortarBucket",1]',10,'[3,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["CinderBlocks",1]',10,'[3,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',508,'trade_items'),
('["PartPlywoodPack",1]',10,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,508,'trade_items'),
('["ItemSledge",1]',10,'[2,"ItemGoldBar",1]','[1,"ItemGoldBar",1]',0,510,'trade_items')
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...