diff --git a/resources/[inventory]/nordi_vending/client.lua b/resources/[inventory]/nordi_vending/client.lua index 269fa6e91..d295e422e 100644 --- a/resources/[inventory]/nordi_vending/client.lua +++ b/resources/[inventory]/nordi_vending/client.lua @@ -629,3 +629,45 @@ RegisterCommand('vendingdebug', function() end end, coords) end, false) + +-- Debug command to check props +RegisterCommand('checkvendingprops', function() + local playerPed = PlayerPedId() + local playerCoords = GetEntityCoords(playerPed) + local foundProps = 0 + + for _, propName in ipairs(Config.VendingProps) do + local hash = GetHashKey(propName) + local objects = GetGamePool('CObject') + + print("Checking for prop: " .. propName .. " (Hash: " .. hash .. ")") + + for _, obj in ipairs(objects) do + if GetEntityModel(obj) == hash then + local objCoords = GetEntityCoords(obj) + local dist = #(playerCoords - objCoords) + + if dist < 30.0 then + foundProps = foundProps + 1 + print("Found " .. propName .. " at distance: " .. dist) + + -- Add a temporary blip + local blip = AddBlipForEntity(obj) + SetBlipSprite(blip, 1) + SetBlipColour(blip, 2) + SetBlipScale(blip, 0.8) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(propName) + EndTextCommandSetBlipName(blip) + + -- Remove blip after 10 seconds + SetTimeout(10000, function() + RemoveBlip(blip) + end) + end + end + end + end + + QBCore.Functions.Notify('Found ' .. foundProps .. ' vending machines nearby', 'primary') +end, false)