diff --git a/README.md b/README.md index f8ff2dd..316045d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ By bridging core game systems including inventory, dispatch, targeting, door loc --- +![](https://img.shields.io/github/contributors/TheOrderFivem/community_bridge?logo=github) +![](https://img.shields.io/github/v/release/TheOrderFivem/community_bridge?logo=github) + + ## Features ### Framework Compatibility @@ -65,7 +69,7 @@ Join the Community Bridge Discord server for support, discussion, and contributi ## About Community Bridge -Community Bridge is developed by The Order of the Sacred Framework, a collaborative team focused on improving interoperability and reducing development friction in the FiveM ecosystem. The project is open source and licensed under GPLv3. +community_bridge is developed by The Order of the Sacred Framework, a collaborative team focused on improving interoperability and reducing development friction in the FiveM ecosystem. The project is open source and licensed under GPLv3. We also have a vscode extension located at https://marketplace.visualstudio.com/items?itemName=TheOrderOfTheSacredFramework.fivem-community-bridge-lua --- @@ -91,6 +95,9 @@ A: Community Bridge is designed to be extensible and supports integration with c **Q: How often is the project updated?** A: Updates are regularly released to improve compatibility, add features, and fix issues based on community feedback. +**Q: Why is the seo so bad?** +A: Straight up, I have no clue and have tried everything to improve it. If you have tips PLEASE let me know in the discord or pr some changes to the repos dev branch. + --- ## Keywords (for SEO) diff --git a/fxmanifest.lua b/fxmanifest.lua index bf7a89a..e124d02 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -5,7 +5,7 @@ use_experimental_fxv2_oal 'yes' author 'The Order of the Sacred Framework' name 'community_bridge' description 'A Universal Bridge for Our Community, created by a group of contributors with a shared vision to enhance both user and developer experiences. This bridge connects various frameworks, inventories, target systems, notification systems, and more, fostering compatibility and seamless integration.' -version '0.11.0' +version '0.11.1' shared_scripts { '@ox_lib/init.lua', diff --git a/lib/utility/shared/callbacks.lua b/lib/utility/shared/callbacks.lua index 196c86b..eea6fdc 100644 --- a/lib/utility/shared/callbacks.lua +++ b/lib/utility/shared/callbacks.lua @@ -67,11 +67,16 @@ if IsDuplicityVersion() then end RegisterNetEvent(EVENT_NAMES.CLIENT_TO_SERVER, function(name, callbackId, ...) + if not name or not callbackId then return print(string.format("[%s] Warning: Invalid callback parameters - name: %s, callbackId: %s", RESOURCE, tostring(name), tostring(callbackId))) end + local handler = Callback[name] if not handler then return end - local result = table.pack(handler(source, ...)) - TriggerClientEvent(EVENT_NAMES.CLIENT_RESPONSE, source, name, callbackId, table.unpack(result)) + local playerId = source + if not playerId or playerId == 0 then return print(string.format("[%s] Warning: Invalid source for callback '%s'", RESOURCE, name)) end + + local result = table.pack(handler(playerId, ...)) + TriggerClientEvent(EVENT_NAMES.CLIENT_RESPONSE, playerId, name, callbackId, table.unpack(result)) end) RegisterNetEvent(EVENT_NAMES.SERVER_RESPONSE, function(name, callbackId, ...) @@ -107,7 +112,7 @@ else if not callback then local result = Citizen.Await(promise) - return #result == 1 and result[1] or table.unpack(result) + return table.unpack(result) end end diff --git a/locales/en-pirate.json b/locales/en-pirate.json new file mode 100644 index 0000000..926caf3 --- /dev/null +++ b/locales/en-pirate.json @@ -0,0 +1,37 @@ +{ + "Shops": { + "NotEnoughMoney": "Ye don't have enough booty to plunder this here item", + "Input": "Amount o' Booty", + "PurchaseAmount": "Plunder Quantity", + "PurchasedItem": "Ye Have Plundered ", + "CurrencySymbol": "$ %s", + "Confirm": "Aye, Plunder!", + "AreYouSure": "Be ye sure ye want to plunder a %s?", + "PayByCash": "Pay %s with doubloons", + "PayByCard": "Pay %s with the magic card", + "CardIcon": "fa-solid fa-building-columns", + "CashIcon": "fa-solid fa-money-bill-wave", + "ShopIcon": "fa-solid fa-basket-shopping", + "ShopName": "Pirate's Emporium" + }, + "UNITTEST": { + "UNITTESTA": "I be a %s %s", + "locale-unit-test": "This be a test string, arrr!" + }, + "clipboard": { + "copy": "Copied to ye clipboard, matey!" + }, + "placeable_object": { + "no_prop_defined": "Ye didn't pick any booty to place, ye scallywag!", + "cant_place_here": "Ye can't be plunderin' here!", + "place_object_place": "[E] Place, arrr! \n", + "place_object_cancel": "[X] Abandon Ship! \n", + "place_object_scroll_up": "[Scroll Up] Turn starboard \n", + "place_object_scroll_down": "[Scroll Down] Turn port \n", + "object_place": "[%s] Place, arrr! \n", + "object_cancel": "[%s] Abandon Ship! \n", + "object_scroll_up": "[%s] Turn starboard \n", + "object_scroll_down": "[%s] Turn port \n", + "depth_modifier": "[%s] Depth Control, savvy? \n" + } +} diff --git a/modules/dispatch/kartik-mdt/client/client.lua b/modules/dispatch/kartik-mdt/client/client.lua new file mode 100644 index 0000000..596aa93 --- /dev/null +++ b/modules/dispatch/kartik-mdt/client/client.lua @@ -0,0 +1,30 @@ +---@diagnostic disable: duplicate-set-field +if GetResourceState('kartik-mdt') == 'missing' then return end +Dispatch = Dispatch or {} + +Dispatch.SendAlert = function(data) + local repackJobsBools = {} + for k, v in pairs(data.jobs) do + if v then + repackJobsBools[k] = true + end + end + local alertOptions = { + title = data.message or "Alert", + code = data.code or '10-80', + description = data.message, + type = "Alert", + coords = data.coords, + blip = { + radius = 100.0, + sprite = data.blipData.sprite or 161, + color = data.blipData.color or 1, + scale = data.blipData.scale or 0.8, + length = 2 + }, + jobs = repackJobsBools, + } + exports['kartik-mdt']:CustomAlert(alertOptions) +end + +return Dispatch \ No newline at end of file diff --git a/modules/dispatch/kartik-mdt/server/server.lua b/modules/dispatch/kartik-mdt/server/server.lua new file mode 100644 index 0000000..9567f5d --- /dev/null +++ b/modules/dispatch/kartik-mdt/server/server.lua @@ -0,0 +1,4 @@ +if GetResourceState('kartik-mdt') == 'missing' then return end +Dispatch = Dispatch or {} + +return Dispatch \ No newline at end of file diff --git a/modules/target/qb-target/client.lua b/modules/target/qb-target/client.lua index 2aed360..158ff0d 100644 --- a/modules/target/qb-target/client.lua +++ b/modules/target/qb-target/client.lua @@ -61,7 +61,10 @@ end ---@param options table Target.AddGlobalPed = function(options) options = Target.FixOptions(options) - qb_target:AddGlobalPed(options) + qb_target:AddGlobalPed({ + options = options, + distance = options.distance or 1.5 + }) end ---This will remove target options from all peds. This is useful for when you want to remove target options from all peds.