diff --git a/client/main.lua b/client/main.lua index 3cbced908..ac506beaf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -55,32 +55,6 @@ end exports('HasItem', HasItem) ----Gets the closest vending machine object to the client ----@return integer closestVendingMachine -local function GetClosestVending() - local ped = PlayerPedId() - local pos = GetEntityCoords(ped) - local object = nil - for _, machine in pairs(Config.VendingObjects) do - local ClosestObject = GetClosestObjectOfType(pos.x, pos.y, pos.z, 0.75, joaat(machine), false, false, false) - if ClosestObject ~= 0 then - if object == nil then - object = ClosestObject - end - end - end - return object -end - ----Opens the vending machine shop -local function OpenVending() - local ShopItems = {} - ShopItems.label = 'Vending Machine' - ShopItems.items = Config.VendingItem - ShopItems.slots = #Config.VendingItem - TriggerServerEvent('inventory:server:OpenInventory', 'shop', 'Vendingshop_' .. math.random(1, 99), ShopItems) -end - ---Draws 3d text in the world on the given position ---@param x number The x coord of the text to draw ---@param y number The y coord of the text to draw @@ -676,8 +650,6 @@ RegisterCommand('inventory', function() if not PlayerData.metadata['isdead'] and not PlayerData.metadata['inlaststand'] and not PlayerData.metadata['ishandcuffed'] and not IsPauseMenuActive() then local ped = PlayerPedId() local curVeh = nil - local VendingMachine = nil - if not Config.UseTarget then VendingMachine = GetClosestVending() end if IsPedInAnyVehicle(ped, false) then -- Is Player In Vehicle local vehicle = GetVehiclePedIsIn(ped, false) @@ -729,12 +701,6 @@ RegisterCommand('inventory', function() TriggerServerEvent('inventory:server:OpenInventory', 'glovebox', CurrentGlovebox) elseif CurrentDrop ~= 0 then TriggerServerEvent('inventory:server:OpenInventory', 'drop', CurrentDrop) - elseif VendingMachine then - local ShopItems = {} - ShopItems.label = 'Vending Machine' - ShopItems.items = Config.VendingItem - ShopItems.slots = #Config.VendingItem - TriggerServerEvent('inventory:server:OpenInventory', 'shop', 'Vendingshop_' .. math.random(1, 99), ShopItems) else openAnim() TriggerServerEvent('inventory:server:OpenInventory') @@ -993,23 +959,6 @@ CreateThread(function() end end) -CreateThread(function() - if Config.UseTarget then - exports['qb-target']:AddTargetModel(Config.VendingObjects, { - options = { - { - icon = 'fa-solid fa-cash-register', - label = Lang:t('menu.vending'), - action = function() - OpenVending() - end - }, - }, - distance = 2.5 - }) - end -end) - CreateThread(function() if Config.UseTarget then exports['qb-target']:AddTargetModel(Config.CraftingObject, { diff --git a/config.lua b/config.lua index d5990dc8a..3929d6fcf 100644 --- a/config.lua +++ b/config.lua @@ -15,37 +15,12 @@ Config.MaxDropViewDistance = 12.5 -- The distance in GTA Units tha Config.UseItemDrop = false -- This will enable item object to spawn on drops instead of markers Config.ItemDropObject = `prop_nigel_bag_pickup` -- if Config.UseItemDrop is true, this will be the prop that spawns for the item -Config.VendingObjects = { - 'prop_vend_soda_01', - 'prop_vend_soda_02', - 'prop_vend_water_01' -} - Config.BinObjects = { 'prop_bin_05a', } Config.CraftingObject = `prop_toolchest_05` -Config.VendingItem = { - { - name = 'kurkakola', - price = 4, - amount = 50, - info = {}, - type = 'item', - slot = 1, - }, - { - name = 'water_bottle', - price = 4, - amount = 50, - info = {}, - type = 'item', - slot = 2, - }, -} - -- See the vehicle class here: https://docs.fivem.net/natives/?_0x29439776AAA00A62 -- The template: -- [vehicleClass] = {slots = [number], maxWeight = [number]}