diff --git a/resources/[inventory]/muhaddil-machines/client.lua b/resources/[inventory]/muhaddil-machines/client.lua index 3df4694ba..727c06d2e 100644 --- a/resources/[inventory]/muhaddil-machines/client.lua +++ b/resources/[inventory]/muhaddil-machines/client.lua @@ -416,57 +416,72 @@ end local function setupTargeting() for vendingMachineName, data in pairs(Config.machines) do - local options = { - { - label = "Abrir Máquina Expendedora", - icon = 'fa-solid fa-basket-shopping', - onSelect = function(d) - if buying then return end - local entity = d.entity - showVendingMenu(vendingMachineName, entity, data.items) - end - } - } - - exports.ox_target:addModel(joaat(data.model), options) + exports['qb-target']:AddTargetModel(data.model, { + options = { + { + type = "client", + icon = "fas fa-basket-shopping", + label = "Abrir Máquina Expendedora", + action = function(entity) + if buying then return end + showVendingMenu(vendingMachineName, entity, data.items) + end + } + }, + distance = 2.0 + }) end for standName, data in pairs(Config.Stands) do - local options = { - { - label = "Abrir Puesto de Comida", - icon = 'fa-solid fa-utensils', - onSelect = function(d) - if buying then return end - local entity = d.entity - standMenu(standName, entity, data.items) - end - } - } - - exports.ox_target:addModel(joaat(data.model), options) + exports['qb-target']:AddTargetModel(data.model, { + options = { + { + type = "client", + icon = "fas fa-utensils", + label = "Abrir Puesto de Comida", + action = function(entity) + if buying then return end + standMenu(standName, entity, data.items) + end + } + }, + distance = 2.0 + }) end for newsName, data in pairs(Config.NewsSellers) do - local options = { - { - label = "Abrir Venta de Noticias", - icon = 'fa-solid fa-newspaper', - onSelect = function(d) - if buying then return end - local entity = d.entity - newsMenu(newsName, entity, data.items) - end - } - } - - exports.ox_target:addModel(joaat(data.model), options) + exports['qb-target']:AddTargetModel(data.model, { + options = { + { + type = "client", + icon = "fas fa-newspaper", + label = "Abrir Venta de Noticias", + action = function(entity) + if buying then return end + newsMenu(newsName, entity, data.items) + end + } + }, + distance = 2.0 + }) + end +end + +local function WaterCoolerTarget() + for waterCoolerName, data in pairs(Config.WaterCoolers) do + exports['qb-target']:AddTargetModel(data.model, { + options = { + { + type = "client", + icon = "fas fa-glass-water", + label = "Beber Agua", + action = function(entity) + interactWithWaterCooler(entity) + end + } + }, + distance = 2.0 + }) end end -CreateThread(function() - Wait(100) - setupTargeting() - WaterCoolerTarget() - -- standsTarget() -end)