RegisterServerEvent('aura-orange
rocessOrange')
AddEventHandler('aura-orange
rocessOrange', function()
local src = source
local xPlayer = ESX.GetPlayerFromId(src)
local x = xPlayer.getQuantity('orange', 4)
if 4 <= x then
xPlayer.removeInventoryItem('orange', 4)
xPlayer.addInventoryItem('orange_juice', 1)
TriggerClientEvent('mythic_notify:client:SendAlert', src, { type = 'inform', text = _U('oranges_processed')}, 5000)
else
TriggerClientEvent('mythic_notify:client:SendAlert', src, { type = 'error', text = _U('not_enough_items')}, 5000)
end
end)
RegisterServerEvent('aura-orange:SellOrange')
AddEventHandler('aura-orange:SellOrange', function()
local src = source
local xPlayer = ESX.GetPlayerFromId(src)
local x = xPlayer.getQuantity('orange_juice')
if x > 0 then
xPlayer.removeInventoryItem('orange_juice', x)
xPlayer.addInventoryItem('cash', x * Config.OneOrangePrice)
if Config.Locale == 'tr' then
TriggerClientEvent('mythic_notify:client:SendAlert', src, { type = 'inform', text = 'Üzerindeki bütün portakal sularını sattın ve ' ..x * Config.OneOrangePrice.. '$ elde ettin', 8000})
dclog(xPlayer, x.. ' tane portakal suyu sattı ve ' ..x * Config.OneOrangePrice.. '$ elde etti')
elseif Config.Locale == 'en' then
TriggerClientEvent('mythic_notify:client:SendAlert', src, { type = 'inform', text = 'You sold all the orange juice on your inventory and you got ' ..x * Config.OneOrangePrice.. '$', 8000})
dclog(xPlayer, 'Sold' ..x.. 'x orange juice and got ' ..x * Config.OneOrangePrice.. '$')
end
else
TriggerClientEvent('mythic_notify:client:SendAlert', src, { type = 'error', text = _U('not_enough_items')}, 5000)
end
end)