diff --git a/frameworkCache.lua b/frameworkCache.lua index 08180db..011be7f 100644 --- a/frameworkCache.lua +++ b/frameworkCache.lua @@ -462,7 +462,7 @@ local invWeightTable = { [Exports.PSInv] = { file = "config.lua", path = { "MaxInventoryWeight" }, slotPath = { "MaxInventorySlots" } }, [Exports.TgiannInv] = { file = "configs/config.lua", path = { "slotsMaxWeights", "player", "maxWeight" }, slotPath = { "slotsMaxWeights", "player", "slots" } }, [Exports.CodeMInv] = { file = "config/config.lua", path = { "MaxWeight" }, slotPath = { "MaxSlots" } }, - [Exports.RSGInv] = { file = "config/config.lua", path = { "MaxWeight" }, slotPath = { "MaxSlots" } }, + [Exports.RSGInv] = { file = "shared/config.lua", path = { "MaxWeight" }, slotPath = { "MaxSlots" } }, --[Exports.OrigenInv] = { file = "config.lua", path = { "MaxWeight" } }, } diff --git a/shared/_eventDebug.lua b/shared/_eventDebug.lua index 524ab20..17d8d1c 100644 --- a/shared/_eventDebug.lua +++ b/shared/_eventDebug.lua @@ -57,8 +57,8 @@ function RegisterNetEvent(name, funct) end function TriggerEvent(name, ...) - local data = {...} if Config.System.EventDebug then + local data = {...} if name:find("__cfx_export") then print("^6Bridge^7: "..GetPrintTime().." ^2Triggering ^3"..(isServer() and "Server" or "Client").." ^2Export^7: ^6"..name:gsub("__cfx_export_", ""):gsub("%:", "^7:^4").."^7"..getDebugInfo(debug.getinfo(2, "nSl"))) else @@ -74,8 +74,8 @@ function TriggerEvent(name, ...) end function TriggerServerEvent(name, ...) -- Client side, trigger a server event - local data = {...} if Config.System.EventDebug then + local data = {...} if name:find("__ox_cb") then print("^6Bridge^7: "..GetPrintTime().." ^2Triggered ^3Server ^2Callback: ^6"..name:gsub("__ox_cb_", "").."^7"..getDebugInfo(debug.getinfo(2, "nSl"))) else @@ -91,8 +91,8 @@ function TriggerServerEvent(name, ...) -- Client side, trigger a server event end function TriggerClientEvent(name, ...) -- Server side, trigger a client event - local data = {...} if Config.System.EventDebug then + local data = {...} if name:find("__ox_cb") then print("^6Bridge^7: "..GetPrintTime().." ^2Triggered ^3Client ^2Callback: ^6"..name:gsub("__ox_cb_", "").."^7"..getDebugInfo(debug.getinfo(2, "nSl"))) else diff --git a/shared/_scriptversioncheck.lua b/shared/_scriptversioncheck.lua index 8cab90f..177b748 100644 --- a/shared/_scriptversioncheck.lua +++ b/shared/_scriptversioncheck.lua @@ -33,8 +33,9 @@ if not SUPPRESS_UPDATES then end local scriptName = ("^2"..capitalize(getScript()):gsub("%-", "^7-^2"):gsub("%_", "^7_^2")) or "" - local scriptVersion = ("^5"..GetResourceMetadata(getScript(), 'version', nil):gsub("%.", "^7.^5")) or "" - local scriptDescription = ("^2"..GetResourceMetadata(getScript(), 'description', nil)) or "" + local rawVersion = GetResourceMetadata(getScript(), 'version', nil) or "?" + local scriptVersion = ("^5"..rawVersion:gsub("%.", "^7.^5")) or "" + local scriptDescription = ("^2"..(GetResourceMetadata(getScript(), 'description', nil) or "")) or "" local scriptAuthor = ("^2by ^4"..GetResourceMetadata(getScript(), 'author', nil):gsub("%and", "^7and^4")) or "" print(scriptName.." ^7v"..scriptVersion.."^7 - "..scriptDescription.." "..scriptAuthor.."^7") diff --git a/shared/notify.lua b/shared/notify.lua index cdd95ae..97f15c2 100644 --- a/shared/notify.lua +++ b/shared/notify.lua @@ -117,8 +117,10 @@ function triggerNotify(title, message, type, src) end if src then + if Config.System.EventDebug then print(tostring(title).." - "..tostring(message).." - "..tostring(type).." - "..tostring(src)) end notifyFunc[Config.System.Notify].server(title, message, type, src) else + if Config.System.EventDebug then print(tostring(title).." - "..tostring(message).." - "..tostring(type).." - "..tostring(src)) end notifyFunc[Config.System.Notify].client(title, message, type) end end diff --git a/shared/playerfunctions.lua b/shared/playerfunctions.lua index 8a52611..d8473c5 100644 --- a/shared/playerfunctions.lua +++ b/shared/playerfunctions.lua @@ -929,6 +929,31 @@ function getPlayer(source) return Player end +--- Finds an online player by their citizen ID. +--- +--- Iterates all connected players and returns the matching player info table +--- (the same shape as getPlayer()). Returns nil if nobody matches. +--- @param citizenId string The citizen ID to search for. +--- @return table|nil player The matching player info table. +--- @return number|nil src The matching player's server ID. +--- +--- @usage +--- ```lua +--- local player, src = getPlayerByCitizenId("ABC12345") +--- if player then print("Found", player.name) end +--- ``` +function getPlayerByCitizenId(citizenId) + if not citizenId then return nil, nil end + for _, v in ipairs(GetPlayers()) do + local src = tonumber(v) + local Player = getPlayer(src) + if Player and Player.citizenId == citizenId then + return Player, src + end + end + return nil, nil +end + --- Retrieves all active players within a given radius from the specified coordinates. --- --- @param coords vector3 The reference coordinates.