From 5cbde7cc0694a7aa1d2375686c0b3b62886cc8a5 Mon Sep 17 00:00:00 2001 From: bicatcho11 <151503460+bicatcho11@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:29:11 +0300 Subject: [PATCH] delete vending machine and transfer to qb-shops --- client/main.lua | 51 ------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/client/main.lua b/client/main.lua index 3cbced90..ac506bea 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, {