Jump to content
  • 0

Help needed changing trader prices via SQL.


withyourbarehands

Question

Hi folks! New to the forum, yet running an Napf Overpoch server with survival servers as my host.

 

I was just wonder wondering if anyone could give me a brief explanation of how to enter queries to activate buy/sell price changes for traders in the database. I already know how to find tid's and such to locate items and traders properly. I also know that all the changes are made in traders_data. I just have the understanding that in order to activate the changes made, there has to be an UPDATE query.

 

There was another forum post that I had seen, :( ), that explained what needed to be put in the query but I'm dumb and need an explanation that shows what I need to do to change the prices of sandbags, specifically from 4 gold bars to buy, to 4 silver bars to buy.

 

Any help would be greatly appreciated! Thanks for having patience! I'm new to scripting and SQL databases!

 

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Once you make a change to anything in the database it shows the sql. (mine does anyway)

Basically you would copy and paste the sql and edit the classnames TIDs and prices.

But, once everything is in the DB, it's easiest just to change it from the DB.

But if you add new items its easiest to edit prices prior to loading them in.

I totally screwed my self when i didnt change the prices for overpoch items in the SQL

and spent several hours changing 100s of guns and ammo prices.

 

As far as the changes not saving when you do it manually... i would say thats a customer service call..

Even if you messed up the format for the price it should just not work vs having same price.

Link to comment
Share on other sites

  • 0

 

As far as the changes not saving when you do it manually... i would say thats a customer service call..

Even if you messed up the format for the price it should just not work vs having same price.

 

Yeah, when using the phpMyAdmin tool, I have been finding the building supply tid for the sandbags and changing the the buy price in that row, then restarting and the price stays the same. Do you think it has something to with DZEtraderconfig being true? Meaning it's not taking the info from the SQL but rather the config files for the traders instead? What do you think? Please tell me when I start sounding like a dumbass and i'll stop. Thanks

Link to comment
Share on other sites

  • 0

OK SQL

all item prices are in the Traders_Data or traders_data Table  { it does make a difference if trying to use someone elses sql file to import }

Click on Traders_Data table you will see all items in game.

Here are my backpacks from traders_data.sql i built to insert/import into my traders_data table Note: before you can import you have to turnicate the table ( empty the table dont delete it )

 

--
-- Daten für Tabelle `traders_data`
--

INSERT INTO `traders_data` (`id`, `item`, `qty`, `buy`, `sell`, `order`, `tid`, `afile`) VALUES
(1, '["DZ_Czech_Vest_Puch",2]', 250, '[2,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(2, '["DZ_Czech_Vest_Puch",2]', 250, '[2,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(3, '["DZ_Czech_Vest_Puch",2]', 250, '[2,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(4, '["DZ_Czech_Vest_Puch",2]', 250, '[1,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(5, '["DZ_Czech_Vest_Puch",2]', 250, '[1,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(6, '["DZ_Assault_Pack_EP1",2]', 250, '[2,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(7, '["DZ_Assault_Pack_EP1",2]', 250, '[2,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(8, '["DZ_Assault_Pack_EP1",2]', 250, '[2,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(9, '["DZ_Assault_Pack_EP1",2]', 250, '[1,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(10, '["DZ_Assault_Pack_EP1",2]', 250, '[1,"ItemGoldBar",1]', '[1,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(11, '["DZ_TerminalPack_EP1",2]', 250, '[3,"ItemGoldBar",1]', '[2,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(12, '["DZ_TerminalPack_EP1",2]', 250, '[3,"ItemGoldBar",1]', '[2,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(13, '["DZ_TerminalPack_EP1",2]', 250, '[3,"ItemGoldBar",1]', '[2,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(14, '["DZ_TerminalPack_EP1",2]', 250, '[2,"ItemGoldBar",1]', '[2,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(15, '["DZ_TerminalPack_EP1",2]', 250, '[2,"ItemGoldBar",1]', '[2,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(16, '["DZ_ALICE_Pack_EP1",2]', 250, '[4,"ItemGoldBar",1]', '[3,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(17, '["DZ_ALICE_Pack_EP1",2]', 250, '[4,"ItemGoldBar",1]', '[3,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(18, '["DZ_ALICE_Pack_EP1",2]', 250, '[4,"ItemGoldBar",1]', '[3,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(19, '["DZ_ALICE_Pack_EP1",2]', 250, '[3,"ItemGoldBar",1]', '[3,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(20, '["DZ_ALICE_Pack_EP1",2]', 250, '[3,"ItemGoldBar",1]', '[3,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(21, '["DZ_TK_Assault_Pack_EP1",2]', 250, '[5,"ItemGoldBar",1]', '[4,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(22, '["DZ_TK_Assault_Pack_EP1",2]', 250, '[5,"ItemGoldBar",1]', '[4,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(23, '["DZ_TK_Assault_Pack_EP1",2]', 250, '[5,"ItemGoldBar",1]', '[4,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(24, '["DZ_TK_Assault_Pack_EP1",2]', 250, '[4,"ItemGoldBar",1]', '[4,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(25, '["DZ_TK_Assault_Pack_EP1",2]', 250, '[4,"ItemGoldBar",1]', '[4,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(26, '["DZ_CompactPack_EP1",2]', 250, '[6,"ItemGoldBar",1]', '[5,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(27, '["DZ_CompactPack_EP1",2]', 250, '[6,"ItemGoldBar",1]', '[5,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(28, '["DZ_CompactPack_EP1",2]', 250, '[6,"ItemGoldBar",1]', '[5,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(29, '["DZ_CompactPack_EP1",2]', 250, '[5,"ItemGoldBar",1]', '[5,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(30, '["DZ_CompactPack_EP1",2]', 250, '[5,"ItemGoldBar",1]', '[5,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(31, '["DZ_British_ACU",2]', 250, '[7,"ItemGoldBar",1]', '[6,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(32, '["DZ_British_ACU",2]', 250, '[7,"ItemGoldBar",1]', '[6,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(33, '["DZ_British_ACU",2]', 250, '[7,"ItemGoldBar",1]', '[6,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(34, '["DZ_British_ACU",2]', 250, '[6,"ItemGoldBar",1]', '[6,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(35, '["DZ_British_ACU",2]', 250, '[6,"ItemGoldBar",1]', '[6,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(36, '["DZ_GunBag_EP1",2]', 250, '[8,"ItemGoldBar",1]', '[7,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(37, '["DZ_GunBag_EP1",2]', 250, '[8,"ItemGoldBar",1]', '[7,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(38, '["DZ_GunBag_EP1",2]', 250, '[8,"ItemGoldBar",1]', '[7,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(39, '["DZ_GunBag_EP1",2]', 250, '[7,"ItemGoldBar",1]', '[7,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(40, '["DZ_GunBag_EP1",2]', 250, '[7,"ItemGoldBar",1]', '[7,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(41, '["DZ_CivilBackpack_EP1",2]', 250, '[9,"ItemGoldBar",1]', '[8,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(42, '["DZ_CivilBackpack_EP1",2]', 250, '[9,"ItemGoldBar",1]', '[8,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(43, '["DZ_CivilBackpack_EP1",2]', 250, '[9,"ItemGoldBar",1]', '[8,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(44, '["DZ_CivilBackpack_EP1",2]', 250, '[8,"ItemGoldBar",1]', '[8,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(45, '["DZ_CivilBackpack_EP1",2]', 250, '[8,"ItemGoldBar",1]', '[8,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(46, '["DZ_Backpack_EP1",2]', 250, '[1,"ItemGoldBar10oz",1]', '[9,"ItemGoldBar",1]', 0, 496, 'trade_backpacks'),
(47, '["DZ_Backpack_EP1",2]', 250, '[1,"ItemGoldBar10oz",1]', '[9,"ItemGoldBar",1]', 0, 538, 'trade_backpacks'),
(48, '["DZ_Backpack_EP1",2]', 250, '[1,"ItemGoldBar10oz",1]', '[9,"ItemGoldBar",1]', 0, 632, 'trade_backpacks'),
(49, '["DZ_Backpack_EP1",2]', 250, '[9,"ItemGoldBar",1]', '[9,"ItemGoldBar",1]', 0, 685, 'trade_backpacks'),
(50, '["DZ_Backpack_EP1",2]', 250, '[9,"ItemGoldBar",1]', '[9,"ItemGoldBar",1]', 0, 688, 'trade_backpacks'),
(51, '["DZ_LargeGunBag_EP1",2]', 250, '[2,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]', 0, 496, 'trade_backpacks'),
(52, '["DZ_LargeGunBag_EP1",2]', 250, '[2,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]', 0, 538, 'trade_backpacks'),
(53, '["DZ_LargeGunBag_EP1",2]', 250, '[2,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]', 0, 632, 'trade_backpacks'),
(54, '["DZ_LargeGunBag_EP1",2]', 250, '[1,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]', 0, 685, 'trade_backpacks'),
(55, '["DZ_LargeGunBag_EP1",2]', 250, '[1,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]', 0, 688, 'trade_backpacks');
 

If you have DZE_ConfigTrader = true;  {in your init.sqf}

AND

#include "CfgServerTrader\cfgServerTrader.hpp"  {in your description.ext:}

IT DOES NOT USE SQL TRADERS ANYMORE

 

You get the cfg trader files from DayZ_Epoch_B.PBO inside should be a FOLDER called CfgServerTrader

Copy CfgServerTrader FOLDER into your mission files/pbo

 

Inside CfgServerTrader FOLDER you will have

Category FOLDER

AND

cfgServerTrader.hpp

 

inside (Category) FOLDER are where the files are that you need to edit with notepad++ to change prices

like here is the first file within

 

BanditAmmunition.hpp {open with notepad++} class Category_577 = 577 is the trader's menu Tid Obvious that the "Bandit Ammo" menu tid number is 577 This is set in server_traders.sqf in you mission files/pbo

 

class Category_577 {
    class 30Rnd_556x45_StanagSD {
        type = "trade_items";
        buy[] = {4,"ItemSilverBar10oz"};
        sell[] = {2,"ItemSilverBar10oz"};
    };
    class 5Rnd_86x70_L115A1 {
        type = "trade_items";
        buy[] = {4,"ItemGoldBar"};
        sell[] = {2,"ItemGoldBar"};
    };
    class 100Rnd_762x51_M240 {
        type = "trade_items";
        buy[] = {2,"ItemGoldBar"};
        sell[] = {1,"ItemGoldBar"};
    };
    class 20Rnd_762x51_FNFAL {
        type = "trade_items";
        buy[] = {4,"ItemSilverBar10oz"};
        sell[] = {2,"ItemSilverBar10oz"};
    };
    class 20Rnd_762x51_SB_SCAR {
        type = "trade_items";
        buy[] = {1,"ItemGoldBar"};
        sell[] = {5,"ItemSilverBar10oz"};
    };
};
 

Inside server_traders.sqf

 

/* BANDIT TRADER */
menu_GER_Soldier_EP1 = [
    [["Ammunition",577],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627],["Money",700]],
    [],
    "hostile"
];

 

Easy to change prices and add extra class

This is the same File but from the Zupa Single Coin mod have a look

 

class Category_577 {
    class 30Rnd_556x45_StanagSD {
        type = "trade_items";
        buy[] ={400,"Coins"};
        sell[] ={200,"Coins"};
    };
    class 5Rnd_86x70_L115A1 {
        type = "trade_items";
        buy[] ={4000,"Coins"};
        sell[] ={2000,"Coins"};
    };
    class 100Rnd_762x51_M240 {
        type = "trade_items";
        buy[] ={2000,"Coins"};
        sell[] ={1000,"Coins"};
    };
    class 20Rnd_762x51_FNFAL {
        type = "trade_items";
        buy[] ={400,"Coins"};
        sell[] ={200,"Coins"};
    };
    class 20Rnd_762x51_SB_SCAR {
        type = "trade_items";
        buy[] ={1000,"Coins"};
        sell[] ={500,"Coins"};
    };
    class 100Rnd_127x99_M2 {
        type = "trade_items";
        buy[] ={100000,"Coins"};
        sell[] ={50000,"Coins"};
    };
    class 2000Rnd_762x51_L94A1 {
        type = "trade_items";
        buy[] ={100000,"Coins"};
        sell[] ={50000,"Coins"};
    };
    class 32Rnd_40mm_GMG {
        type = "trade_items";
        buy[] ={100000,"Coins"};
        sell[] ={50000,"Coins"};
    };
    class  48Rnd_40mm_MK19 {
        type = "trade_items";
        buy[] ={100000,"Coins"};
        sell[] ={50000,"Coins"};
    };
    
};
 

Ok so now you see how to add extra classes of ammo and where to change prices hope this helps.

Link to comment
Share on other sites

  • 0

@dansoe   Thank you very much! Extremely helpful and super comprehensive. Definitely a first for this topic and great for newbies!

 

I changed DZE_ConfigTrader to false and saw the changes that I had made in the traders via SQL! Although the Overpoch weapons weren't showing in the scroll menus at each trader, I now understand how I would go about switching from the config files to database and vice versa. I switched back and took a look at the config files you mentioned and saw the same exact stuff.   Thank you!

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