LV Soft FiveM
  • LV SOFT
    • 👋Welcome!
    • 🛒Tebex
    • 💬Discord
  • QB/ESX
    • ☮️lvs-loading
      • Installation
      • Configuration
    • 👫lvs-multichar
      • Installation
      • Configuration
      • Adding Scenes
      • Tebex Integration
      • Commands
    • 🗺️lvs-spawnselector
      • Installation
      • Configuration
    • 🥼lvs-clothing
      • Installation
        • QBCore Install
        • ESX Install
      • Configuration
      • Migration
        • qb-clothing
        • esx-skinchanger
        • Illenium-Appareance
      • Blacklisting
      • Events
      • Commands
    • ⚙️lvs-lib
      • black-screen loading
      • notifications
      • progressbar
      • key-interaction
      • textui
      • alert
      • context menu
      • context input
    • 💬lvs-chat
      • Installation
      • Configuration
      • Events & Exports
    • 📱lvs-radio
      • Installation
      • Configuration
      • Events & Exports
    • 🗃️lvs-playerlist
      • Installation
      • Configuration
    • 📹lvs_weazelnews
      • Installation
      • Configuration
    • 🎒lvs-inventory
      • Installation
      • Configuration
      • lvs-inventory
        • exports
      • lvs-shops
        • Configuration
        • Exports
      • lvs-crafting
    • 🪪lvs-idmanager
      • Installation
      • Configuration
      • Exports
  • Standalone
    • 🚘lvs-drift
      • Installation
      • Configuration
      • Commands
    • 🕺lvs-animations
      • Installation
      • Configuration
      • Adding Animations
      • Exports/Events
    • 💥lvs-accident
      • Installation
      • Configuration
    • 🔥lvs-explosion
      • Installation
      • Configuration
    • 🏎️lvs-racing
  • ESX
    • 📅Soon
Powered by GitBook
On this page
  • Progressbar
  • How to use:
  • QBCore Integration:
  1. QB/ESX
  2. lvs-lib

progressbar

PreviousnotificationsNextkey-interaction

Last updated 10 months ago

Progressbar


How to use:

Client side using exports

Example:

exports.lvs_lib:Progress({
   name = "random_task",
   duration = 5000,
   label = "Doing something",
   useWhileDead = false,
   canCancel = true,
   controlDisables = {
       disableMovement = false,
       disableCarMovement = false,
       disableMouse = false,
       disableCombat = true,
   },
   animation = {
       animDict = "mp_suicide",
       anim = "pill",
       flags = 49,
   },
   prop = {},
   propTwo = {}
}, function(cancelled)
   if not cancelled then
       -- finished
   else
       -- cancelled
   end
end)

Props Example:

exports.lvs_lib:Progress({
   name = "random_task",
   duration = 5000,
   label = "Doing something",
   useWhileDead = false,
   canCancel = true,
   controlDisables = {
       disableMovement = false,
       disableCarMovement = false,
       disableMouse = false,
       disableCombat = true,
   },
   animation = {
       animDict = "missheistdockssetup1clipboard@base",
       anim = "pill",
       flags = 49,
   },
   prop = {
     model = 'prop_notepad_01',
     bone = 18905,
     coords = vec3(0.1, 0.02, 0.05),
     rotation = vec3(10.0, 0.0, 0.0),
   },
   propTwo = {
     model = 'prop_pencil_01',
     bone = 58866,
     coords = vec3(0.11, -0.02, 0.001),
     rotation = vec3(-120.0, 0.0, 0.0),
   }
}, function(cancelled)
   if not cancelled then
       -- finished
   else
       -- cancelled
   end
end)

isDoingSomething()
-- Returns a boolean (true/false) depending on if a progressbar is present.

local busy = exports.lvs_lib:isDoingSomething()
ProgressWithStartEvent(data: table, start: function, finish: function)
-- Works like a normal progressbar, the data parameter should be the same as the data passed into the Progress export above.
-- The start function gets triggered upon the start of the progressbar.
-- The finish handler is the same as the handler parameter in the Progress export above.
ProgressWithTickEvent(data: table, tick: function, finish: function)
-- Works like a normal progressbar, the data parameter should be the same as the data passed into the Progress export above.
-- The tick function gets triggered every frame while the progressbar is active.
-- The finish handler is the same as the handler parameter in the Progress export above.
ProgressWithTickEvent(data: table, start: function, tick: function, finish: function)
-- Works like a normal progressbar, the data parameter should be the same as the data passed into the Progress export above.
-- The start function gets triggered upon the start of the progressbar.
-- The tick function gets triggered every frame while the progressbar is active.
-- The finish handler is the same as the handler parameter in the Progress export above.

QBCore Integration:

Edit qb-core/client/functions.lua, replace the function QBCore.Functions.Progressbar(line 121) with:

function QBCore.Functions.Progressbar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
    exports.lvs_lib:Progress({
        name = name:lower(),
        duration = duration,
        label = label,
        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
⚙️