mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-18 22:36:04 +01:00
qs notify + progressbar + makeVeh edit
This commit is contained in:
@@ -13,9 +13,9 @@ local Vehicles = {}
|
|||||||
--- ```lua
|
--- ```lua
|
||||||
--- local vehicle = makeVeh('adder', vector4(123.4, 567.8, 90.1, 180.0))
|
--- local vehicle = makeVeh('adder', vector4(123.4, 567.8, 90.1, 180.0))
|
||||||
--- ```
|
--- ```
|
||||||
function makeVeh(model, coords)
|
function makeVeh(model, coords, synced)
|
||||||
loadModel(model)
|
loadModel(model)
|
||||||
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, true, false)
|
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, synced ~= false, false)
|
||||||
SetVehicleHasBeenOwnedByPlayer(veh, true)
|
SetVehicleHasBeenOwnedByPlayer(veh, true)
|
||||||
if gameName ~= "rdr3" then
|
if gameName ~= "rdr3" then
|
||||||
SetEntityAlpha(veh, 0, false)
|
SetEntityAlpha(veh, 0, false)
|
||||||
@@ -56,7 +56,7 @@ function makeDistVehicle(data, radius, onEnter, onExit)
|
|||||||
coords = vec3(data.coords.x, data.coords.y, data.coords.z),
|
coords = vec3(data.coords.x, data.coords.y, data.coords.z),
|
||||||
radius = radius,
|
radius = radius,
|
||||||
onEnter = function()
|
onEnter = function()
|
||||||
vehicle = makeVeh(data.model, data.coords)
|
vehicle = makeVeh(data.model, data.coords, false)
|
||||||
if onEnter then
|
if onEnter then
|
||||||
debugPrint("^6Bridge^7: ^4makeDistVehicle ^3onEnter^7() ^2running^7")
|
debugPrint("^6Bridge^7: ^4makeDistVehicle ^3onEnter^7() ^2running^7")
|
||||||
onEnter(vehicle)
|
onEnter(vehicle)
|
||||||
|
|||||||
@@ -119,6 +119,27 @@ function progressBar(data)
|
|||||||
result = false
|
result = false
|
||||||
end, data.icon)
|
end, data.icon)
|
||||||
|
|
||||||
|
elseif Config.System.ProgressBar == "qs" then -- documentation left intact based on qs interface
|
||||||
|
local qs_success = exports['qs-interface']:ProgressBar({
|
||||||
|
duration = debugMode and 1000 or data.time, -- Duration of the progress bar (in milliseconds)
|
||||||
|
label = data.label, -- Text that will appear on the progress bar
|
||||||
|
position = 'bottom', -- Position of the progress bar on the screen (e.g., 'top', 'bottom', 'center')
|
||||||
|
useWhileDead = data.dead or false, -- Whether the progress bar shows when the player is dead (true/false)
|
||||||
|
canCancel = data.cancel or true, -- Whether the player can cancel the progress (true/false)
|
||||||
|
disable = data.disableMovement or false, -- Whether to disable player controls during the progress (true/false)
|
||||||
|
anim = { -- Animation to be played while the progress is happening
|
||||||
|
dict = data.dict,
|
||||||
|
clip = data.anim,
|
||||||
|
flag = data.flag or 32 -- Optional animation flags
|
||||||
|
},
|
||||||
|
prop = nil -- Optional prop to show alongside the progress bar (can be nil)
|
||||||
|
})
|
||||||
|
if qs_success then
|
||||||
|
result = true
|
||||||
|
else
|
||||||
|
result = false
|
||||||
|
end
|
||||||
|
|
||||||
elseif Config.System.ProgressBar == "esx" then
|
elseif Config.System.ProgressBar == "esx" then
|
||||||
ESX.Progressbar(data.label, debugMode and 1000 or data.time, {
|
ESX.Progressbar(data.label, debugMode and 1000 or data.time, {
|
||||||
FreezePlayer = true,
|
FreezePlayer = true,
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ function triggerNotify(title, message, type, src)
|
|||||||
else
|
else
|
||||||
TriggerClientEvent("QBCore:Notify", src, message, type)
|
TriggerClientEvent("QBCore:Notify", src, message, type)
|
||||||
end
|
end
|
||||||
|
elseif Config.System.Notify == "qs" then
|
||||||
|
if not src then
|
||||||
|
exports['qs-interface']:AddNotify(message, title, 6000)
|
||||||
|
else
|
||||||
|
TriggerClientEvent('interface:notification', src, message, title, 6000)
|
||||||
|
end
|
||||||
elseif Config.System.Notify == "ox" then
|
elseif Config.System.Notify == "ox" then
|
||||||
if not src then
|
if not src then
|
||||||
TriggerEvent('ox_lib:notify', { title = title, description = message, type = type or "success" })
|
TriggerEvent('ox_lib:notify', { title = title, description = message, type = type or "success" })
|
||||||
|
|||||||
Reference in New Issue
Block a user