mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 16:06:02 +01:00
fix(cache): ped not triggering update event
This commit is contained in:
9
resource/cache/client.lua
vendored
9
resource/cache/client.lua
vendored
@@ -1,12 +1,5 @@
|
|||||||
local cache = {}
|
local cache = {}
|
||||||
|
|
||||||
function cache:getPed()
|
|
||||||
local ped = PlayerPedId()
|
|
||||||
if ped ~= self.ped then
|
|
||||||
self.ped = ped
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function cache:getVehicle()
|
function cache:getVehicle()
|
||||||
local vehicle = GetVehiclePedIsIn(self.ped, false)
|
local vehicle = GetVehiclePedIsIn(self.ped, false)
|
||||||
if vehicle > 0 then
|
if vehicle > 0 then
|
||||||
@@ -51,7 +44,7 @@ end
|
|||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
cache:getPed()
|
cache:set('ped', PlayerPedId())
|
||||||
cache:getVehicle()
|
cache:getVehicle()
|
||||||
|
|
||||||
-- if not cache.vehicle then
|
-- if not cache.vehicle then
|
||||||
|
|||||||
Reference in New Issue
Block a user