Thug Posted October 13, 2014 Report Share Posted October 13, 2014 Also can someone tell me how to use the Spoiler? Link to comment Share on other sites More sharing options...
Proximus Posted October 13, 2014 Report Share Posted October 13, 2014 If you copied ZeroKool's script then the vending machine will only work if it's a MAP_Vending_Machine. My server is a Taviana one and i needed to add one myself Link to comment Share on other sites More sharing options...
Thug Posted October 13, 2014 Report Share Posted October 13, 2014 Just found that out myself, the MAP_Vending_Machine. i first set it to Land_Vending_Machine lol My machine is only putting out beer, not a bad thing. Why? Is Beer ItemSodaRabbit Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted October 13, 2014 Report Share Posted October 13, 2014 ZeroK00L, thanks Question and not trying to be smart, but why would you charge for sodas when in my chernarus server i am tripping over them? On my server, the vending machines have a little under a 10% chance to spawn an orange sherbert. You pay 10oz silver and if you get the orange sherbert, you can sell it to the rare food and drinks trader I created and sell it for 1oz of gold. It's kind of like gambling. :) Link to comment Share on other sites More sharing options...
Proximus Posted October 13, 2014 Report Share Posted October 13, 2014 On my server, the vending machines have a little under a 10% chance to spawn an orange sherbert. You pay 10oz silver and if you get the orange sherbert, you can sell it to the rare food and drinks trader I created and sell it for 1oz of gold. It's kind of like gambling. :) See, endless possebilities! :D Like the way you think BetterDeadThanZed Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted October 13, 2014 Report Share Posted October 13, 2014 See, endless possebilities! :D Like the way you think BetterDeadThanZed After installing this script, I had another idea... place an object, such as a cash register, and players have to pay a set amount and in return they get some money back. It might be more than they paid, or it might be less, or it might be something useless like a tin can or a razor. A sort-of slot machine. Link to comment Share on other sites More sharing options...
Thug Posted October 13, 2014 Report Share Posted October 13, 2014 On my server, the vending machines have a little under a 10% chance to spawn an orange sherbert. You pay 10oz silver and if you get the orange sherbert, you can sell it to the rare food and drinks trader I created and sell it for 1oz of gold. It's kind of like gambling. :) I like that ideal Link to comment Share on other sites More sharing options...
Thug Posted October 13, 2014 Report Share Posted October 13, 2014 So if all i want to sell is Beer (ItemSodaRabbit) in the machines, what would the script be then and i mean ZeroKOOL's script. In the mean time i will be looking in the forums for the anwser. I thank you in advance for any help. Link to comment Share on other sites More sharing options...
Proximus Posted October 13, 2014 Report Share Posted October 13, 2014 //by ZeroK00L private["_playerPos","_canVend"]; call gear_ui_init; _playerPos = getPosATL player; _canVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; _soda = ["ItemSodaRabbit","ItemSodaOrangeSherbet","ItemSodaLvg","ItemSodaClays","ItemSodaSmasht","ItemSodaPepsi","ItemSodaMdew","ItemSodaCoke","ItemSodaLemonade"]; if (_canVend) then { playsound "vendingmachine"; sleep 2; player playActionNow "PutDown"; player addMagazine 'ItemSodaRabbit'; cutText ["You received a Soda from the Vending Machine!", "PLAIN DOWN"]; }; I think the original script from ZeroK00l only puts ItemSodaRabbit in the players inv. (look at the player addMagazine line) The version BetterDeadThanZed posted randomly picks a soda defined in the list Link to comment Share on other sites More sharing options...
Spodermayt Posted October 13, 2014 Report Share Posted October 13, 2014 Also can someone tell me how to use the Spoiler? something here [/spoiler ] <- Without the space on the end of course. Link to comment Share on other sites More sharing options...
Spodermayt Posted October 13, 2014 Report Share Posted October 13, 2014 Spodermayt, did you get that to work on your server, if so can you give me your ip, port, and server name so i can come check it out? Its right on my signature ;) Link to comment Share on other sites More sharing options...
Spodermayt Posted October 13, 2014 Report Share Posted October 13, 2014 Spodermayt, did you get that to work on your server, if so can you give me your ip, port, and server name so i can come check it out? Made a vid. (I flipped the vending machine 180 after the vid :P) https://www.youtube.com/watch?v=He5YZ84pxyI Link to comment Share on other sites More sharing options...
Spodermayt Posted October 16, 2014 Report Share Posted October 16, 2014 //by ZeroK00L private["_playerPos","_canVend"]; call gear_ui_init; _playerPos = getPosATL player; _canVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; _soda = ["ItemSodaRabbit","ItemSodaOrangeSherbet","ItemSodaLvg","ItemSodaClays","ItemSodaSmasht","ItemSodaPepsi","ItemSodaMdew","ItemSodaCoke","ItemSodaLemonade"]; if (_canVend) then { playsound "vendingmachine"; sleep 2; player playActionNow "PutDown"; player addMagazine 'ItemSodaRabbit'; cutText ["You received a Soda from the Vending Machine!", "PLAIN DOWN"]; }; I think the original script from ZeroK00l only puts ItemSodaRabbit in the players inv. (look at the player addMagazine line) The version BetterDeadThanZed posted randomly picks a soda defined in the list //by ZeroK00L private["_playerPos","_canVend"]; call gear_ui_init; _playerPos = getPosATL player; _canVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; _soda = ["ItemSodaRabbit","ItemSodaOrangeSherbet","ItemSodaLvg","ItemSodaClays","ItemSodaSmasht","ItemSodaPepsi","ItemSodaMdew","ItemSodaCoke","ItemSodaLemonade"] call BIS_fnc_selectRandom; if (_canVend) then { playsound "vendingmachine"; sleep 2; player playActionNow "PutDown"; player addMagazine _soda; cutText ["You received a Soda from the Vending Machine!", "PLAIN DOWN"]; }; done Link to comment Share on other sites More sharing options...
Proximus Posted October 16, 2014 Report Share Posted October 16, 2014 That will also work :P Link to comment Share on other sites More sharing options...
Thug Posted December 15, 2014 Report Share Posted December 15, 2014 Modified this a bit ;) Only for SingleCurrency SelfActions: private["_playerPos","_nearVend"]; _playerPos = getPosATL player; _nearVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; if (_nearVend) then { if (s_player_buySoda < 0) then { s_player_buySoda = player addaction[("<t color=""#00C732"">" + ("Buy Drinks") +"</t>"),"Vending\vending_drinks.sqf"]; }; if (s_player_buyFood < 0) then { s_player_buyFood = player addaction[("<t color=""#00C732"">" + ("Buy Food") +"</t>"),"Vending\vending_foods.sqf"]; }; } else { player removeAction s_player_buySoda; s_player_buySoda = -1; player removeAction s_player_buyFood; s_player_buyFood = -1; }; Vending\vending_foods.sqf: private["_playerPos","_canVend","_costs"]; call gear_ui_init; _playerPos = getPosATL player; _canVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; _food = ["FoodNutmix","FoodPistachio","FoodSteakCooked","FoodMRE"] call BIS_fnc_selectRandom; _costs = 5; if (_canVend) then { if !([ player,_costs] call SC_fnc_removeCoins) then { titleText [format["You need %1 %2 to buy food.",_costs,CurrencyName] , "PLAIN DOWN", 1]; } else { sleep 1; player playActionNow "PutDown"; player addMagazine _food; titleText [format["Bought a %1 for %2 %3",_food,_costs,CurrencyName] , "PLAIN DOWN", 1]; }; }; Vending\vending_drinks.sqf: private["_playerPos","_canVend","_costs"]; call gear_ui_init; _playerPos = getPosATL player; _canVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; _soda = ["ItemSodaOrangeSherbet","ItemSodaPepsi","ItemSodaMdew","ItemSodaCoke","ItemSodaLemonade"] call BIS_fnc_selectRandom; _costs = 2; if (_canVend) then { if !([ player,_costs] call SC_fnc_removeCoins) then { titleText [format["You need %1 %2 to buy a soda.",_costs,CurrencyName] , "PLAIN DOWN", 1]; } else { sleep 1; player playActionNow "PutDown"; player addMagazine _soda; titleText [format["Bought %1 for %2 %3",_soda,_costs,CurrencyName] , "PLAIN DOWN", 1]; }; }; Will this work with Zupas V3 coin? Would all i have to do is change CurrencyName to cashMoney? Link to comment Share on other sites More sharing options...
jahangir13 Posted December 15, 2014 Report Share Posted December 15, 2014 @BetterDeadThanZed: and you can just delete the if (_hasCash) as the script leaves already before if not. Link to comment Share on other sites More sharing options...
Thug Posted December 24, 2014 Report Share Posted December 24, 2014 Hey did anyone have a problem with the sound for the vending machine? Everything else works. I just don't hear anything when i buy. I have the file vendingmachine.ogg in the vending folder. All my other sounds work i.e. Origins doors, metal gates. This is what i have in my description.ext #include "custom\extra_rc.hpp" class CfgSounds { sounds[] = {}; class DoorCreak { name="DoorCreak"; sound[]={sounds\doorCreak.ogg, 0.1, 1}; titles[] = {}; }; class metalGates { name="metalGates"; sound[]={sounds\metalGates.ogg, 0.1, 1}; titles[] = {}; }; class stronghold { name = "stronghold"; sound[] = {sounds\vrata_sound.ogg,0.1,1}; titles[] = {}; }; class vendingmachine { name="vendingmachine"; sound[]={Vending\vendingmachine.ogg,0.9,1}; titles[] = {}; }; }; #include "custom\snap_pro\snappoints.hpp" Link to comment Share on other sites More sharing options...
calamity Posted December 24, 2014 Report Share Posted December 24, 2014 Hey did anyone have a problem with the sound for the vending machine? Everything else works. I just don't hear anything when i buy. I have the file vendingmachine.ogg in the vending folder. All my other sounds work i.e. Origins doors, metal gates. This is what i have in my description.ext this is how I have sounds class CfgSounds { sounds[] ={doorCreak,metalGates,vrata_sound,vendingmachine}; class DoorCreak { name="DoorCreak"; sound[]={sounds\doorCreak.ogg, 0.1, 1}; titles[] = {}; }; class metalGates { name="metalGates"; sound[]={sounds\metalGates.ogg, 0.1, 1}; titles[] = {}; }; class stronghold { name = "stronghold"; sound[] = {sounds\vrata_sound.ogg,0.1,1}; titles[] = {}; }; class vendingmachine { name="vendingmachine"; sound[]={Vending\vendingmachine.ogg,0.9,1}; titles[] = {}; }; }; shows in instructions to have a \vending\ sound[]={\Vending\vendingmachine.ogg,0.9,1}; not so sure why there is that \vending Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now