Files
overextended.github.io/docs/ox_lib/Client/cache.md
T
Linden 6bead3ca32 Consistent indentation and remove some files
Mixing tabs and spaces when embedding Lua can easily break MDX syntax.
2022-04-29 15:39:04 +10:00

604 B

Cache

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.

https://github.com/overextended/ox_lib/blob/master/resource/cache/client.lua

States

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.

lib.onCache('vehicle', function(value)
    print('vehicle', value)
end)

lib.onCache('seat', function(value)
    print('seat', value)
end)