fix createCallback complaining on client side

This commit is contained in:
Jim Shield
2025-03-07 13:29:43 +00:00
committed by GitHub
parent c947993e9e
commit daa9dca142

View File

@@ -13,6 +13,7 @@
--- end) --- end)
--- ``` --- ```
function createCallback(callbackName, funct) function createCallback(callbackName, funct)
if isServer() then
if isStarted(OXLibExport) then if isStarted(OXLibExport) then
lib.callback.register(callbackName, funct) lib.callback.register(callbackName, funct)
else else
@@ -30,6 +31,7 @@ function createCallback(callbackName, funct)
print("^6Bridge^7: ^1ERROR^7: ^3Can't find any script to register callback with", callbackName) print("^6Bridge^7: ^1ERROR^7: ^3Can't find any script to register callback with", callbackName)
end end
end end
end
end end
--- Triggers a server callback and returns the result. --- Triggers a server callback and returns the result.