check up Spawn Clear

Kakarot made it for me one day
This commit is contained in:
vanillaa
2021-12-30 23:44:12 +02:00
committed by GitHub
parent 02a46247cb
commit 1b2b1b3483
+14
View File
@@ -402,6 +402,20 @@ function QBCore.Functions.GetPlate(vehicle)
return QBCore.Shared.Trim(GetVehicleNumberPlateText(vehicle))
end
function QBCore.Functions.SpawnClear(coords, radius)
local vehicles = GetGamePool('CVehicle')
local closeVeh = {}
for i=1, #vehicles, 1 do
local vehicleCoords = GetEntityCoords(vehicles[i])
local distance = #(vehicleCoords - coords)
if distance <= radius then
closeVeh[#closeVeh + 1] = vehicles[i]
end
end
if #closeVeh > 0 then return false end
return true
end
function QBCore.Functions.GetVehicleProperties(vehicle)
if DoesEntityExist(vehicle) then
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)