diff --git a/docs/ox_lib/Client/cache.md b/docs/ox_lib/Client/cache.md index 078c7556..a6929cce 100644 --- a/docs/ox_lib/Client/cache.md +++ b/docs/ox_lib/Client/cache.md @@ -3,12 +3,23 @@ Caches data related to the player and handling some events or statebags. An interval runs every 100ms to update data that cannot be checked via handlers. -Still a work-in-progress and does not have any API or events. -https://github.com/overextended/ox_lib/blob/master/resource/states/client.lua +https://github.com/overextended/ox_lib/blob/master/resource/cache/client.lua ## States ```lua -cache.ped = PlayerPedId() -cache.vehicle = GetVehiclePedIsIn(cache.ped, false) -cache.driver = GetPedInVehicleSeat(cache.vehicle, -1) == cache.ped +cache.ped -- player entity id +cache.vehicle -- vehicle entity id +cache.seat -- vehicle seat index +``` + +## lib.onCache +Register a callback function when the value is changed. +```lua +lib.onCache('vehicle', function(value) + print('vehicle', value) +end) + +lib.onCache('seat', function(value) + print('seat', value) +end) ``` diff --git a/docs/ox_lib/Client/streaming.md b/docs/ox_lib/Client/streaming.md index cb877b64..07b6d952 100644 --- a/docs/ox_lib/Client/streaming.md +++ b/docs/ox_lib/Client/streaming.md @@ -1,7 +1,7 @@ # Streaming Check if assets exist, such as models, and loads them into memory. -Throws errors for invalid assets and returns false if it could not be loaded. +Throws errors for invalid assets and returns true if the asset is loaded. ### lib.requestAnimDict ```lua