Skip to main content
DistilleryDeprecated

Installation

Install the distillery packages and connect their database, inventory and framework functions.

Required dependencies

oxmysql

Database connector used by the resource.

ox_inventory

Default inventory integration; replaceable in the open-source functions.

FiveM artifact 4752+

Required for Lua 5.4 and escrow support.

OneSync

Required for server-side teleporting and distance handling.

Installation steps

  1. 01

    Install the Aquiver API

    Install and start aquiver_lua before the distillery resources.

  2. 02

    Extract both packages

    Copy the prop and main script resources into your server resources directory.

  3. 03

    Import the database

    Import the SQL file included with avp_distillery.

  4. 04

    Configure the economy

    Adjust prices and economy settings for your server.

    config.lua
  5. 05

    Configure framework functions

    Connect the external functions to your framework.

    _external.lua
  6. 06

    Configure locales

    Create or modify the Lua translation files.

    locales/*.lua
  7. 07

    Register inventory items

    Register the included items and images in ox_inventory.

  8. 08

    Start the resources

    Start the props before the main distillery resource.

Inventory integration

warning

Add the images to both the ox_inventory folder and avp_distillery.

ox_inventory
ox_inventory/web/images/

Add the inventory item images here.

Distillery
avp_distillery/html/vue-src/src/assets/img

Add the same images to the Distillery interface.

Configuration

Register ox_inventory items

Add the Distillery items to the ox_inventory item configuration.

ox_inventory/data/items.lua
['avp_bucket'] = {
label = 'Bucket',
weight = 1,
stack = false,
close = true,
description = nil,
consume = 1,

server = {
export = 'avp_distillery.avp_bucket'
},
},
['avp_plum'] = {
label = 'Plum',
weight = 1,
stack = true,
description = nil,
consume = 0
},
['avp_peach'] = {
label = 'Peach',
weight = 1,
stack = true,
description = nil,
consume = 0
},
['avp_cherry'] = {
label = 'Cherry',
weight = 1,
stack = true,
description = nil,
consume = 0
},
['avp_pear'] = {
label = 'Pear',
weight = 1,
stack = true,
description = nil,
consume = 0
},
['avp_bottle'] = {
label = 'Empty bottle',
weight = 1,
stack = true,
description = nil,
consume = 0
}

Framework functions

Configuration

_external.lua

Connect the Distillery player, inventory, banking and permission functions to ESX.

Default for ESX
local ESX = exports.es_extended:getSharedObject()

ServerExternals = {
player_addItem = function(source, item, amount)
if exports.ox_inventory:CanCarryItem(source, item, amount) then
exports.ox_inventory:AddItem(source, item, amount)
end
end,
player_getItemAmount = function(source, item)
return exports.ox_inventory:GetItem(source, item, nil, true)
end,
player_removeItem = function(source, item, amount)
exports.ox_inventory:RemoveItem(source, item, amount)
end,
player_addBank = function(source, amount)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
xPlayer.addAccountMoney("bank", amount)
end
end,
player_removeBank = function(source, amount)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
xPlayer.removeAccountMoney("bank", amount)
end
end,
player_getBank = function(source)
local amount = 0

local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
local account = xPlayer.getAccount("bank")
if account then
amount = account.money
end
end

return amount
end,
player_hasPermission = function(source)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
return xPlayer.getGroup() == "admin"
end

-- local ip = nil

-- for _, id in pairs(GetPlayerIdentifiers(source)) do
-- if string.match(id, "ip:") then
-- ip = string.sub(id, 4)
-- end
-- end

-- return string.match(ip or "", "192.168.0") and true or false
end,
player_getName = function(source)
local name = GetPlayerName(source)

local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
name = xPlayer.getName()
end

return name
end,
player_getIdentifier = function(source)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
return xPlayer.getIdentifier()
end
end
}