migrate cache.ped to PlayerPedId()

This commit is contained in:
MrNewb committed 2025-07-28 01:37:52 -04:00
1 parent eb8a7e4449
commit 88b4daa2e8
7 files changed
+30 -21

No files matched your search

+2 -1
View File
@@ -6,10 +6,11 @@ Doorlock = Doorlock or {}
---This will get the closest door to the ped
---@return string | nil
Doorlock.GetClosestDoor = function()
local ped = PlayerPedId()
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 pedCoords = GetEntityCoords(ped)
local door = 0
local doorDist = 1000.0
for doorID, data in pairs(allDoors) do
+2 -1
View File
@@ -6,8 +6,9 @@ Doorlock = Doorlock or {}
---This will get the closest door to the ped
---@return string | nil
Doorlock.GetClosestDoor = function()
local ped = PlayerPedId()
local allDoors = exports.rcore_doorlock:getLoadedDoors()
local pedCoords = GetEntityCoords(cache.ped)
local pedCoords = GetEntityCoords(ped)
local door = 0
local doorDist = 1000.0
for _, data in pairs(allDoors) do