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)
elseif GetResourceState('qs-inventory') == 'started' then
exports['qs-inventory']:AddItem(source, item, amount, false, metadata)
elseif GetResourceState('tgiann-inventory') == 'started' then
-- Check if the item is a weapon and ensure 'serie' exists in metadata
if string.match(item, "WEAPON_") and not metadata.serie then
elseif GetResourceState('tgiann-inventory') == 'started' then
-- Ensure metadata is a table
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))
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
exports['origen_inventory']:addItem(source, item, amount, metadata, false)
else