forked from Simnation/Main
Update server.lua
This commit is contained in:
parent
2483c25703
commit
98793f53cb
1 changed files with 10 additions and 9 deletions
|
@ -182,20 +182,21 @@ 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
|
||||
-- Gives the jerry can to the player
|
||||
local itemMetadata = {}
|
||||
for k, v in pairs(Config.JerryCan.metadata or {}) do
|
||||
itemMetadata[k] = v
|
||||
end
|
||||
-- Add serie field for tgiann-inventory
|
||||
itemMetadata.serie = "JERRYCAN-" .. math.random(100000, 999999)
|
||||
|
||||
if Config.JerryCan.giveAsWeapon then
|
||||
local weaponMetadata = Config.JerryCan.metadata or {}
|
||||
weaponMetadata.serie = "JERRYCAN-" .. math.random(100000, 999999)
|
||||
Utils.Framework.givePlayerWeapon(source, Config.JerryCan.item, 1, weaponMetadata)
|
||||
Utils.Framework.givePlayerWeapon(source, Config.JerryCan.item, 1, itemMetadata)
|
||||
else
|
||||
local itemMetadata = {}
|
||||
for k, v in pairs(Config.JerryCan.metadata or {}) do
|
||||
itemMetadata[k] = v
|
||||
end
|
||||
itemMetadata.serie = "JERRYCAN-" .. math.random(100000, 999999)
|
||||
Utils.Framework.givePlayerItem(source, Config.JerryCan.item, 1, itemMetadata)
|
||||
end
|
||||
|
||||
|
||||
TriggerClientEvent("lc_fuel:Notify", source, "success", Utils.translate('jerry_can_paid'):format(Config.JerryCan.price))
|
||||
TriggerClientEvent("lc_fuel:closeUI", source, data.fuelAmount, data.selectedFuelType)
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue