1
0
Fork 0
forked from Simnation/Main
Main/resources/[inventory]/cfx-mxc-vendingmachines/config.lua
2025-08-13 23:44:58 +02:00

742 lines
22 KiB
Lua

Config = {}
Config.Debug = true
Config.RenderDistance = 30.0
Config.DefaultInteractionDistance = 2.0 -- If a vending does not provide a distance this will be used as the default
-- Help us translate!
-- You can contribute by improving existing translations or adding translations for new languages
-- https://localazy.com/p/mxc
Config.Language = "en"
Config.NoFramework = false-- if set to true, ignore framework dependencies; use this parameter if no framework is used (obviously the items and actual usability are not implemented without any framework)
Config.UseOxLibMenuIfFound = false -- set to false if you don't want to use OxLib if found
Config.Blips = true -- set to false if you don't want to see blips on the minimap
Config.Sounds = true -- by default require xSound, you can edit it in config_functions.lua
Config.Target = false -- set to true if you want to use ox-target or qb-target as interaction
Config.CustomTargetResource = "" -- if you have a custom target resource name set it here
Config.AzertyKeyboard = false -- set to true if you use azerty keyboard (default qwerty)
-- Uncomment only if you want to ovverride the default translations provided by localazy
Config.Translations = {
-- %s will be replaced with selected_product_price if a product is selected
--["vending_menu_helper"] = "Please enter the code of a product.\n%s\n~INPUT_SELECT_WEAPON~ Switch camera\n~INPUT_CELLPHONE_SELECT~ Confirm selection\n~INPUT_CELLPHONE_CANCEL~ Exit",
--["selected_product_price"] = "%s - ~g~%s$~w~ \n",
--["invalid_product"] = "~r~Invalid product.~w~",
--["selection_not_valid"] = "~r~The code that you entered is not valid, please enter a valid stand code.",
--["not_enough_money"] = "~r~You don't have enough money to buy this product.",
--["already_used"] = "~r~The vending machine is being used by another player.",
--["ox_menu_header"] = "Vending Machine",
--["ox_menu_description"] = "Select product",
--["ox_menu_currency"] = "$"
--["normal_int_vanilla"] = "Press {E} to buy something from the vending machine",
--["coffee_int_vanilla"] = "Press {E} to get a coffee from the vending machine",
--["water_int_vanilla"] = "Press {E} to get a water cup",
--["cigs_int_vanilla"] = "Press {E} to buy a pack of cigarettes",
--["normal_int_target"] = "Buy something",
--["coffee_int_target"] = "Get a coffee",
--["water_int_target"] = "Refresh your mouth"
}
-- These "objects" are used by vending machines for providing human-readable names in menus, models for items, and handling payment.
-- item_name = {
-- price = number (price of the item for payment)
-- label = string (name displayed in menus, e.g., in the ox lib menu)
-- model = string (model used to populate vending machines capable of displaying items; see snack or soda for details)
-- }
-- !! "item_name" Should match the item in your inventory exactly !!
Config.Items = {
--#region coffee
coffee = { -- Used only for payment and to give the item
price = 4
},
--#endregion
--#region water
water = { -- Used only for payment and to give the item
price = 0,
ignoreGive = true
},
--#endregion
--#region snack
chips_cheese = {
label = "Chips: Big Cheese",
model = "mxc_vend_prop_item_chips1",
price = 100
},
chips_paprika = {
label = "Chips: Paprika",
model = "mxc_vend_prop_item_chips2",
price = 100
},
chips_ribs = {
label = "Chips: Sticky Ribs",
model = "mxc_vend_prop_item_chips3",
price = 100
},
chips_salt = {
label = "Chips: Salt & Sauce",
model = "mxc_vend_prop_item_chips4",
price = 100
},
chips_supersalt = {
label = "Chips: Super Salt",
model = "mxc_vend_prop_item_chips5",
price = 100
},
chips_habanero = {
label = "Chips: Habanero",
model = "mxc_vend_prop_item_chips6",
price = 100
},
chocolate_captain = {
label = "Ego Chaser Schockriegel",
model = "mxc_vend_prop_item_chocolate1",
price = 2
},
chocolate_meteorite = {
label = "EarthQuakes",
model = "mxc_vend_prop_item_chocolate2",
price = 2
},
condom = {
label = "Condom: Soth Lags",
model = "mxc_vend_prop_item_preservatives",
price = 100,
zoffset = -0.02
},
candy_zebra = {
label = "Candy: Zebrabar",
model = "mxc_vend_prop_item_candybar1",
price = 100
},
candy_psqs = {
label = "Candy: P's & Q's",
model = "mxc_vend_prop_item_candybar2",
price = 100
},
medicine_laxmax = {
label = "Medicine: Lax to the Max",
model = "mxc_vend_prop_item_medical1",
price = 100
},
medicine_alcopatch = {
label = "Medicine: AlcoPatch",
model = "mxc_vend_prop_item_medical2",
price = 100
},
medicine_mollis = {
label = "Medicine: Mollis",
model = "mxc_vend_prop_item_medical3",
price = 100
},
medicine_betta = {
label = "Medicine: Betta",
model = "mxc_vend_prop_item_medical4",
price = 100
},
gum_peppermint = {
label = "Gum: Peppermint",
model = "mxc_vend_prop_item_gum1",
price = 100
},
gum_cinnamon = {
label = "Gum: Cinnamon",
model = "mxc_vend_prop_item_gum2",
price = 100
},
gum_spearmint = {
label = "Gum: Spearmint",
model = "mxc_vend_prop_item_gum3",
price = 100
},
--#endregion
--#region soda
ecola_flasche = {
label = "E-Cola",
model = "mxc_vend_prop_item_bottle1",
price = 6
},
ecola_zero_flasche = {
label = "E-Cola Zero",
model = "mxc_vend_prop_item_bottle1",
price = 6
},
bottle_junk = {
label = "Junk",
model = "mxc_vend_prop_item_bottle2",
price = 6
},
orange_o_tang_flasche = {
label = "Orange O Tang",
model = "mxc_vend_prop_item_bottle3",
price = 6
},
orange_o_tang_zero_flasche = {
label = "Orange O Tang Zero",
model = "mxc_vend_prop_item_bottle3",
price = 6
},
bottle_tonic = {
label = "Tonic",
model = "mxc_vend_prop_item_bottle4",
price = 6
},
water_bottle = {
label = "Wasser",
model = "mxc_vend_prop_item_bottle5",
price = 6
},
sprunk_flasche = {
label = "Sprunk",
model = "mxc_vend_prop_item_bottle6",
price = 6
},
sprunk_zero_flasche = {
label = "Sprunk",
model = "mxc_vend_prop_item_bottle6",
price = 6
},
ecola_dose = {
label = "E-Cola Dose",
model = "mxc_vend_prop_item_cansoda1",
price = 4
},
orange_o_tang_dose = {
label = "Orange O Tang Dose",
model = "mxc_vend_prop_item_cansoda2",
price = 4
},
orange_o_tang_zero_dose = {
label = "Orange O Tang Dose Zero",
model = "mxc_vend_prop_item_cansoda2",
price = 4
},
junk_energy = {
label = "Junk Dose",
model = "mxc_vend_prop_item_cansoda3",
price = 4
},
sprunk_dose = {
label = "Sprunk Dose",
model = "mxc_vend_prop_item_cansoda4",
price = 4
},
sprunk_zero_dose = {
label = "Sprunk Zero Dose",
model = "mxc_vend_prop_item_cansoda4",
price = 4
},
ecola_zero_dose = {
label = "E-Cola Zero Dose",
model = "mxc_vend_prop_item_cansoda1",
price = 4
},
can_logger = {
label = "Logger dose",
model = "mxc_vend_prop_item_canbeer1",
price = 100
},
can_blarneys = {
label = "Blarneys Dose",
model = "mxc_vend_prop_item_canbeer2",
price = 100
},
can_hoplivion = {
label = "Hoplivion Dose",
model = "mxc_vend_prop_item_canbeer3",
price = 100
},
can_cerbeza = {
label = "Cerbeza Dose",
model = "mxc_vend_prop_item_canbeer4",
price = 100
},
--#endregion
--#region svapo
droelfbar = {
label = "Drölfbar Döner Ice Explosion",
model = "mxc_smoking_prop_evape_2a",
price = 20
},
droelfbar2 = {
label = "Drölfbar Pfirsich Minze Ice",
model = "mxc_smoking_prop_evape_2f",
price = 20
},
--#endregion
redwoodpack = {
label = "Packung Redwood Zigaretten",
model = "v_ret_ml_cigs",
price = 10
},
cigs_redwood2 = {
label = "Cigarettes: Redwood2",
model = "v_ret_ml_cigs2",
price = 100
},
cigs_debonaireb = {
label = "Cigarettes: Debonaire Blue",
model = "v_ret_ml_cigs3",
price = 100
},
cigs_debonaireg = {
label = "Cigarettes: Debonaire Green",
model = "v_ret_ml_cigs4",
price = 100
},
cigs_cardiaque = {
label = "Cigarettes: Cardiaque",
model = "v_ret_ml_cigs5",
price = 100
},
cigs_69brand = {
label = "Cigarettes: 69Brand",
model = "v_ret_ml_cigs6",
price = 100
},
cigs_cok = {
label = "Cigarettes: CoK",
model = "mxc_vend_prop_item_cigs1",
price = 100
},
cigs_estancia = {
label = "Cigars: Estancia",
model = "prop_cigar_pack_01",
price = 100
}
}
-- Here you can enter model and coordinates to spawn new vending machines around the map, the last value of the vector is the heading
Config.PlaceVendings = {
prop_vend_snak_01 = {
vec4(0, 0, 0, 0),
},
prop_vend_soda_01 = {
vec4(0, 0, 0, 0)
},
}
-- Here you can customize the exhibition of vending machines near certain coordinates based on the name of vending
Config.OverrideExhibition = {
{
name = "snack", -- name of vending (based on Config.Vendings)
coords = vec3(0, 0, 0),
exhibition = {
a1 = "chips_ribs",
a2 = "chips_paprika",
a3 = "chips_paprika",
a4 = "chips_paprika",
b1 = "chips_paprika",
b2 = "chips_paprika",
b3 = "chips_paprika",
b4 = "chips_ribs",
c1 = "chips_paprika",
c2 = "chips_paprika",
c3 = "chips_paprika",
c4 = "chips_paprika",
d1 = "chips_paprika",
d2 = "chips_paprika",
d3 = "chips_paprika",
d4 = "chips_paprika",
e1 = "chips_paprika",
e2 = "chips_paprika",
e3 = "chips_paprika",
e4 = "chips_paprika",
},
},
}
-- Settings for individual vending machines, if you want to disable the blip for an individual vending machine simply delete that entire section.
Config.Vendings = {
["snack"] = {
models = {`prop_vend_snak_01`},
interaction = {
vanilla = {
notify = "normal_int_vanilla",
distance = 0.35
},
target = {
label = "normal_int_target",
icon = "fa-solid fa-drumstick-bite",
distance = 3.0
}
},
blip = {
sprite = 772,
color = 0,
size = 0.5
},
-- This section is for choosing which items (from the Config.Items list) to show for each individual stand.
-- You can follow the visual tags on the in-game model to figure out where you are putting things
exhibition = {
a1 = "chips_cheese",
a2 = "chips_paprika",
a3 = "chips_ribs",
a4 = "chips_salt",
b1 = "chips_supersalt",
b2 = "chips_habanero",
b3 = "chips_cheese",
b4 = "chips_paprika",
c1 = "chocolate_captain",
c2 = "chocolate_meteorite",
c3 = "condom",
c4 = "candy_zebra",
d1 = "candy_psqs",
d2 = "gum_peppermint",
d3 = "gum_cinnamon",
d4 = "gum_spearmint",
},
--#region Advanced
Near = function(self, obj, dbId)
PopulateSnackVending(self, obj)
end,
Far = function(self, obj, dbId)
ClearSnackVending(self, obj)
end,
OnInteraction = function(self, obj, dbId)
local selection = nil
-- OxLib input dialog
if lib and Config.UseOxLibMenuIfFound then
selection = DisplayOxLibMenu(self, obj)
else
selection = DisplayInteractiveMenu(self, obj)
end
if selection then
Config.Functions.TryToBuy(self, selection, dbId, function()
SelectItemSnackVending(self, obj, selection)
end)
else
Server.SetVendingUsed(dbId, false)
end
end
--#endregion
},
["soda"] = {
models = {`prop_vend_soda_01`},
interaction = {
vanilla = {
notify = "normal_int_vanilla",
distance = 1.0
},
target = {
label = "normal_int_target",
icon = "fa-solid fa-wine-bottle",
distance = 3.0
}
},
blip = {
sprite = 827,
color = 1,
size = 0.5
},
-- This section is for choosing which items (from the Config.Items list) to show for each individual stand.
-- You can follow the visual tags on the in-game model to figure out where you are putting things
exhibition = {
a1 = "ecola_flasche",
a2 = "ecola_flasche",
a3 = "sprunk_flasche",
a4 = "sprunk_flasche",
a5 = "orange_o_tang_flasche",
a6 = "orange_o_tang_flasche",
b1 = "ecola_zero_flasche",
b2 = "orange_o_tang_zero_flasche",
b3 = "sprunk_zero_flasche",
b4 = "water_bottle",
b5 = "water_bottle",
b6 = "water_bottle",
c1 = "sprunk_dose",
c2 = "ecola_dose",
c3 = "orange_o_tang_dose",
c4 = "ecola_zero_dose",
c5 = "sprunk_zero_dose",
c6 = "orange_o_tang_zero_dose",
},
--#region Advanced
Near = function(self, obj, dbId)
PopulateSodaVending(self, obj, "mxc_vend_prop_soda_shelf")
end,
Far = function(self, obj, dbId)
ClearSodaVending(self, obj)
end,
OnInteraction = function(self, obj, dbId)
local selection = nil
-- OxLib input dialog
if lib and Config.UseOxLibMenuIfFound then
selection = DisplayOxLibMenu(self, obj)
else
selection = DisplayInteractiveMenu(self, obj)
end
if selection then
Config.Functions.TryToBuy(self, selection, dbId, function()
SelectItemSodaVending(self, obj, selection)
end)
else
Server.SetVendingUsed(dbId, false)
end
end
--#endregion
},
["coffee"] = {
item = "coffee", -- Vending machines without exhibition can set an item to be sold here (as always from Config.Items)
models = {`prop_vend_coffe_01`},
interaction = {
vanilla = {
notify = "coffee_int_vanilla",
distance = 1.1
},
target = {
label = "coffee_int_target",
icon = "fa-solid fa-mug-hot",
distance = 3.0
}
},
blip = {
sprite = 89,
color = 31,
size = 0.5
},
Far = function(self, obj, dbId)
ClearCoffeeVending(self, obj)
end,
--#region Advanced
OnInteraction = function(self, obj, dbId)
Config.Functions.TryToBuy(self, self.item, dbId, function()
StartCoffeeVending(self, obj, true)
end)
end
--#endregion
},
["water"] = {
item = "water", -- Vending machines without exhibition can set an item to be sold here (as always from Config.Items)
models = {`prop_watercooler`},
interaction = {
vanilla = {
notify = "water_int_vanilla",
distance = 1.2
},
target = {
label = "water_int_target",
icon = "fa-solid fa-glass-water",
distance = 3.0
}
},
blip = {
sprite = 499,
color = 3,
size = 0.5
},
Far = function(self, obj, dbId)
ClearWaterVending(self, obj)
end,
--#region Advanced
OnInteraction = function(self, obj, dbId)
Config.Functions.TryToBuy(self, self.item, dbId, function()
StartWaterVending(self, obj)
Status.UpdatePlayerStatus({["thirst"] = 20})
end)
end
--#endregion
},
["cigarettes"] = {
models = {`prop_vend_fags_01`},
interaction = {
vanilla = {
notify = "cigs_int_vanilla",
distance = 0.4
},
target = {
label = "normal_int_target",
icon = "fa-solid fa-smoking",
distance = 3.0
}
},
-- For this vending, this will only be used for the menu, it will not create any model
exhibition = {
a1 = "redwoodpack",
a2 = "cigs_redwood2",
a3 = "cigs_estancia",
a4 = "cigs_69brand",
a5 = "cigs_debonaireb",
a6 = "cigs_debonaireg",
b1 = "cigs_cardiaque",
b2 = "cigs_cok",
},
blip = {
sprite = 205,
color = 22,
size = 0.5
},
--#region Advanced
OnInteraction = function(self, obj, dbId)
local selection = nil
-- OxLib input dialog
if lib and Config.UseOxLibMenuIfFound then
selection = DisplayOxLibMenu(self, obj)
else
selection = DisplayInteractiveMenu(self, obj)
end
if selection then
Config.Functions.TryToBuy(self, selection, dbId, function()
SelectItemCigarettesVending(self, obj, selection)
end)
else
Server.SetVendingUsed(dbId, false)
end
end
--#endregion
},
["soda_2"] = {
parent = "soda", -- Vending machines can set a parent vending machine, this allows you to inherit all the other vending settings with the ability to override them
models = {`prop_vend_soda_02`},
interaction = {
vanilla = {
notify = "normal_int_vanilla",
distance = 1.0
},
target = {
label = "normal_int_target",
icon = "fa-solid fa-wine-bottle",
distance = 3.0
}
},
blip = {
sprite = 827,
color = 2,
size = 0.5
},
-- This section is for choosing which items (from the Config.Items list) to show for each individual stand.
-- You can follow the visual tags on the in-game model to figure out where you are putting things
exhibition = {
a1 = "ecola_flasche",
a2 = "ecola_flasche",
a3 = "sprunk_flasche",
a4 = "sprunk_flasche",
a5 = "orange_o_tang_flasche",
a6 = "orange_o_tang_flasche",
b1 = "ecola_zero_flasche",
b2 = "orange_o_tang_zero_flasche",
b3 = "sprunk_zero_flasche",
b4 = "water_bottle",
b5 = "water_bottle",
b6 = "water_bottle",
c1 = "sprunk_dose",
c2 = "ecola_dose",
c3 = "orange_o_tang_dose",
c4 = "ecola_zero_dose",
c5 = "sprunk_zero_dose",
c6 = "orange_o_tang_zero_dose",
},
--#region Advanced
Near = function(self, obj, dbId)
PopulateSodaVending(self, obj, "mxc_vend_prop_soda_shelf2")
end,
Far = function(self, obj, dbId)
ClearSodaVending(self, obj)
end,
OnInteraction = function(self, obj, dbId)
local selection = nil
-- OxLib input dialog
if lib and Config.UseOxLibMenuIfFound then
selection = DisplayOxLibMenu(self, obj)
else
selection = DisplayInteractiveMenu(self, obj)
end
if selection then
Config.Functions.TryToBuy(self, selection, dbId, function()
SelectItemSodaVending(self, obj, selection)
end)
else
Server.SetVendingUsed(dbId, false)
end
end
--#endregion
},
-- Require cfx-mxc-smoking (https://store.markz3d.com/checkout/packages/add/6245837/single)
["svapo"] = {
parent = "snack", -- Vending machines can set a parent vending machine, this allows you to inherit all the other vending settings with the ability to override them
models = {`mxc_vend_prop_svapo_01`},
blip = {
sprite = 772,
color = 0,
size = 0.5
},
exhibition = {
a1 = "droelfbar2",
a2 = "droelfbar2",
a3 = "droelfbar2",
a4 = "droelfbar2",
b1 = "droelfbar2",
b2 = "droelfbar2",
b3 = "droelfbar2",
b4 = "droelfbar2",
c1 = "droelfbar2",
c2 = "droelfbar2",
c3 = "droelfbar",
c4 = "droelfbar",
d1 = "droelfbar",
d2 = "droelfbar",
d3 = "droelfbar",
d4 = "droelfbar",
e1 = "droelfbar",
e2 = "droelfbar",
e3 = "droelfbar",
e4 = "droelfbar",
},
},
}