Jump to content
  • 0

Adding Things To The Traders


SilverWind252

Question

3 answers to this question

Recommended Posts

  • 0

Hi;

 

 

 1- Look at your mission.pbo/server_traders.sqf

You will found a list with all your server traders and their TIDS.

// Bandit Trader
menu_RUS_Soldier2 = [
[["Ammunition",577],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627]],
[],
"hostile"
];
( for exemple Helicopter Armed TIDS is 512 ... Keep this number
 
2- Go to your data base and open your trader_tiems table...
click on insert and complete the box like this for adding UH1Y with ammo at each restart:
ID :  let it blank 
Class Name : UH1Y_DZ
Type : 2
Group : Helicopter Armed
Afile : trade_any_vehicle
 
Execute
 
3- Open your trader_data table and click on insert.
Complete the box like this:
 
ID: leave it blank
Item : ["UH1Y_DZ",2]
Qty : 30
Buy : [6,"ItemBriefcase100oz",1]
Sell :  [1,"ItemBriefcase100oz",1]
order : 0
TID : 512
afile : trade_any_vehicle
 
Execute.
 
Now close your data base and restart your server.
The bandit trader now sell a UH1Y with full ammo at restart.
 
This is how to add any vehicle to any trader. You can do the same path to add other item to the right trader but in this case you will need to modify some stuff like the afile, the tid, etc...
 
UH1Y_DZE = vehicle without ammo at restart
UH1Y_DZ   = vehicle with ammo at restart.
Link to comment
Share on other sites

  • 0

Hey der guise! I was hoping one of you could give me a detailed walkthrough on how to add custom vehicles and weapons with their ammo to the traders, I am COMPLETELY new to this so don't throw weird commands at me without explaining them completely please :P Thanks!!

 Ok I'll try and make this an simple explanation.

 

In your mission folder you will see a script called server_traders.sqf. This is what you'll need to use as reference for adding items to the proper traders. Here is the snippet for Hero Trader so you can see what we're looking at.

// Hero Vendor
menu_Tanny_PMC = [
    [["Ammunition",478],["Clothes",476],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",477]],
    [],
    "hero"
];

It lists all the menus that will show up for the Hero Trader, and each has a # ID which will be required when adding your new items into the database. Now for adding new items to your database, simply create a notepad document, and save it as trader_data.sql

 

Inside this you'll need to add all the items you want individually for each trader for the appropriate menu. Here is an example of what it'll look like.

 

 

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

('["ItemKiloHemp",1]', 50, '[3,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]',0, 541, 'trade_items'),

('["ItemKiloHemp",1]', 50, '[3,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]',0, 665, 'trade_items'),

('["ItemKiloHemp",1]', 50, '[3,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]',0, 670, 'trade_items');

 

Purple

This is the item ID

 

Red

This is the item type, types are as follows.

1 = Items

2 = Vehicles/Backpacks

3 = Weapons

If you're unsure what type an item should be, browse your trader_data in database for similar items.

 

Green

This is the amount of the item a trader will carry.

 

Blue

This is how much an item costs to buy [Amount,"CurrencyItemType",1] from what I can tell the 1 at the end of it never changes.

 

Orange

This is how much an item will sell for (how much you make selling it) Works the same as buying.

 

Pink

This is the trader menu id, as seen in the server_traders.sqf

 

Cyan

This is the trade type. Trade types are as follows.

trade_items

trade_weapons

trade_any_vehicle

trade_backpacks

 

One more thing to note, when you look at the example for the sql file I made, you'll see each line ends with ")," and the last line ends with ");". Make sure that only the last line ends with the ";" or you may encounter issues. Once you have everything added to your custom sql file, go into your database and import it.

 

Hope that helps.

Link to comment
Share on other sites

  • 0

I'm trying to add a black market trader to Taviana.

I have managed to create the vendor's kiosk inside the neutral vendor city in Lypestok.

And the trader appears, along with all the props I put in.

 

So, I'm ready to setup the menu, and the categories and black market weapons and black market ammo.

 

 

My question is this, I added him to the server_traders.sqf as such: (I'm assuming that the 452 and 453 are menus)

 

//Black Market Vendor
menu_Soldier_GL_M16A2_PMC = [
    [["Black Market Weapons",452],["Black Market Ammo",453]],
    [],
    "neutral"
];

 

I'm stuck here. Don't know how to proceed. Will this only show partial list of weapons and ammo? Since the database has
other weapons and other ammo (for black market) with more id numbers than just the two I show here; 452 and 453.

 

And my database already has weapons (which I did not add, but they were there) for the black market trader.

In the database, under trader_ids is the following:

 

id          name                                  trader

453       black market ammo            140

460       black market ammo            142

527       black market ammo            154

456       black market ammo            141

 

452       black market weapons       140

526       black market weapons       154

455       black market weapons       141

459       black market weapons       142

 

Generally, black market traders only have 3 categories in the menus, black market weapons, black market ammo, and explosives,

unlike the other vendors that have assault rifles, sniper rifles, etc.

 

I copied the code from an existing vendor under neutral vendors in the server_traders.sqf

Of course, the skin, or model I used, was already setup in the database for use as a black market vendor.

 

I'm really new at this, and am surprised I even got this far; don't want to screw it up now.

 

[Edited] It would appear that I have to go into the database, and change the460, 527, and 456 to all be 453.
And the 526, 455. and 459 to all be 452.

 

:unsure:

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

×
×
  • Create New...