mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-18 14:26:03 +01:00
small tidy up
This commit is contained in:
@@ -82,12 +82,15 @@ end
|
|||||||
--- end)
|
--- end)
|
||||||
--- ```
|
--- ```
|
||||||
function onPlayerUnload(func)
|
function onPlayerUnload(func)
|
||||||
|
debugPrint("^6Bridge^7: ^2Registering ^3onPlayerUnload^7()")
|
||||||
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() func() end)
|
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() func() end)
|
||||||
|
|
||||||
RegisterNetEvent('ox:playerLogout', function() func() end)
|
RegisterNetEvent('ox:playerLogout', function() func() end)
|
||||||
|
|
||||||
RegisterNetEvent('RSGCore:Client:OnPlayerUnload', function() func() end)
|
RegisterNetEvent('RSGCore:Client:OnPlayerUnload', function() func() end)
|
||||||
|
|
||||||
RegisterNetEvent('esx:onPlayerLogout', function() func() end)
|
RegisterNetEvent('esx:onPlayerLogout', function() func() end)
|
||||||
-- ^ Only server side for now, need a way to send it to client if not already available
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
--- ```
|
--- ```
|
||||||
function createCallback(callbackName, funct)
|
function createCallback(callbackName, funct)
|
||||||
if isServer() then
|
if isServer() then
|
||||||
debugPrint("^6Bridge^7: ^3Registering callback^7:", callbackName)
|
debugPrint("^6Bridge^7: ^2Registering ^3Callback^7:", callbackName)
|
||||||
if isStarted(OXLibExport) then
|
if isStarted(OXLibExport) then
|
||||||
lib.callback.register(callbackName, funct)
|
lib.callback.register(callbackName, funct)
|
||||||
else
|
else
|
||||||
@@ -64,7 +64,7 @@ end
|
|||||||
--- ```
|
--- ```
|
||||||
function triggerCallback(callbackName, ...)
|
function triggerCallback(callbackName, ...)
|
||||||
local result = nil
|
local result = nil
|
||||||
debugPrint("^6Bridge^7: ^3Triggering callback^7:", callbackName)
|
debugPrint("^6Bridge^7: ^2Triggering ^3Callback^7:", callbackName)
|
||||||
if isStarted(OXLibExport) then
|
if isStarted(OXLibExport) then
|
||||||
result = lib.callback.await(callbackName, false, ...)
|
result = lib.callback.await(callbackName, false, ...)
|
||||||
elseif isStarted(QBExport) then
|
elseif isStarted(QBExport) then
|
||||||
|
|||||||
Reference in New Issue
Block a user