forked from Simnation/Main
Update client.lua
This commit is contained in:
parent
1c55430622
commit
bd4d8afd3f
1 changed files with 42 additions and 0 deletions
|
@ -629,3 +629,45 @@ RegisterCommand('vendingdebug', function()
|
||||||
end
|
end
|
||||||
end, coords)
|
end, coords)
|
||||||
end, false)
|
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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue