🛠️INSTALLATION

A modern and customizable progress bar system for QB-Core Framework.

  1. Download the script

  2. Place it in your resources folder

  3. Add this to your server.cfg:

ensure janiel-progressbar
  1. Import the SQL file:

CREATE TABLE IF NOT EXISTS `progress_positions` (
    `identifier` VARCHAR(50) PRIMARY KEY,
    `position_x` FLOAT NOT NULL,
    `position_y` FLOAT NOT NULL,
    `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

5. Replace Progress Bar Function

Navigate to qb-core/client/functions.lua and replace the existing QBCore.Functions.Progressbar function with the following code:

function QBCore.Functions.Progressbar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel, icon)
    if GetResourceState('janiel-progressbar') ~= 'started' then 
        error('janiel-progressbar needs to be started in order for QBCore.Functions.Progressbar to work') 
        return false
    end
    exports['janiel-progressbar']:Progress({
        name = name:lower(),
        duration = duration,
        label = label,
        icon = icon,
        useWhileDead = useWhileDead,
        canCancel = canCancel,
        controlDisables = disableControls,
        animation = animation,
        prop = prop,
        propTwo = propTwo,
    }, function(cancelled)
        if not cancelled then
            if onFinish then
                onFinish()
            end
        else
            if onCancel then
                onCancel()
            end
        end
    end)
end 

💻 Usage

QB-Core Export Example

Check if Progress Bar is Active

Progress Bar Test Scripts for QB-Core

Instructions:

Once you load this script, you can test the following commands on the client side by typing them in the in-game console:

  1. testprog1: A simple progress bar without animation or prop, where the user can cancel the process.

  2. testprog2: An animated progress bar, disabling movement and combat during the animation.

  3. testprog3: A progress bar with both animation and a prop attached to the player, disabling various controls.

  4. testprog4: Uses the built-in QB-Core progress bar functionality, with the ability to disable combat actions.

ESX FRAMEWORK

Navigate to es_extended/client/functions.lua and replace the existing ESX.Progressbar function with the following code:

🎮 Usage

Last updated