casing, RegisterModule adjustments, remove duplicate utilities table
This commit is contained in:
1 parent
515d4412b1
commit
733271562d
75 files changed
+1739
-14
No files matched your search
@@ -0,0 +1,20 @@
|
||||
if GetResourceState('qb-doorlock') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.GetClosestDoor = function()
|
||||
local closestDoor = exports["qb-doorlock"]:GetClosestDoor()
|
||||
if Table.CheckPopulated(closestDoor) then return closestDoor end
|
||||
local allDoors = exports["qb-doorlock"]:GetDoorList()
|
||||
local pedCoords = GetEntityCoords(cache.ped)
|
||||
local door = 0
|
||||
local doorDist = 1000.0
|
||||
for doorID, data in pairs(allDoors) do
|
||||
local dist = #(pedCoords - data.objCoords)
|
||||
if dist < doorDist then
|
||||
door = doorID
|
||||
doorDist = dist
|
||||
end
|
||||
end
|
||||
return door
|
||||
end
|
||||
Reference in new issue
Block a user