mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-18 22:36:04 +01:00
Update callback.lua
This commit is contained in:
@@ -24,8 +24,8 @@
|
|||||||
--- ```
|
--- ```
|
||||||
function createCallback(callbackName, funct)
|
function createCallback(callbackName, funct)
|
||||||
if isServer() then
|
if isServer() then
|
||||||
debugPrint("^6Bridge^7: ^2Registering ^3Callback^7:", callbackName)
|
|
||||||
if isStarted(OXLibExport) then
|
if isStarted(OXLibExport) then
|
||||||
|
debugPrint("^6Bridge^7: ^2Registering ^4"..OXLibExport.." ^3Callback^7:", callbackName)
|
||||||
lib.callback.register(callbackName, funct)
|
lib.callback.register(callbackName, funct)
|
||||||
else
|
else
|
||||||
local adaptedFunction = function(source, cb, ...)
|
local adaptedFunction = function(source, cb, ...)
|
||||||
@@ -34,9 +34,11 @@ function createCallback(callbackName, funct)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if isStarted(QBExport) then
|
if isStarted(QBExport) then
|
||||||
|
debugPrint("^6Bridge^7: ^2Registering ^4"..QBExport.." ^3Callback^7:", callbackName)
|
||||||
Core = Core or exports[QBExport]:GetCoreObject()
|
Core = Core or exports[QBExport]:GetCoreObject()
|
||||||
Core.Functions.CreateCallback(callbackName, adaptedFunction)
|
Core.Functions.CreateCallback(callbackName, adaptedFunction)
|
||||||
elseif isStarted(ESXExport) then
|
elseif isStarted(ESXExport) then
|
||||||
|
debugPrint("^6Bridge^7: ^2Registering ^4"..ESXExport.." ^3Callback^7:", callbackName)
|
||||||
ESX.RegisterServerCallback(callbackName, adaptedFunction)
|
ESX.RegisterServerCallback(callbackName, adaptedFunction)
|
||||||
else
|
else
|
||||||
print("^1ERROR^7: ^1Can't find any supported framework to register callback with^7: "..callbackName)
|
print("^1ERROR^7: ^1Can't find any supported framework to register callback with^7: "..callbackName)
|
||||||
|
|||||||
Reference in New Issue
Block a user