Add more support for RedM RSGInv

This commit is contained in:
Jim Shield
2025-04-08 17:48:38 +01:00
committed by GitHub
parent 2be706a860
commit 1248102635
3 changed files with 57 additions and 33 deletions

View File

@@ -150,21 +150,20 @@ end)
function openShop(data)
if (data.job or data.gang) and not jobCheck(data.job or data.gang) then return end
if isStarted(OXInv) then
if Config.General.JimShops then
TriggerServerEvent("jim-shops:ShopOpen", "shop", data.items.label, data.items)
elseif isStarted(OXInv) then
exports[OXInv]:openInventory('shop', { type = data.shop })
elseif isStarted(QBInv) then
if QBInvNew then
TriggerServerEvent(getScript()..':server:OpenShopNewQB', data.shop)
else
TriggerServerEvent(Config.General.JimShops and "jim-shops:ShopOpen" or "inventory:server:OpenInventory", "shop", data.items.label, data.items)
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
end
--elseif isStarted(OrigenInv) then -- Needs testing, not sure if i did this right
-- exports[OrigenInv]:openInventory('shop', data.shop, data.items)
else
TriggerServerEvent(Config.General.JimShops and "jim-shops:ShopOpen" or "inventory:server:OpenInventory", "shop", data.items.label, data.items)
elseif isStarted(RSGInv) then
TriggerServerEvent(getScript()..':server:OpenShopNewRSG', data.shop)
end
lookEnt(data.coords)
end
@@ -174,6 +173,10 @@ RegisterNetEvent(getScript()..':server:OpenShopNewQB', function(data)
exports[QBInv]:OpenShop(source, data)
end)
RegisterNetEvent(getScript()..':server:OpenShopNewRSG', function(data)
exports[RSGInv]:OpenShop(source, data)
end)
--- Registers a shop with the active inventory system.
--- Supports either OXInv or QBInv (with QBInvNew flag).
---
@@ -202,5 +205,15 @@ function registerShop(name, label, items, society)
items = items,
society = society,
})
elseif isStarted(RSGInv) then
debugPrint("^6Bridge^7: ^2Registering ^3RSG ^2Store^7:", name, label)
exports[RSGInv]:CreateShop({
name = name,
label = label,
slots = #items,
items = items,
society = society,
})
end
end