1
0
Fork 0
forked from Simnation/Main

Update sv_function.lua

This commit is contained in:
Nordi98 2025-07-27 04:48:49 +02:00
parent d546bef0c5
commit bf9a3be387

View file

@ -99,12 +99,17 @@ function AddItem(source, item, amount, metadata)
exports['ox_inventory']:AddItem(source, item, amount, metadata) exports['ox_inventory']:AddItem(source, item, amount, metadata)
elseif GetResourceState('qs-inventory') == 'started' then elseif GetResourceState('qs-inventory') == 'started' then
exports['qs-inventory']:AddItem(source, item, amount, false, metadata) exports['qs-inventory']:AddItem(source, item, amount, false, metadata)
elseif GetResourceState('tgiann-inventory') == 'started' then elseif GetResourceState('tgiann-inventory') == 'started' then
-- Check if the item is a weapon and ensure 'serie' exists in metadata -- Ensure metadata is a table
if string.match(item, "WEAPON_") and not metadata.serie then metadata = metadata or {}
-- Check if the item is a weapon and ensure 'serie' exists in metadata as a string
if string.match(item:upper(), "WEAPON_") then
if not metadata.serie or type(metadata.serie) ~= "string" then
metadata.serie = tostring(math.random(100000, 999999)) metadata.serie = tostring(math.random(100000, 999999))
end end
exports["tgiann-inventory"]:AddItem(source, item, amount, nil, metadata, nil) end
exports["tgiann-inventory"]:AddItem(source, item, amount, nil, metadata, nil)
elseif GetResourceState('origen_inventory') == 'started' then elseif GetResourceState('origen_inventory') == 'started' then
exports['origen_inventory']:addItem(source, item, amount, metadata, false) exports['origen_inventory']:addItem(source, item, amount, metadata, false)
else else