mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Merge pull request #51 from oosayeroo/main
This commit is contained in:
@@ -13,9 +13,9 @@ local Vehicles = {}
|
||||
--- ```lua
|
||||
--- local vehicle = makeVeh('adder', vector4(123.4, 567.8, 90.1, 180.0))
|
||||
--- ```
|
||||
function makeVeh(model, coords)
|
||||
function makeVeh(model, coords, synced)
|
||||
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)
|
||||
if gameName ~= "rdr3" then
|
||||
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),
|
||||
radius = radius,
|
||||
onEnter = function()
|
||||
vehicle = makeVeh(data.model, data.coords)
|
||||
vehicle = makeVeh(data.model, data.coords, false)
|
||||
if onEnter then
|
||||
debugPrint("^6Bridge^7: ^4makeDistVehicle ^3onEnter^7() ^2running^7")
|
||||
onEnter(vehicle)
|
||||
|
||||
@@ -119,6 +119,27 @@ function progressBar(data)
|
||||
result = false
|
||||
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
|
||||
ESX.Progressbar(data.label, debugMode and 1000 or data.time, {
|
||||
FreezePlayer = true,
|
||||
|
||||
@@ -44,6 +44,12 @@ function triggerNotify(title, message, type, src)
|
||||
else
|
||||
TriggerClientEvent("QBCore:Notify", src, message, type)
|
||||
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
|
||||
if not src then
|
||||
TriggerEvent('ox_lib:notify', { title = title, description = message, type = type or "success" })
|
||||
|
||||
Reference in New Issue
Block a user