Configuration

Welcome to the MBT Camping System! This documentation will guide you through the process of configuring various variables within the provided code. Even if you have little to no programming experience, fear not! Follow the steps below to customize the camping system according to your needs.

MBT.Props = {
    ["Tent"]    = `prop_skid_tent_01`,
    ["Chair"]   = `prop_skid_chair_02`,
    ["Fire"]    = `prop_beach_fire`,
    ["Grill"]   = `prop_bbq_5`
}

This variable stores the names of various camping props used in the system, such as tents, chairs, fires, and grills.


MBT.Language = "EN"

Specifies the default language for the camping system. You can set it to "EN" for English or "IT" for Italian or you can add your language.


MBT.WarmingDistance = 2.5

Defines the distance at which the fire warm animation is triggered.


MBT.MaxDistanceMove = 4.0

Sets the maximum distance between the player and the camping prop for move mode. If the distance exceeds this value, the move mode is exited.

MBT.GetUpKey = "E"

Specifies the key (in this case, "E") that the player uses to get up from a sitting position.


MBT.MoveControls = {
    ["Up"] = 44,           -- Q
    ["Down"] = 20,         -- Z
    ["Forward"] = 172,     -- UP ARROW
    -- ... (other control mappings)
    ["Confirm"] = 179,     -- SPACE
}

Defines the key codes for various movement controls used in the camping system (e.g., up, down, left, right, rotate left, rotate right, confirm).


MBT.Labels = {
    ["IT"] = {
        ["Veh_Banned"] = {
            ["Title"] = "Errore",
            ["Text"] = "Questa operazione non può essere effettuata in un veicolo",
        },
        -- ... (other Italian labels)
    },
    ["EN"] = {
        ["Veh_Banned"] = {
            ["Title"] = "Error",
            ["Text"] = "You can't do this in a vehicle!",
        },
        -- ... (other English labels)
    }
}

Contains language-specific labels and messages used in the camping system for various actions and notifications


MBT.Items = {
    ["meat"] = { ["Cooked"] = "cooked_meat", ["Burnt"] = "burnt_meat", ["Prop"] = `prop_cs_burger_01` }
}

Defines food items that can be cooked, specifying their cooked and burnt versions and corresponding props.


MBT.GetFood = function (foodList)  -- This will be used if you not using ox_inventory, so you have to fill up by yourself according to your inventory system
    -- Info
    --[[
        playerFood must be returned as a table with the following structure:
        playerFood = {
            ["item_name"] = {
                ["Count"] = 3,
                ["Slots"] = { 2, 4, 6 }
            },
            ["another_item_name"] = {
                ["Count"] = 2,
                ["Slots"] = { 1, 5 }
            }
        }
    ]] 

    -- Ox inventory preset
    --[[
        local playerFood = {}
        local items = exports.ox_inventory:Search('slots', foodList)

        if items then
            for name, data in pairs(items) do
                for _, v in pairs(data) do
                    if v.slot then

                        if not playerFood[name] then
                            playerFood[name] = { Label = v.label, Count = v.count, Description = v.description, Slots = { v.slot } }
                        else
                            playerFood[name]["Count"] = playerFood[name]["Count"] + v.count
                            playerFood[name]["Slots"][#playerFood[name]["Slots"] + 1] = v.slot
                        end
                    end
                end
            end

            if next(playerFood) == nil then
                MBT.Notification(labels["Nothing_To_Cook"]["Text"], labels["Nothing_To_Cook"]["Title"], "error")
            end

            return playerFood
        end
    ]] 
end

Contains logic for retrieving food items. This function should be filled based on your inventory system if you are not using ox_inventory.


MBT.ItemName = "campkit"

This section allows you to define custom functions that enhance the functionality of the elevator system.


MBT.Notification = function (text, text2, type) -- Put your custom notification event here
    FrameworkObj.ShowNotification(text)
    -- FrameworkObj.Functions.Notify(text2, type == "info" and "primary" or type)
end

MBT.ServerNotification = function (source, text, text2, type) -- Put your custom notification event here
    TriggerClientEvent('esx:showNotification', source, text)
    --TriggerClientEvent('QBCore:Notify', source, text, type or "info")    
end

Handles custom notifications, allowing you to customize their appearance and behavior.


function MBT.HelpUI(text, arg1, arg2)
    lib.showTextUI(text, {
        position = "left-center",
        icon = 'hand',
        style = {
            borderRadius = 0,
            backgroundColor = '#2B80FF',
            color = 'white'
        }
    })
end

function MBT.HideHelpUI()
    lib.hideTextUI()
end

Configure the in-game help text and UI appearance, including logic for showing and hiding the UI.


MBT.SetupTarget = function (entities)
    -- Target logic
end

Configures interactions with camping items. Uncomment the appropriate section based on the targeting system (ox_target or qb-target) you are using.


MBT.SetupMenu = function (data)
    -- Menu logic
end

Configures interactions with cooking items. Uncomment the appropriate section based on the targeting system (ox_libor qb-menu) you are using.


function MBT.SetupSkillbar(data)
    -- Skillbar logic
end

Configures skillbar for cooking. Uncomment the appropriate section based on the targeting system (ox_libor qb-progressbar) you are using.


Last updated