1
0
Fork 0
forked from Simnation/Main

Update client.lua

This commit is contained in:
Nordi98 2025-07-29 09:39:15 +02:00
parent 1c55430622
commit bd4d8afd3f

View file

@ -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)