Jump to content
  • 0

adding to database issues


Broken Lemonade

Question

hey. Im' not sure if this is where i should post this. i have been trying to add some extra vehicles and weapons to traders on my epoch Chernarus. 

 

this is the sql i tried using to add the ka60 to bandit and hero traders:

INSERT INTO Traders_DATA (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES
('["Ka60_PMC",1]', 500, '[2,"ItemBriefcase100oz"",1];, '[1,"ItemBriefcase100oz",1]', 15, 'trade_any_vehicle'),
('["Ka60_PMC",1]', 500, '[2,"ItemBriefcase100oz"",1];, '[1,"ItemBriefcase100oz",1]', 11, 'trade_any_vehicle');
 

I got this error

#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 '[1,"ItemBriefcase100oz",1]', 15, 'trade_any_vehicle'), ('["Ka60_PMC",1]', 500, ' at line 2

 

i also want to add several weapons and vehicles to hero/bandit as well as vehicles to the 3 main traders

 

Thx. Broken.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Use this tool:
http://dayzepoch.com/forum/index.php?/topic/338-privatehivetools-php/

 

It makes it so much easier for you to add items and it also adds them correctly, meaning you get icons and everything.
 

The problem you're meeting is quite easy. You've not given the syntax an ID to use in the database.
So basically you have to do it like this:


INSERT INTO `DATABASENAMEHERE`.`Traders_DATA` (`id`, `item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES 
(PUTID HERE, '["Ka60_PMC",2]', 5, '[2,"ItemBriefcase100oz",1]', '[1,"ItemBriefcase100oz",1]', 517, 'trade_any_vehicle');

The ID can be anything, but preferably you should put it in a numerical order so if the last ID ends at 5999 your newly inserted value should start at 6000. 

Remember that the 2 in ["Ka60_PMC",2] tells the trader and server that Ka60_PMC is a vehicle.
3 is a weapon, 2 is a vehicle and 1 is general items I believe.

The items bought from the traders won't work and won't enter the players inventory if they don't have the proper number (1,2 & 3)

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