[Information]:
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.
[Requirements]:
Needs
ESX_BASICNEEDS
NOTE: You need to add the items that you want to be drinkable in the server-side code.
[Features]:
Opportunities
-Purchase drinks (NEW drinks).
-Restricted to an item.
-More fun for the unicorn job.
-Easy setup/use
-Very simple
[Installation]:
Guide
- Add the following row into your server.cfg “start esx_unicorn_purchase”.
- Insert the esx_unicorn_purchase folder into your resource folder.
- Insert the esx_unicorn_purchase.sql file into your database or add the items manually in order to get the items to work.
- Restart/Start your server and it should all work.
[Screenshots]:
Images
[Download]:
Files
Restricted to item:
esx_unicorn_purchase.rar (3.5 KB)
Restricted to job:
esx_unicorn_purchase.rar (3.2 KB)
NOTE: You’re free to post any edits in the comment section.
- P4NDA
4 Likes
The teleporter is from dock to unicorn, right? thx for release!
There is no teleporter at all. In the existing esx_unicornjob there is a teleporter inside of the unicorn to get inside of the DJ room.
qalle
4
Why is there duplicates of the markers drawing?
I would’ve had these events instead
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)
Less events.
I cant import vodka or any drinks, it says that i dont have access to that. i have tried with all ranks in the job.
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.
/giveitem [id] unicornid 1
I’ve re-made this script in order to restrict it to the players job instead of an item.
Download: esx_unicorn_purchase.rar (3.2 KB)