forked from Simnation/Main
ed
This commit is contained in:
parent
e6877350c3
commit
2483c25703
2 changed files with 14 additions and 7 deletions
|
@ -182,12 +182,19 @@ 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
|
||||
if Config.JerryCan.giveAsWeapon then
|
||||
Utils.Framework.givePlayerWeapon(source, Config.JerryCan.item, 1, Config.JerryCan.metadata)
|
||||
else
|
||||
Utils.Framework.givePlayerItem(source, Config.JerryCan.item, 1, Config.JerryCan.metadata)
|
||||
end
|
||||
-- Gives the jerry can to the player
|
||||
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)
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue