mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-29 21:14:44 +00:00
fix(cache): ped not triggering update event
This commit is contained in:
1 parent
6b8b7990c8
commit
cdc7523146
1 file changed
+1
-8
Vendored
+1
-8
@@ -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