mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
Fix confusion with old and new inv shop exports
This commit is contained in:
@@ -175,18 +175,12 @@ function openShop(data)
|
|||||||
TriggerEvent("codem-inventory:openshop", data.shop)
|
TriggerEvent("codem-inventory:openshop", data.shop)
|
||||||
|
|
||||||
elseif isStarted(QBInv) then
|
elseif isStarted(QBInv) then
|
||||||
if QBInvNew then
|
|
||||||
TriggerServerEvent(getScript()..':server:openServerShop', data.shop)
|
TriggerServerEvent(getScript()..':server:openServerShop', data.shop)
|
||||||
else
|
|
||||||
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
|
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
|
||||||
end
|
|
||||||
|
|
||||||
elseif isStarted(PSInv) then
|
elseif isStarted(PSInv) then
|
||||||
if QBInvNew then
|
|
||||||
TriggerServerEvent(getScript()..':server:openServerShop', data.shop)
|
TriggerServerEvent(getScript()..':server:openServerShop', data.shop)
|
||||||
else
|
|
||||||
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
|
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
|
||||||
end
|
|
||||||
|
|
||||||
elseif isStarted(RSGInv) then
|
elseif isStarted(RSGInv) then
|
||||||
TriggerServerEvent(getScript()..':server:openServerShop', data.shop)
|
TriggerServerEvent(getScript()..':server:openServerShop', data.shop)
|
||||||
@@ -195,10 +189,10 @@ function openShop(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..':server:openServerShop', function(data)
|
RegisterNetEvent(getScript()..':server:openServerShop', function(data)
|
||||||
if isStarted(QBInv) then
|
if isStarted(QBInv) and checkExportExists(QBInv, "OpenShop") then
|
||||||
exports[QBInv]:OpenShop(source, data)
|
exports[QBInv]:OpenShop(source, data)
|
||||||
end
|
end
|
||||||
if isStarted(PSInv) then
|
if isStarted(PSInv) and checkExportExists(PSInv, "OpenShop") then
|
||||||
exports[PSInv]:OpenShop(source, data)
|
exports[PSInv]:OpenShop(source, data)
|
||||||
end
|
end
|
||||||
if isStarted(TgiannInv) then
|
if isStarted(TgiannInv) then
|
||||||
@@ -244,7 +238,7 @@ function registerShop(name, label, items, society)
|
|||||||
society = society,
|
society = society,
|
||||||
})
|
})
|
||||||
|
|
||||||
elseif isStarted(PSInv) and QBInvNew then
|
elseif isStarted(PSInv) and checkExportExists(PSInv, "CreateShop") then
|
||||||
shopResource = PSInv
|
shopResource = PSInv
|
||||||
exports[PSInv]:CreateShop({
|
exports[PSInv]:CreateShop({
|
||||||
name = name,
|
name = name,
|
||||||
@@ -267,6 +261,6 @@ function registerShop(name, label, items, society)
|
|||||||
if shopResource ~= "" then
|
if shopResource ~= "" then
|
||||||
debugPrint("^6Bridge^7: ^2Registering ^5"..shopResource.." ^3Store^7:", name, "^4Label^7: "..label)
|
debugPrint("^6Bridge^7: ^2Registering ^5"..shopResource.." ^3Store^7:", name, "^4Label^7: "..label)
|
||||||
else
|
else
|
||||||
debugPrint("^1ERROR^7: ^1Couldn't find supported inventory to register command^7:", name)
|
debugPrint("^1ERROR^7: ^1Couldn't find supported inventory to register shop^7:", name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user