Return modules folder
-- Was a git prefrences thing and needed cleaned up
This commit is contained in:
1 parent
48f5c70039
commit
8f6fa1e291
95 files changed
+4254
No files matched your search
@@ -0,0 +1,7 @@
|
||||
if GetResourceState('doors_creator') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.GetClosestDoor = function()
|
||||
return exports["doors_creator"]:getClosestActiveDoor()
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
if GetResourceState('doors_creator') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||
local state = toggle
|
||||
if state then
|
||||
exports["doors_creator"]:setDoorState(doorID, 1)
|
||||
else
|
||||
exports["doors_creator"]:setDoorState(doorID, 0)
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
if GetResourceState('ox_doorlock') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.GetClosestDoor = function()
|
||||
return exports.ox_doorlock:getClosestDoor()
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
if GetResourceState('ox_doorlock') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||
local state = toggle
|
||||
if state then
|
||||
exports.ox_doorlock:setDoorState(doorID, 1)
|
||||
else
|
||||
exports.ox_doorlock:setDoorState(doorID, 0)
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
if GetResourceState('qb-doorlock') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||
TriggerClientEvent('qb-doorlock:client:setState', -1, 0, doorID, toggle, false, false, false)
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
if GetResourceState('rcore_doorlock') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.GetClosestDoor = function()
|
||||
local allDoors = exports.rcore_doorlock:getLoadedDoors()
|
||||
local pedCoords = GetEntityCoords(cache.ped)
|
||||
local door = 0
|
||||
local doorDist = 1000.0
|
||||
for _, data in pairs(allDoors) do
|
||||
local dist = #(pedCoords - data.coords)
|
||||
if dist < doorDist then
|
||||
door = data.id
|
||||
doorDist = dist
|
||||
end
|
||||
end
|
||||
return door
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
if GetResourceState('rcore_doorlock') ~= 'started' then return end
|
||||
|
||||
Doorlock = Doorlock or {}
|
||||
|
||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||
local state = toggle
|
||||
if state then
|
||||
exports.rcore_doorlock:changeDoorState(doorID, 0)
|
||||
else
|
||||
exports.rcore_doorlock:changeDoorState(doorID, 1)
|
||||
end
|
||||
return true
|
||||
end
|
||||
Reference in new issue
Block a user