forked from Simnation/Main
eD
This commit is contained in:
parent
fd4a26921e
commit
d3f2934dfc
2 changed files with 6 additions and 2 deletions
|
@ -182,14 +182,18 @@ AddEventHandler("lc_fuel:confirmJerryCanPurchase",function(data)
|
|||
end
|
||||
Utils.Framework.tryRemoveAccountMoney(source, Config.JerryCan.price, Config.Accounts[data.paymentMethod])
|
||||
|
||||
|
||||
-- Gives the jerry can to the player
|
||||
local itemMetadata = {}
|
||||
for k, v in pairs(Config.JerryCan.metadata or {}) do
|
||||
itemMetadata[k] = v
|
||||
end
|
||||
-- Add required fields for tgiann-inventory weapon items
|
||||
|
||||
-- Add all required fields for tgiann-inventory weapon items
|
||||
itemMetadata.serie = "JERRYCAN-" .. math.random(100000, 999999)
|
||||
itemMetadata.durabilityPercent = 100 -- Set to 100% durability for new jerry can
|
||||
itemMetadata.usedTotalAmmo = 0 -- No ammo used yet
|
||||
itemMetadata.ammo = itemMetadata.ammo or 20 -- Use existing ammo value or default to 20
|
||||
|
||||
if Config.JerryCan.giveAsWeapon then
|
||||
Utils.Framework.givePlayerWeapon(source, Config.JerryCan.item, 1, itemMetadata)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue