This is a script based of ESX. This script is mainly used for the job “ESX_UNICORN”. This script includes more drinks with alcohol. You’ll need to import the drinks by the harbor, the import function is restricted to an item called “unicornid”. Everyone that has this item will be able to import drinks. The drinks cost a little money to important but it’s later their job to continue selling the drinks or consume them their self. There might be some “unnecessary” rows in the code but I’ve tried to make it as simple as possible.
NOTE: The script works as it is so their’s no problem with the script! Feel free to ask for help.
RegisterServerEvent('esx_unicorn_purchase:purchaseItem')
AddEventHandler('esx_unicorn_purchase:purchaseItem', function(item)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
if xPlayer.job.name == 'unicorn' then
if xPlayer.getMoney() < 150 then
notification('You dont have enough cash to ~r~buy~s~ x1 ' ..item.. '.')
else
xPlayer.removeMoney(150)
xPlayer.addInventoryItem(item, 1)
notification('You bought 1x ~g~ ' .. item .. '~s~ for ~r~150$')
end
else
notification('You dont have access to import ' ..item .. '.')
end
end)
-- VODKA (END)
------------------------------------------
RegisterServerEvent('esx_unicorn_purchase:makeVodkaredbull')
AddEventHandler('esx_unicorn_purchase:makeVodkaredbull', function()
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
--local accountMoney = 0
--accountMoney = xPlayer.getAccountMoney('black_money').money
local oneQuantity = xPlayer.getInventoryItem('vodka').count
local twoQuantity = xPlayer.getInventoryItem('redbull').count
if oneQuantity > 0 then
if twoQuantity > 0 then
xPlayer.removeInventoryItem('vodka', 1)
xPlayer.removeInventoryItem('redbull', 1)
xPlayer.addInventoryItem('vodkaredbull', 1)
notification('Du blandade ihop x1 ~g~vodka-redbull~s~')
else
notification('Du har inte tillräckligt med ~r~redbull')
end
else
notification('Du har inte tillräckligt med ~r~vodka')
end
end)
Give yourself the item called “unicornid”, you require that item in order to import any stuff from the harbor.
I will soon update this script where it only requires you to be the unicorn job.