fix(client): config options and interact sound (#7)

This commit is contained in:
Matthew
2023-12-24 15:57:00 +01:00
committed by GitHub
parent 7d809f99a8
commit 60dd3a9851
2 changed files with 8 additions and 9 deletions
+7 -8
View File
@@ -25,7 +25,7 @@ lib.callback.register('qbx_divegear:client:fillTank', function()
end
if lib.progressBar({
duration = config.RefillTankTimeMs,
duration = config.refillTankTimeMs,
label = Lang:t('info.filling_air'),
useWhileDead = false,
canCancel = true,
@@ -35,7 +35,6 @@ lib.callback.register('qbx_divegear:client:fillTank', function()
blendIn = 8.0
}
}) then
oxygenLevel = config.startingOxygenLevel
exports.qbx_core:Notify(Lang:t('success.tube_filled'), 'success')
if currentGear.enabled then
@@ -76,7 +75,7 @@ end
local function takeOffSuit()
if lib.progressBar({
duration = config.TakeOffSuitTimeMs,
duration = config.takeOffSuitTimeMs,
label = Lang:t('info.pullout_suit'),
useWhileDead = false,
canCancel = true,
@@ -91,7 +90,7 @@ local function takeOffSuit()
currentGear.enabled = false
deleteGear()
exports.qbx_core:Notify(Lang:t('success.took_out'))
TriggerServerEvent('InteractSound_SV:PlayOnSource', nil, 0.25)
-- Stop breathing suit audio
end
end
@@ -112,11 +111,11 @@ local function startOxygenLevelDecrementerThread()
if IsPedSwimmingUnderWater(cache.ped) and oxygenLevel > 0 then
oxygenLevel -= 1
if oxygenLevel % 10 == 0 and oxygenLevel ~= config.startingOxygenLevel then
TriggerServerEvent('InteractSound_SV:PlayOnSource', 'breathdivingsuit', 0.25)
-- Initiate breathing suit audio
end
if oxygenLevel == 0 then
disableScuba()
TriggerServerEvent('InteractSound_SV:PlayOnSource', nil, 0.25)
-- Stop breathing suit audio
end
end
Wait(1000)
@@ -136,7 +135,7 @@ local function putOnSuit()
end
if lib.progressBar({
duration = config.PutOnSuitTimeMs,
duration = config.putOnSuitTimeMs,
label = Lang:t('info.put_suit'),
useWhileDead = false,
canCancel = true,
@@ -150,7 +149,7 @@ local function putOnSuit()
attachGear()
enableScuba()
currentGear.enabled = true
TriggerServerEvent('InteractSound_SV:PlayOnSource', 'breathdivingsuit', 0.25)
-- Initiate breathing suit audio
startOxygenLevelDecrementerThread()
startOxygenLevelDrawTextThread()
end
+1 -1
View File
@@ -2,5 +2,5 @@ return {
startingOxygenLevel = 100,
putOnSuitTimeMs = 5000,
takeOffSuitTimeMs = 5000,
RefillTankTimeMs = 5000
refillTankTimeMs = 5000
}