Fix QBCore.Debug not printing correct invoking resource name

This commit is contained in:
Jellyton
2022-12-28 02:39:18 +00:00
parent b76160ca1e
commit 58ab2f6cbd
+2 -3
View File
@@ -25,15 +25,14 @@ local function tPrint(tbl, indent)
end
end
RegisterServerEvent('QBCore:DebugSomething', function(tbl, indent)
local resource = GetInvokingResource() or "qb-core"
RegisterServerEvent('QBCore:DebugSomething', function(tbl, indent, resource)
print(('\x1b[4m\x1b[36m[ %s : DEBUG]\x1b[0m'):format(resource))
tPrint(tbl, indent)
print('\x1b[4m\x1b[36m[ END DEBUG ]\x1b[0m')
end)
function QBCore.Debug(tbl, indent)
TriggerEvent('QBCore:DebugSomething', tbl, indent)
TriggerEvent('QBCore:DebugSomething', tbl, indent, GetInvokingResource() or "qb-core")
end
function QBCore.ShowError(resource, msg)