Jump to content
  • 0

Need help making solo trader for just Hemp


macbeths0x

Question

Hello.. im new to the dayz Scripting world and im trying to learn as much as i can before asking but for this im a little stumpped and i know most of you think its simple so haha

 

anyways

would like to have a solo trader jsut for hemp at location  :

 

8366.86,890.065,1.20191

facing direction 99.3392

 

with skin Rocker1_DZ

 

i want this trader to only buy hemp

 

1kilo for 2 10oz or 20 gold

 

 

i really hate asking but i need some help in making this work .. also would like to have a marker set with the name Drug Dealer

a dark green dot like the wholesalers and boat dealers have

 

a how to would be great so i could do it myself im with vilayer

 

thanks in advance

 

 

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Extract your dayz_server.pbo, open the folder and go to missions\DayZ_Epoch_X(select your Instance/Map).
Once you're there open the mission.sqf and scroll to the bottom.

Above the processInitCommands; add these lines:
 

// Epoch Hemp trader
_unit_5000 = objNull;
if (true) then
{
  _this = createAgent ["Rocker1_DZ", [8366.86, 890.065, 1.20191], [], 0, "CAN_COLLIDE];
  _unit_5000 = _this;
  _this setDir 99.3392;
  _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
  _this setUnitAbility 0.60000002;
_this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;};

 



Once that is done, you can save the file and re-pack the dayz_server using the tool of your choice(cPPBO/PBO Manager).

Find and extract your DayZ_Epoch mission file, then open server_traders.qf.
At line 2, serverTraders, you must go to the end of the line and add the following: "Rocker1_DZ"
Make sure that there is no , after "Rocker1_DZ".
Example: 
serverTraders = ["Tanny_PMC","Graves","US_Delta_Force_AR_EP1","GUE_Commander","Damsel3","Soldier_MG_PKM_PMC","GUE_Worker2","GUE_Woodlander2","RUS_Soldier2","Drake_Light","GUE_Woodlander3","Soldier_GL_PMC","GUE_Villager3","CIV_EuroWoman01_EP1","Dr_Annie_Baker_EP1","RUS_Commander","Damsel5","TK_Special_Forces_MG_EP1","TK_Special_Forces_EP1","Ins_Soldier_AR","Ins_Lopotev","Ins_Worker2","Ins_Woodlander3","Dr_Hladik_EP1","pook_Doc_Bell47","Ins_Woodlander2","Pilot_EP1_DZ","Priest_DZ","RU_Policeman_DZ","Haris_Press_EP1_DZ","FR_TL","CIV_EuroMan02_EP1","GUE_Soldier_Pilot","CZ_Soldier_Light_DES_EP1","Rocket1_DZ"];

 



Once you have done that, scroll to the bottom and add the following lines:

// Hemp trader 
menu_Rocket1_DZ = [
[["Hemp",1000]],
[],
"neutral"
];

 

 

 
Save the file and re-pack it.
You will need to use a MySQL tool to add the hemp itself into the traders, I recommend using Navicat.
I assume that you have the MySQL info and that can figure out how to connect to the database.
Once you've entered your info and connected, double click on the database so that all the tables and stuff appear(Character_DATA,Object_DATA etc).

Go to Query -> New Query and type in the following code and then click Run:

INSERT INTO Traders_DATA (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemKiloHemp",2]', 100, '[2,"ItemGoldBar10oz",1]', '[1,"ItemSilverBar",1]', 1000, 'trade_items'); 

 


This will make it so that you buy 1x Hemp for 20 gold, and that you sell it for 1x silver bar.
Now you must navigate to the table called trader_tids. Scroll to the bottom of it and create a new field.
id: 1000
name: Hemp
trader: 1000

 



Once you've done that, save it and you can exit the MySQL tool.

Creating a map marker is simple.
Go to your mission folder, and open mission.sqm. Once you're there, search for "class Markers"Two lines below "class Markers", you see something called "items=X;
If for example it says "items=15;", add one more so its "items=16;" instead.
Scroll down until you see for example "class Item14". Just look at the text and you'll know you're in the right spot.

Just below the last "class Item", add the following lines. Make sure that if your last class Item says 14, then the new one must be 15.

 
class Item15
{
position[]={8366.86, 1.20191, 890.065};
name="HempTrader";
text="Drug Dealer";
type="mil_dot";
colorName="ColorGreen";
};
 

 


You can change the ColorGreen if you want a different color. For example you can use ColorBlack, ColorRed, ColorBlue etc.
Save the file, re-pack and upload to your server and it should be good to go.

If you need any further help, you can either post here or send me a PM.
If you want, you can send me your dayz_server and mission file and I can add it for you.
 
Link to comment
Share on other sites

  • 0

thank u so much .. so i got the trader in but in the trader menu there is nothing listed its just empty ..

do you know what could be wrong ??

INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemKiloHemp",2]', 100, '[2,"ItemGoldBar10oz",1]', '[1,"ItemSilverBar",1]', 1000, 'trade_items'); 

 

check your database name is it traders_data or Traders_DATA    ???

Link to comment
Share on other sites

  • 0

INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemKiloHemp",2]', 100, '[2,"ItemGoldBar10oz",1]', '[1,"ItemSilverBar",1]', 1000, 'trade_items'); 

 

check your database name is it traders_data or Traders_DATA    ???

i checked and its traders_data

 

so im guessing thats where i when wrong eh ?

Link to comment
Share on other sites

  • 0

ok so i changed the Trader_Data to trader_data

 

when i run the query i get this error

 

 INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemKiloHemp",2]', 100, '[1,"ItemGoldBar10oz",1]', '[4,"ItemGoldBar10oz",1]', 1000, 'trade_items');
[Err] 1062 - Duplicate entry '["ItemKiloHemp",2]-1000' for key 'item'
 
Link to comment
Share on other sites

  • 0

I would try delete it from database and re-add it but change  this too

INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemKiloHemp",1]', 100, '[2,"ItemGoldBar10oz",1]', '[1,"ItemSilverBar",1]', 1000, 'trade_items'); 

 

the '["ItemKiloHemp",2] should be '["ItemKiloHemp",1]

INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES
('["ItemKiloHemp",1]', 100, '[2,"ItemGoldBar10oz",1]', '[1,"ItemGoldBar10oz",1]', 1000, 'trade_items')
Link to comment
Share on other sites

  • 0

ok so i added it

when i go look its htere but it looks like this

 

ID:7587

Item: ["ItemKiloHemp",1]

qty: 100

buy: [1,"ItemGoldBar10oz",1]

sell: [4,"ItemGoldBar10oz",1]

order: 0

tid: 1000

afile: trade_items

 

 

should i change the ID to 1000?

 

 

when i ran INSERT INTO traders_data (`item`, `qty`, `buy`, `sell`, `tid`, `afile`) VALUES ('["ItemKiloHemp",1]', 100, '[1,"ItemGoldBar10oz",1]', '[4,"ItemGoldBar10oz",1]', 1000, 'trade_items');

 

it inserted it but  after restarting the trader still has no items in ther to sell or buy

Link to comment
Share on other sites

  • 0

May I add, careful on the Skin you use. If it's one a player can get a hold of, it will give that player the trader status ability, and depending on the Anti-hack tool used and how it's setup, can kick a player for trying to trade with the other player. This is how I setup my character to be the Drug Dealing Admin, by using the Reynolds_PMC skin. This way only another admin or myself can change into the skin. 

Link to comment
Share on other sites

  • 0

thank u so much .. so i got the trader in but in the trader menu there is nothing listed its just empty ..

do you know what could be wrong ??

Small error in the original instructions I think,,,first instruction states rocker1 and second rocket1 might want to check both are the same.. BUT do read the later guys comments about what skins you use!

Link to comment
Share on other sites

  • 0

Small error in the original instructions I think,,,first instruction states rocker1 and second rocket1 might want to check both are the same.. BUT do read the later guys comments about what skins you use!

ya i got it working ..

 

issue was the that my database was not the same as his he has Trader_Data  and mine was trader_data lol little mistakes eh haha and i def changed the skin ..

 

but for some reason my marker is not working "/

 

does anyone have the colour list that can be used ? maybe ColorBrown doesnt work ?

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