mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 06:46:04 +01:00
light fix (in case of missing Crafting Var)
- added check for missing Config.Crafting variables - reduces errors in scripts if not added to config
This commit is contained in:
@@ -196,7 +196,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount,
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Config.Crafting.showItemBox then
|
if Config.Crafting ~= nil and Config.Crafting.showItemBox then
|
||||||
TriggerClientEvent((isStarted(QBInv) and QBInvNew and "qb-" or "").."inventory:client:ItemBox", src, Items[item], "remove", amount or 1)
|
TriggerClientEvent((isStarted(QBInv) and QBInvNew and "qb-" or "").."inventory:client:ItemBox", src, Items[item], "remove", amount or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount,
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Config.Crafting.showItemBox then
|
if Config.Crafting ~= nil and Config.Crafting.showItemBox then
|
||||||
TriggerClientEvent("inventory:client:ItemBox", src, Items[item], "remove", amount or 1)
|
TriggerClientEvent("inventory:client:ItemBox", src, Items[item], "remove", amount or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount,
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Config.Crafting.showItemBox then
|
if Config.Crafting ~= nil and Config.Crafting.showItemBox then
|
||||||
TriggerClientEvent("rsg-inventory:client:ItemBox", src, Items[item], "remove", amount or 1)
|
TriggerClientEvent("rsg-inventory:client:ItemBox", src, Items[item], "remove", amount or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount,
|
|||||||
|
|
||||||
elseif isStarted(PSInv) then invName = PSInv
|
elseif isStarted(PSInv) then invName = PSInv
|
||||||
if Core.Functions.GetPlayer(src).Functions.AddItem(item, amountToAdd, nil, info) then
|
if Core.Functions.GetPlayer(src).Functions.AddItem(item, amountToAdd, nil, info) then
|
||||||
if Config.Crafting.showItemBox then
|
if Config.Crafting ~= nil and Config.Crafting.showItemBox then
|
||||||
TriggerClientEvent("ps-inventory:client:ItemBox", src, Items[item], "add", amountToAdd)
|
TriggerClientEvent("ps-inventory:client:ItemBox", src, Items[item], "add", amountToAdd)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user