Jump to content
  • 0

Vending Machine trader


RabidPanda01

Question

Does anyone know how to make a vending machine into a trader?  

what i have tried...

 

Adding Map_Vending blah de blah to the top of servertrader.sqf...

then adding a "trader" to the bottom of that but setting the trader as MAP_Vending.  

Then when a player walks up to the vending machine the see "trader Menu" then they can interact with it just like any other vendor.

This did not work...

 

I tried this..

 

But it does not give me the functionality I am looking for. .I want players to pay for the soda of their choice.. with coin.  
 

And Ideas?

 

Thank yoU!

RP

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

This is my server_trader  I thought it would be that simple..Creep, but it didn't seem to work. Maybe you can see an error that i didn't.. and thanks stiffler for reposing my link...wtf man?

 

// DayZ Epoch TRADERS for 17
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","gsc_scientist1","MAP_vending_machine"];
// Hero Vendor
menu_Tanny_PMC = [
[["Ammunition",478],["Clothes",575],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",477],["Money",700]],
[],
"hero"
];
// Ammunition Friendly
menu_Graves = [
[["Assault Rifle Ammo",609],["Light Machine Gun Ammo",610],["Pistol Ammo",611],["Shotguns and Single-shot Ammo",613],["Sniper Rifle Ammo",614],["Submachine Gun Ammo",612],["Overwatch Pistol Ammo",1012],["Overwatch Gun Ammo",1013]],
[],
"neutral"
];
// Weapons Friendly
menu_US_Delta_Force_AR_EP1 = [
[["Assault Rifle",637],["Light Machine Gun",638],["Pistols",674],["Shotguns and Single-shot",641],["Sniper Rifle",640],["Submachine Guns",642],["Overwatch VIL",1002],["Overwatch TAR",1003],["Overwatch Sniper",1011],["Overwatch SCAR",1004],["Overwatch sidearm",1001],["Overwatch MAS",1007],["Overwatch HK417",1009],["Overwatch HK416",1008],["Overwatch HK416",1008],["Overwatch DMR",1010],["Overwatch ACR",1005]],
[],
"neutral"
];
// Friendly Vehicles
menu_GUE_Commander = [
[["Bikes and ATV",587],["Buses and Vans",588],["Cargo Trucks",586],["Fuel Trucks",589],["Military Unarmed",598],["Trucks",590],["Used Cars",520],["Utility Vehicles",591],["Overwatch SP-Car",1015],["Overwatch S-Car",1016]],
[],
"neutral"
];
// General Store
menu_Damsel3 = [
[["Backpacks",496],["Clothes",497],["Cooked Meats",580],["Drinks",498],["Packaged Food",579]],
[["ItemCopperBar","TrashJackDaniels",1,1,"buy","Empty Whiskey Bottle","Copper Bar",101]],
"neutral"
];
// Weapons neutral
menu_Soldier_MG_PKM_PMC = [
[["Assault Rifle",637],["Light Machine Gun",638],["Pistols",674],["Shotguns and Single-shot",641],["Sniper Rifle",640],["Submachine Guns",642],["Overwatch VIL",1002],["Overwatch TAR",1003],["Overwatch Sniper",1011],["Overwatch SCAR",1004],["Overwatch sidearm",1001],["Overwatch MAS",1007],["Overwatch HK417",1009],["Overwatch HK416",1008],["Overwatch G3",1006],["Overwatch DMR",1010],["Overwatch ACR",1005]],
[],
"neutral"
];
// Ammunition Neutral
menu_GUE_Worker2 = [
[["Assault Rifle Ammo",609],["Light Machine Gun Ammo",610],["Pistol Ammo",611],["Shotguns and Single-shot Ammo",613],["Sniper Rifle Ammo",614],["Submachine Gun Ammo",612],["Overwatch Pistol Ammo",1012],["Overwatch Gun Ammo",1013]],
[],
"neutral"
];
// Neutral Building/Parts
menu_GUE_Woodlander2 = [
[["Building Supplies",508],["Toolbelt Items",510],["Vehicle Parts",509],["Money",700]],
[],
"neutral"
];
// Bandit Trader
menu_RUS_Soldier2 = [
[["Ammunition",577],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627],["Money",700]],
[],
"SuperHero"
];
// Aircraft Dealer
menu_Drake_Light = [
[["Airplanes",517],["Helicopter Unarmed",519],["Overwatch Camel",1014],["H-13",6969]],
[],
"neutral"
];
// Vehicles Neutral
menu_GUE_Woodlander3 = [
[["Bikes and ATV",587],["Buses and Vans",588],["Cargo Trucks",586],["Fuel Trucks",589],["Military Unarmed",598],["Trucks",590],["Used Cars",520],["Utility Vehicles",591],["Overwatch SP-Car",1015],["Overwatch S-Car",1016]],
[],
"neutral"
];
// Black Market Vendor
menu_Soldier_GL_PMC = [
[["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529]],
[],
"neutral"
];
// Friendly Building/Parts
menu_GUE_Villager3 = [
[["Building Supplies",508],["Toolbelt Items",510],["Vehicle Parts",509],["Money",700]],
[],
"neutral"
];
// General Store 2
menu_CIV_EuroWoman01_EP1 = [
[["Backpacks",496],["Clothes",497],["Cooked Meats",580],["Drinks",498],["Packaged Food",579]],
[["ItemCopperBar","TrashJackDaniels",1,1,"buy","Empty Whiskey Bottle","Copper Bar",101]],
"neutral"
];
// Medical Supplies
menu_Dr_Annie_Baker_EP1 = [
[["Chem-lites/Flares",669],["Medical Supplies",670],["Smoke Grenades",671]],
[["FoodBioMeat","ItemZombieParts",1,1,"buy","Zombie Parts","Bio Meat",101]],
"neutral"
];
// North Wholesaler
menu_RUS_Commander = [
[["Wholesale",636]],
[],
"neutral"
];
// General Store 3 
menu_Damsel5 = [
[["Backpacks",496],["Clothes",497],["Cooked Meats",580],["Drinks",498],["Packaged Food",579]],
[["ItemCopperBar","TrashJackDaniels",1,1,"buy","Empty Whiskey Bottle","Copper Bar",101]],
"neutral"
];
// West Wholesaler
menu_TK_Special_Forces_MG_EP1 = [
[["Wholesale",636]],
[],
"neutral"
];
// North Boat Vendor
menu_TK_Special_Forces_EP1 = [
[["Boats Armed",673],["Boats Unarmed",672]],
[],
"neutral"
];
// Weapons neutral 2
menu_Ins_Soldier_AR = [
[["Assault Rifle",637],["Light Machine Gun",638],["Pistols",674],["Shotguns and Single-shot",641],["Sniper Rifle",640],["Submachine Guns",642],["Overwatch VIL",1002],["Overwatch TAR",1003],["Overwatch Sniper",1011],["Overwatch SCAR",1004],["Overwatch sidearm",1001],["Overwatch MAS",1007],["Overwatch HK417",1009],["Overwatch HK416",1008],["Overwatch G3",1006],["Overwatch DMR",1010],["Overwatch ACR",1005]],
[],
"neutral"
];
// Ammunition Neutral 2
menu_Ins_Lopotev = [
[["Assault Rifle Ammo",609],["Light Machine Gun Ammo",610],["Pistol Ammo",611],["Shotguns and Single-shot Ammo",613],["Sniper Rifle Ammo",614],["Submachine Gun Ammo",612],["Overwatch Pistol Ammo",1012],["Overwatch Gun Ammo",1013]],
[],
"neutral"
];
// Vehicles Neutral 2
menu_Ins_Worker2 = [
[["Bikes and ATV",587],["Buses and Vans",588],["Cargo Trucks",586],["Fuel Trucks",589],["Military Unarmed",598],["Trucks",590],["Used Cars",520],["Utility Vehicles",591],["Overwatch SP-Car",1015],["Overwatch S-Car",1016]],
[],
"neutral"
];
// Neutral Building/Parts
menu_Ins_Woodlander3 = [
[["Building Supplies",508],["Toolbelt Items",510],["Vehicle Parts",509],["Money",700]],
[],
"neutral"
];
// Medical Supplies 2
menu_Dr_Hladik_EP1 = [
[["Chem-lites/Flares",669],["Medical Supplies",670],["Smoke Grenades",671]],
[["FoodBioMeat","ItemZombieParts",1,1,"buy","Zombie Parts","Bio Meat",101]],
"neutral"
];
// Boat Trader 2
menu_Ins_Woodlander2 = [
[["Boats Armed",673],["Boats Unarmed",672]],
[],
"neutral"
];
// Medical Supplies 3
menu_pook_Doc_Bell47 = [
[["Chem-lites/Flares",669],["Medical Supplies",670],["Smoke Grenades",671]],
[["FoodBioMeat","ItemZombieParts",1,1,"buy","Zombie Parts","Bio Meat",101]],
"neutral"
];
// Rabid Air Dealer
menu_gsc_scientist1 = [
[["Armed Jets",7969]],
[],
"SuperHero"
];
// Vending Machine
menu_MAP_vending_machine = [
[["Drinks",498],
[],
"neutral"
];

 

Link to comment
Share on other sites

  • 0

is there a list of units/vehicles that dayz looks for to allow the trader menu.. i know that i used one unit for a custom trader and it didnt work.. i switched to that little scientist guy and it worked fine...maybe there is a folder somewhere that says.. "yes you can use this unit/vehicle"  I could just add what ever Unit/vehicle i want to this... ..

Link to comment
Share on other sites

  • 0

My mistake,

in fn_selfactions:

_isMan = _cursorTarget isKindOf "Man";

_traderType = _typeOfCursorTarget; 

and

/ All Traders
	if (_isMan && !_isPZombie && _traderType in serverTraders) then {
		
		if (s_player_parts_crtl < 0) then {

			// get humanity
			_humanity = player getVariable ["humanity",0];
			_traderMenu = call compile format["menu_%1;",_traderType];

			// diag_log ("TRADER = " + str(_traderMenu));
			
			_low_high = "low";
			_humanity_logic = false;
			if((_traderMenu select 2) == "friendly") then {
				_humanity_logic = (_humanity < -5000);
			};
			if((_traderMenu select 2) == "hostile") then {
				_low_high = "high";
				_humanity_logic = (_humanity > -5000);
			};
			if((_traderMenu select 2) == "hero") then {
				_humanity_logic = (_humanity < 5000);
			};
			if(_humanity_logic) then {
				_cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
				s_player_parts set [count s_player_parts,_cancel];
			} else {
				
				// Static Menu
				{
					//diag_log format["DEBUG TRADER: %1", _x];
					_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
					s_player_parts set [count s_player_parts,_buy];
				
				} count (_traderMenu select 1);
				// Database menu
				_buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
				s_player_parts set [count s_player_parts,_buy];

			};
			s_player_parts_crtl = 1;
			
		};
	} else {
		{player removeAction _x} count s_player_parts;s_player_parts = [];
		s_player_parts_crtl = -1;
	}; 

are the important lines

  

 

simply change:

 

 

 

if (_isMan && !_isPZombie && _traderType in serverTraders) then {

 

to

 

if ((_isMan || _cursorTarget isKindOf "MAP_vending_machine") && !_isPZombie && _traderType in serverTraders) then {

 

this should fix your problemos

Link to comment
Share on other sites

  • 0

if infistar closes the tradermenue its because of the close menue option

 

set

/*  Close Dialogs ?       */ _CUD =  true; from true to false

 

or add the epoch dialog numbers to the allowed dialog list

 

/*  ALLOWED Dialogs       */ _ALLOWED_Dialogs = [-1,106,2200,6900,6901,6902,6903,420420,41144,55510,711194];

Link to comment
Share on other sites

  • 0

Soooo I just set _cud to false... trader menu still closing when accessed by player.  I can get it open, as well as my admins.  Seems that only player are having issues.  Are there other epoch dialog numbers that need to be added to that list?  Epoch trader is 420420 and that is in the CUD list by default.

Thanks for the help guys!

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