forked from Simnation/Main
Update sv_function.lua
This commit is contained in:
parent
8d321f20cf
commit
59e2851971
1 changed files with 7 additions and 1 deletions
|
@ -94,12 +94,17 @@ end
|
|||
|
||||
function AddItem(source, item, amount, metadata)
|
||||
if not metadata then metadata = {} end
|
||||
|
||||
if GetResourceState('ox_inventory') == 'started' then
|
||||
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
|
||||
exports["tgiann-inventory"]:AddItem(source, item, amount, slot, metadata, isClotheSlot)
|
||||
-- Check if the item is a weapon and ensure 'serie' exists in metadata
|
||||
if string.match(item, "WEAPON_") and not metadata.serie then
|
||||
metadata.serie = tostring(math.random(100000, 999999))
|
||||
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
|
||||
|
@ -112,6 +117,7 @@ function AddItem(source, item, amount, metadata)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function BuyItems(data)
|
||||
local item = data.item
|
||||
local amount = tonumber(data.amount) or 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue