mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-16 21:46:03 +01:00
Remove references to qs scripts
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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,15 +175,11 @@ 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()
|
||||
Wait(1000)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
{ script = Exports.RSGExport,
|
||||
@@ -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" } },
|
||||
|
||||
@@ -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 "",
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
--- })
|
||||
--- ```
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user