diff --git a/documentation/main_functions/wrapperfunctions.md b/documentation/main_functions/wrapperfunctions.md index a528f55..d3ef036 100644 --- a/documentation/main_functions/wrapperfunctions.md +++ b/documentation/main_functions/wrapperfunctions.md @@ -1,6 +1,6 @@ ### wrapperfunctions.lua -Provides wrapper compatibility functions for command and inventory stash systems across different frameworks (OX, QB, ESX, QS, etc). +Provides wrapper compatibility functions for command and inventory stash systems across different frameworks (OX, QB, ESX, etc). - **registerCommand(command, options)** @@ -23,7 +23,7 @@ Provides wrapper compatibility functions for command and inventory stash systems - **registerStash(name, label, slots?, weight?, owner?, coords?)** ⚠️ Server Side Only - - Registers a stash using OX, QS, or Origen inventory systems. + - Registers a stash using OX, or Origen inventory systems. - **Example:** ```lua registerStash( diff --git a/frameworkCache.lua b/frameworkCache.lua index 3b8bb8d..08180db 100644 --- a/frameworkCache.lua +++ b/frameworkCache.lua @@ -15,7 +15,6 @@ local Exports = { OXInv = "ox_inventory", QBInv = "qb-inventory", PSInv = "ps-inventory", - QSInv = "qs-inventory", CoreInv = "core_inventory", CodeMInv = "codem-inventory", OrigenInv = "origen_inventory", @@ -149,11 +148,8 @@ local itemFunc = { -- If this is nil, they need to update to qbx_core 1.23.0+ if not cache.Items then -- if their inventory doesn't allow that (they refuse to update their butchered core replacement): - if GetResourceState(Exports.QSInv):find("start") then - itemResource = Exports.QSInv - cache.Items = exports[Exports.QSInv]:GetItemList() - elseif GetResourceState(Exports.OrigenInv):find("start") then + if GetResourceState(Exports.OrigenInv):find("start") then itemResource = Exports.OrigenInv cache.Items = exports[Exports.OrigenInv]:Items() @@ -179,14 +175,10 @@ local itemFunc = { }, { script = Exports.ESXExport, cacheItem = function() - if GetResourceState(Exports.QSInv):find("start") then - cache.Items = exports[Exports.QSInv]:GetItemList() - else + cache.Items = ESX.GetItems() + while not next(cache.Items) do cache.Items = ESX.GetItems() - while not next(cache.Items) do - cache.Items = ESX.GetItems() - Wait(1000) - end + Wait(1000) end end, }, @@ -437,9 +429,7 @@ local function getInventoryConfig(resource, data) } local fn, err = load(content, '@'..data.file, 't', env) - --local success, err = xpcall(fn, function(e) - -- print(debug.traceback("Error while executing qs-inventory config:\n" .. tostring(e), 2)) - --end) + if not fn then return nil, "Failed to compile config: " .. err end if not pcall(fn) then return nil, "Error executing config file" end @@ -470,7 +460,6 @@ local invWeightTable = { }, [Exports.JPRInv] = { file = "configs/main_config.lua", path = { "MaxInventoryWeight" }, slotPath = { "MaxInventorySlots" } }, [Exports.PSInv] = { file = "config.lua", path = { "MaxInventoryWeight" }, slotPath = { "MaxInventorySlots" } }, - [Exports.QSInv] = { file = "config/config.lua", path = { "InventoryWeight", "weight" }, slotPath = { "InventoryWeight", "slots" } }, [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" } }, diff --git a/shared/coreloader.lua b/shared/coreloader.lua index 349b866..9e0f8c0 100644 --- a/shared/coreloader.lua +++ b/shared/coreloader.lua @@ -10,11 +10,10 @@ OXLibExport, QBXExport, QBExport, ESXExport, OXCoreExport = Exports.ESXExport or "", Exports.OXCoreExport or "" -OXInv, QBInv, PSInv, QSInv, CoreInv, CodeMInv, OrigenInv, TgiannInv, JPRInv = +OXInv, QBInv, PSInv, CoreInv, CodeMInv, OrigenInv, TgiannInv, JPRInv = Exports.OXInv or "", Exports.QBInv or "", Exports.PSInv or "", - Exports.QSInv or "", Exports.CoreInv or "", Exports.CodeMInv or "", Exports.OrigenInv or "", diff --git a/shared/itemcontrol.lua b/shared/itemcontrol.lua index 9a4a979..4b7f228 100644 --- a/shared/itemcontrol.lua +++ b/shared/itemcontrol.lua @@ -118,99 +118,6 @@ local InvFunc = { end, }, - { invName = QSInv, - removeItem = - function(src, item, remamount) - exports[QSInv]:RemoveItem(src, item, remamount) - end, - addItem = - function(src, item, amountToAdd, info, slot) - exports[QSInv]:AddItem(src, item, amountToAdd, slot, info) - end, - setItemMetadata = - function(data, src) - exports[QSInv]:SetItemMetadata(src, data.slot, data.metadata) - end, - hasItem = - function(item, amount, src) - if src then - local serverItemCheck = exports[QSInv]:GetItemTotalAmount(src, item) or 0 - return serverItemCheck >= amount, serverItemCheck - else - local localItemCheck = exports[QSInv]:Search(item) or 0 - return localItemCheck >= amount, localItemCheck - end - end, - canCarry = - function(itemTable, src) - local resultTable = {} - for k, v in pairs(itemTable) do - resultTable[k] = exports[QSInv]:CanCarryItem(src, k, v) - end - return resultTable - end, - getMaxInvWeight = - function() - return InventoryWeight - end, - getPlayerInv = - function(src) - local grabInv = nil - if src then - grabInv = exports[QSInv]:GetInventory(src) - else - grabInv = exports[QSInv]:getUserInventory() - end - return grabInv - end, - invImg = - function(item) - return "nui://"..QSInv.."/html/images/"..(Items[item].image or "") - end, - openShop = - function(name, label, items) - TriggerServerEvent("inventory:server:OpenInventory", "shop", label, items) - end, - serverOpenShop = function(shopName) - -- - end, - registerShop = - function(name, label, items, society) - -- - end, - openStash = - function(data) - TriggerEvent("inventory:client:SetCurrentStash", data.stash) - TriggerServerEvent("inventory:server:OpenInventory", "stash", data.stash, { - slots = data.slots or 50, - maxWeight = data.maxWeight or 600000 - }) - end, - clearStash = - function(stashId) - exports[QSInv]:ClearOtherInventory('stash', stashId) - end, - getStash = - function(stashName) - return exports[QSInv]:GetStashItems(stashName) - end, - stashAddItem = - function(stashItems, stashName, items) - -- - end, - stashRemoveItem = - function(stashItems, stashName, items) - for k, v in pairs(items) do - exports[QSInv]:RemoveItemIntoStash(stashName[1], k, v) - debugPrint("^6Bridge^7: ^2Removing ^3"..QSInv.." ^2Stash item^7:", k, v) - end - end, - registerStash = - function(name, label, slots, weight, owner, coords) - -- - end, - }, - { invName = CoreInv, removeItem = function(src, item, remamount) @@ -1889,13 +1796,6 @@ function getCurrentInvWeight() weight = exports[OXInv]:GetPlayerWeight() end - if isStarted(QSInv) then - local itemcheck = exports[QSInv]:getUserInventory() - for _, v in pairs(itemcheck) do - weight += ((v.weight * v.amount) or 0) - end - end - if isStarted(CoreInv) then local itemcheck = exports[CoreInv]:getInventory() for _, v in pairs(itemcheck) do @@ -2318,7 +2218,7 @@ RegisterNetEvent(getScript()..":server:stashRemoveItem", stashRemoveItem) --- local hasAll, details = stashhasItem(currentStashItems, { iron = 2, wood = 5 }) --- ``` function stashhasItem(stashItems, items, amount) - local invs = { OXInv, QSInv, CoreInv, CodeMInv, OrigenInv, TgiannInv, JPRInv, QBInv, PSInv, RSGInv } + local invs = { OXInv, CoreInv, CodeMInv, OrigenInv, TgiannInv, JPRInv, QBInv, PSInv, RSGInv } local foundInv = "" for _, inv in ipairs(invs) do @@ -2357,7 +2257,7 @@ end --- Registers a stash with the active inventory system. ---- Supports either OXInv or QSInv. +--- Not all --- --- @param name string Unique stash identifier. --- @param label string Display name for the stash. diff --git a/shared/make/progressBars.lua b/shared/make/progressBars.lua index 4b98ced..c0609b0 100644 --- a/shared/make/progressBars.lua +++ b/shared/make/progressBars.lua @@ -95,35 +95,6 @@ local progressFunc = { end, }, - qs = { - start = - function(data) - if exports['qs-interface']:ProgressBar({ - duration = debugMode and 1000 or data.time, - label = data.label, - position = 'bottom', - useWhileDead = data.dead or false, - canCancel = data.cancel or true, - disable = data.disableMovement or false, - anim = { - dict = data.dict, - clip = data.anim, - flag = data.flag or 32 - }, - prop = nil - }) then - return true - else - return false - end - end, - stop = - function() - --?? - TriggerEvent("progressbar:client:cancel") - end, - }, - esx = { start = function(data) diff --git a/shared/notify.lua b/shared/notify.lua index d6fd8f2..48770b7 100644 --- a/shared/notify.lua +++ b/shared/notify.lua @@ -10,7 +10,6 @@ • ox • red (default) • gta (default) - • qs-interface • lation • esx ]] @@ -38,17 +37,6 @@ local notifyFunc = { end, }, - qs = { - client = - function(title, message, type) - exports['qs-interface']:AddNotify(message, title, 6000) - end, - server = - function(title, message, type, src) - TriggerClientEvent('interface:notification', src, message, title, 6000) - end, - }, - ox = { client = function(title, message, type) diff --git a/shared/phones.lua b/shared/phones.lua index be60f92..91acfeb 100644 --- a/shared/phones.lua +++ b/shared/phones.lua @@ -5,8 +5,6 @@ Supported systems include: - gksphone - yflip-phone - - qs-smartphone - - qs-smartphone-pro - roadphone - lb-phone - qb-phone @@ -42,24 +40,14 @@ local phoneFunc = { ) end, }, + { phone = "yflip-phone", sendMail = function(mailData) TriggerServerEvent(getScript()..":yflip:SendMail", mailData) end, }, - { phone = "qs-smartphone", - sendMail = - function(mailData) - TriggerServerEvent('qs-smartphone:server:sendNewMail', mailData) - end, - }, - { phone = "qs-smartphone-pro", - sendMail = - function(mailData) - TriggerServerEvent('phone:sendNewMail', mailData) - end, - }, + { phone = "roadphone", sendMail = function(mailData) @@ -68,6 +56,7 @@ local phoneFunc = { exports["roadphone"]:sendMail(mailData) end, }, + { phone = "lb-phone", sendMail = function(mailData) @@ -76,6 +65,7 @@ local phoneFunc = { TriggerServerEvent(getScript()..":lbphone:SendMail", mailData) end, }, + { phone = "qb-phone", sendMail = function(mailData) @@ -111,18 +101,21 @@ local phoneFunc = { TriggerClientEvent('qb-phone:RefreshPhone', mailData.src) end, }, + { phone = "npwd_qbx_mail", sendMail = function(mailData) TriggerServerEvent('qb-phone:server:sendNewMail', mailData) end, }, + { phone = "jpr-phonesystem", sendMail = function(mailData) TriggerServerEvent(getScript()..":jpr:SendMail", mailData) end, }, + { phone = "ef-phone", sendMail = function(mailData) diff --git a/shared/wrapperfunctions.lua b/shared/wrapperfunctions.lua index 3218292..0721bbc 100644 --- a/shared/wrapperfunctions.lua +++ b/shared/wrapperfunctions.lua @@ -15,8 +15,8 @@ --- registerCommand("greet", { --- "Greets the player", --- { name = "name", help = "Name of the player to greet" }, ---- function(source, args) print("Hello, "..args[1].."!") end, --- nil, +--- function(source, args) print("Hello, "..args[1].."!") end, --- "admin" --- }) --- ``` diff --git a/starter.lua b/starter.lua index 6c14d1d..5a89cdd 100644 --- a/starter.lua +++ b/starter.lua @@ -9,7 +9,6 @@ Exports = { OXInv = "ox_inventory", QBInv = "qb-inventory", PSInv = "ps-inventory", - QSInv = "qs-inventory", CoreInv = "core_inventory", CodeMInv = "codem-inventory", OrigenInv = "origen_inventory",