local QBCore = exports['qb-core']:GetCoreObject() isLoggedIn = true PlayerJob = {} local onDuty = false Citizen.CreateThread(function() -- Duty Target exports['qb-target']:AddBoxZone("BeanMachineDuty", Config.Locations["duty"], 2, 2, { name = "BeanMachineDuty", heading = 0, debugPoly = false, }, { options = { { event = "alizadev-beanmach:DutyA", icon = "far fa-clipboard", label = Config.Locales["duty_label"], job = "beanmachine", }, }, distance = 1.5 }) -- Fridge Target exports['qb-target']:AddBoxZone("Fridge1", Config.Locations["fridge"], 2, 2, { name = "Fridge1", heading = 340, debugPoly = false, }, { options = { { event = "alizadev-beanmach:Fridge", icon = "fa fa-archive", label = Config.Locales["fridge_label"], job = "beanmachine", }, }, distance = 1.5 }) -- Tray 1 Target exports['qb-target']:AddBoxZone("Tray1", Config.Locations["tray1"], 0.5, 0.5, { name = "Tray1", heading = 5, debugPoly = false, }, { options = { { event = "alizadev-beanmach:Tray1", icon = "far fa-clipboard", label = Config.Locales["tray_1"], }, }, distance = 1.5 }) -- Tray 2 Target exports['qb-target']:AddBoxZone("Tray2", Config.Locations["tray2"], 0.5, 0.5, { name = "Tray2", heading = 0, debugPoly = false, }, { options = { { event = "alizadev-beanmach:Tray2", icon = "far fa-clipboard", label = Config.Locales["tray_2"], }, }, distance = 1.5 }) -- Tray 3 Target exports['qb-target']:AddBoxZone("Tray4", Config.Locations["tray3"], 1, 1, { name = "Tray4", heading = 50, debugPoly = false, }, { options = { { event = "alizadev-beanmach:Tray3", icon = "far fa-clipboard", label = Config.Locales["tray_3"], }, }, distance = 1.5 }) -- Drinks Target exports['qb-target']:AddBoxZone("DrinksMaker", Config.Locations["drinks"], 1, 1, { name = "DrinksMaker", heading = 50, debugPoly = false, }, { options = { { event = "alizadev-beanmach:DrinksMenu", icon = "fa fa-coffee", label = Config.Locales["drinks_label"], job = "beanmachine", }, }, distance = 1.5 }) -- Food Target exports['qb-target']:AddBoxZone("Foods", Config.Locations["food"], 0.5, 0.5, { name = "Foods", heading = 0, debugPoly = false, }, { options = { { event = "alizadev-beanmach:FoodMenu", icon = "fa fa-cutlery", label = Config.Locales["foods_label"], job = "beanmachine", }, }, distance = 1.5 }) -- Cashier Target exports['qb-target']:AddBoxZone("Cashier", Config.Locations["cashier"], 0.5, 0.5, { name = "Cashier", heading = 5, debugPoly = false, }, { options = { { event = "alizadev-beanmach:bill", icon = "fas fa-credit-card", label = Config.Locales["cashier_label"], job = "beanmachine", }, }, distance = 1.5 }) end) RegisterNetEvent('alizadev-beanmach:DrinksMenu', function(data) exports['qb-menu']:openMenu({ { header = Config.Locales["drinks_menu"], isMenuHeader = true, }, { header = Config.Locales["coffee_header"], txt = Config.Locales["coffee_recipe"], params = { event = "alizadev-beanmach:CreateCafe", args = { number = 0, } } }, { header = Config.Locales["latte_header"], txt = Config.Locales["latte_recipe"], params = { event = "alizadev-beanmach:CreateLatte", args = { number = 1, } } }, { header = Config.Locales["cappuccino_header"], txt = Config.Locales["cappuccino_recipe"], params = { event = "alizadev-beanmach:CreateCappuccino", args = { number = 2, } } }, { header = Config.Locales["mocha_header"], txt = Config.Locales["mocha_recipe"], params = { event = "alizadev-beanmach:CreateMocha", args = { number = 3, } } }, { header = Config.Locales["milkshake_header"], txt = Config.Locales["milkshake_recipe"], params = { event = "alizadev-beanmach:CreateCMilkshake", args = { number = 4, } } }, { header = Config.Locales["icetea_header"], txt = Config.Locales["icetea_recipe"], params = { event = "alizadev-beanmach:CreateIcetea", args = { number = 5, } } }, { header = "❌ " .. Config.Locales["close_menu"], txt = "", params = { event = "qb-menu:closeMenu", args = { number = 6, } } }, }) end) RegisterNetEvent('alizadev-beanmach:Fridge', function(data) exports['qb-menu']:openMenu({ { header = Config.Locales["storage_menu"], isMenuHeader = true, }, { header = "📦 " .. Config.Locales["fridge_menu"], txt = Config.Locales["open_fridge"], params = { event = "alizadev-beanmach:Storage", args = { number = 0, } } }, { header = "🛍️ " .. Config.Locales["shop_menu"], txt = Config.Locales["buy_items"], params = { event = "alizadev-beanmach:shop", args = { number = 1, } } }, { header = "❌ " .. Config.Locales["close_menu"], txt = "", params = { event = "qb-menu:closeMenu", args = { number = 2, } } }, }) end) RegisterNetEvent('alizadev-beanmach:FoodMenu', function(data) exports['qb-menu']:openMenu({ { header = Config.Locales["food_menu"], isMenuHeader = true, }, { header = Config.Locales["donut_header"], txt = Config.Locales["donut_recipe"], params = { event = "alizadev-beanmach:CreateDonut", args = { number = 0, } } }, { header = Config.Locales["croissant_header"], txt = Config.Locales["croissant_recipe"], params = { event = "alizadev-beanmach:CreateCroissant", args = { number = 1, } } }, { header = Config.Locales["cupcake_header"], txt = Config.Locales["cupcake_recipe"], params = { event = "alizadev-beanmach:CreateChocolateCupcake", args = { number = 2, } } }, { header = Config.Locales["cookie_header"], txt = Config.Locales["cookie_recipe"], params = { event = "alizadev-beanmach:CreateCookie", args = { number = 3, } } }, { header = "❌ " .. Config.Locales["close_menu"], txt = "", params = { event = "qb-menu:closeMenu", args = { number = 4, } } }, }) end) RegisterNetEvent("alizadev-beanmach:bill", function() local dialog = exports['qb-input']:ShowInput({ header = Config.Locales["bill_header"], submitText = Config.Locales["bill_submit"], inputs = { { type = 'number', isRequired = true, name = 'id', text = Config.Locales["bill_id"] }, { type = 'number', isRequired = true, name = 'amount', text = Config.Locales["bill_amount"] } } }) if dialog then if not dialog.id or not dialog.amount then return end TriggerServerEvent("alizadev-beanmach:bill:player", dialog.id, dialog.amount) end end)