Cache and entities update

added cache system similar to others that are readily available. Included beginings of reworked rebound entities
This commit is contained in:
gononono64 committed 2025-04-23 14:10:19 -05:00
1 parent b9842eedfe
commit 89858c6d73
16 files changed
+589 -207

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
Bridge.Cache.OnChange("Ped", function(newValue, oldValue)
print("Ped changed from " .. tostring(oldValue) .. " to " .. tostring(newValue))
end)
end
end)
RegisterCommand("testcache", function(source, args, rawCommand)
-- local cache = Bridge.Cache.Get("Ped")
Bridge.Cache.Create("TestCache", function()
return math.random(1, 100)
end, 1000)
Bridge.Cache.OnChange("TestCache", function(newValue, oldValue)
print("TestCache changed from " .. tostring(oldValue) .. " to " .. tostring(newValue))
end)
end)