🛠️Config

TZMCBeanMachineConfig = {}

--[[

    INSTALLATION

    If you're having issues please contact hello@tzmc.dev and we can help out. 

    -- QB INVENTORY LABELS (THIS IS ONLY APPLICABLE IF YOU'RE USING LEGACY QBCORE) --

        1. Navigate to ..[qb]\qb-inventory\server\main.lua
        2. Navigate to around line 632 just below the if statement "if other then"
        3. Underneath that if statement, paste the following text

            if other.label == nil then
                secondInv.label = "Stash-"..id
            else
                secondInv.label = other.label
            end
        
        4. Once pasted, delete the duplicate "secondInv.name = "stash-"..id" that is underneath the if statement you just pasted. 
        5. You're done, it should look like this. https://ibb.co/31pXjWL

    -- nh-context --

    This script requires nh-context which you can install here: https://github.com/nighmares/nh-context

    -- QB ITEMS --

    1.  Navigate to .../[qb]/qb-core/shared/items.lua
    2.  Scroll to the bottom of the item list and paste the following text - https://pastebin.com/uyU28bMB
    3.  Once added, navigate to .../[qb]/qb-inventory/html/images/ - Paste the following pictures into the images folder https://drive.google.com/file/d/133voDpXZ6HXh0A0-U73C4rKeUg9xrPtB/view?usp=sharing
    4.  You are now done.

    -- ADD ITEMS TO CONSUMABLE QB --
        
    If you're using legacy QBCore, skip to step 3 :) 

    1.  Navigate to .../[qb]/qb-smallresources/server/consumables.lua
    2.  Paste the following text underneath line 1 - https://pastebin.com/N6miipsp
    3.  Once added, head over to .../[qb]/qb-smallresources/config.lua   
    4.  Within the 'ConsumeablesDrink' section, paste the following text at the bottom of the table.

            ["espresso"] = math.random(40, 50),
            ["latte"] = math.random(40, 50),
            ["latte"] = math.random(40, 50),
            ["americano"] = math.random(40, 50),
            ["mocha"] = math.random(40, 50),
            ["flatwhite"] = math.random(40, 50),
            ["macchiato"] = math.random(40, 50),
            ["cortado"] = math.random(40, 50),
            

        These just set a random value to increase the thirst amount for each item. You can set these to whatever you'd like if you would like certain items to quench thirst quicker. 
        
    5.  You are now done

    -- ADD JOB TO QB --

    1. Navigate to ..[qb]/qb-core/shared/jobs.lua
    2. Head to the bottom of the file and add the following text - https://pastebin.com/sAer5U6K - It should look like this https://ibb.co/HHPgcwG.
    3. Once added, navigate to ...[qb]/qb-phone/server/main.lua
    4. Navigate to QBCore.Commands.Add('bill'... around line 1065
    5. Replace the first if statement condition with the following text - ... or biller.PlayerData.job.name == 'beanmachine' - It should look like this https://ibb.co/RQHHYH8

--]]

-- QBCore -- 

TZMCBeanMachineConfig.UsingLegacyQBCore = false -- If you're using an older version of QB core, giving items is slightly different. However, if you are on a recent version feel free to leave this false.

-- MENU ITEMS --

TZMCBeanMachineConfig.CoffeeMachineItems = {
    { 
        name = "Espresso",
        context = "Coffee Beans, Water",
        itemName = "espresso",
        disabled = false,
        image = "https://i.ibb.co/Xb7R62w/espresso.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["water_bottle"] = 1,
            ["coffeecup"] = 1
        },
    },
    { 
        name = "Latte",
        context = "Coffee Beans, Milk",
        itemName = "latte",
        disabled = false,
        image = "https://i.ibb.co/GW5J0sj/latte.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["milk"] = 1,
            ["coffeecup"] = 1
        },
    },
    { 
        name = "Americano",
        context = "Coffee Beans, Water",
        itemName = "americano",
        disabled = false,
        image = "https://i.ibb.co/yFQtGsm/americano.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["water_bottle"] = 1,
            ["coffeecup"] = 1
        },
    },
    { 
        name = "Mocha",
        context = "Coffee Beans, Milk, Chocolate",
        itemName = "mocha",
        disabled = false,
        image = "https://i.ibb.co/VMbBz1R/mocha.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["milk"] = 1,
            ["chocolate"] = 1,
            ["coffeecup"] = 1
        },
    },
    { 
        name = "Flat White",
        context = "Coffee Beans, Milk",
        itemName = "flatwhite",
        disabled = false,
        image = "https://i.ibb.co/Xz91ZKt/flatwhite.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["milk"] = 1,
            ["coffeecup"] = 1
        },
    },
    { 
        name = "Macchiato",
        context = "Coffee Beans, Milk",
        itemName = "macchiato",
        disabled = false,
        image = "https://i.ibb.co/TRbWsx0/macchiato.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["milk"] = 1,
            ["coffeecup"] = 1
        },
    },
    { 
        name = "Cortado",
        context = "Coffee Beans, Milk",
        itemName = "cortado",
        disabled = false,
        image = "https://i.ibb.co/sbsvc8d/cortado.png",
        itemsRequired = {
            ["coffeebeans"] = 1,
            ["milk"] = 1,
            ["coffeecup"] = 1
        },
    }
}


-- TARGET --

TZMCBeanMachineConfig.OpenText = "Open"
TZMCBeanMachineConfig.CollectCupText = "Collect Cup"
TZMCBeanMachineConfig.CoffeeMachineText = "Make a Drink"
TZMCBeanMachineConfig.BossLoginText = "Login"
TZMCBeanMachineConfig.OnOffDutyText = "On/Off Duty"

TZMCBeanMachineConfig.CounterIcon = "fa-solid fa-cookie-bite"
TZMCBeanMachineConfig.CupIcon = "fa-solid fa-mug-hot"
TZMCBeanMachineConfig.CoffeeMachineIcon = "fa-solid fa-mug-saucer"
TZMCBeanMachineConfig.BossLoginIcon = "fa-solid fa-briefcase"
TZMCBeanMachineConfig.OnOffDutyIcon = "fa-solid fa-clipboard"


-- STASH CONFIG --

TZMCBeanMachineConfig.ItemCollectionStashName = "Counter"
TZMCBeanMachineConfig.ItemCollectionStashConfig = {
    weight = 5000,
    slots = 5
}

TZMCBeanMachineConfig.TableStashName = "Table"
TZMCBeanMachineConfig.TableStashConfig = {
    weight = 5000,
    slots = 5
}

TZMCBeanMachineConfig.StorageCupboardStashName = "Storage"
TZMCBeanMachineConfig.StorageCupboardStashConfig = {
    weight = 25000,
    slots = 25
}

-- PROGRESS BAR --

TZMCBeanMachineConfig.MakingDrink = "Making Drink"
TZMCBeanMachineConfig.DrinkProgressBarTime = 7

-- NOTIFICATIONS --

TZMCBeanMachineConfig.UseQBNotify = true
TZMCBeanMachineConfig.NotificationEvent = "" -- If you're using your own notification system, enter the event here. If you leave this blank and set QBNotify to false this will use the FiveM chat to notify the player. The parameters are (text, status) Status can be either 'success' or 'error'.

TZMCBeanMachineConfig.SuccessTitle = 'Success'
TZMCBeanMachineConfig.ErrorTitle = 'Error'
TZMCBeanMachineConfig.NoItems = "Seems that you don't have enough items to craft this."

Last updated