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
|
end
|
||||||
Utils.Framework.tryRemoveAccountMoney(source, Config.JerryCan.price, Config.Accounts[data.paymentMethod])
|
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
|
||||||
if Config.JerryCan.giveAsWeapon then
|
local itemMetadata = {}
|
||||||
local weaponMetadata = Config.JerryCan.metadata or {}
|
for k, v in pairs(Config.JerryCan.metadata or {}) do
|
||||||
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
|
itemMetadata[k] = v
|
||||||
end
|
end
|
||||||
itemMetadata.serie = "JERRYCAN-" .. math.random(100000, 999999)
|
-- Add serie field for tgiann-inventory
|
||||||
|
itemMetadata.serie = "JERRYCAN-" .. math.random(100000, 999999)
|
||||||
|
|
||||||
|
if Config.JerryCan.giveAsWeapon then
|
||||||
|
Utils.Framework.givePlayerWeapon(source, Config.JerryCan.item, 1, itemMetadata)
|
||||||
|
else
|
||||||
Utils.Framework.givePlayerItem(source, Config.JerryCan.item, 1, itemMetadata)
|
Utils.Framework.givePlayerItem(source, Config.JerryCan.item, 1, itemMetadata)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
TriggerClientEvent("lc_fuel:Notify", source, "success", Utils.translate('jerry_can_paid'):format(Config.JerryCan.price))
|
TriggerClientEvent("lc_fuel:Notify", source, "success", Utils.translate('jerry_can_paid'):format(Config.JerryCan.price))
|
||||||
TriggerClientEvent("lc_fuel:closeUI", source, data.fuelAmount, data.selectedFuelType)
|
TriggerClientEvent("lc_fuel:closeUI", source, data.fuelAmount, data.selectedFuelType)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue