feat: variable decay time oxygen timer (#17)

This commit is contained in:
Justin Furnas
2025-07-12 15:55:47 +02:00
committed by GitHub
parent 0f7fbc3595
commit b5fdb3a8f9
3 changed files with 6 additions and 4 deletions
+1
View File
@@ -9,6 +9,7 @@ Works with [qbx_diving](https://github.com/Qbox-project/qbx_diving/), a coral di
# Features # Features
- Able to set the length of time an air tank will refill your tank - Able to set the length of time an air tank will refill your tank
- Able to configure the rate of decay of the oxygen tank (to allow longer time in the water)
- Limitations for refilling underwater (to limit endless use of air tanks) - Limitations for refilling underwater (to limit endless use of air tanks)
- animations and timers during refill - animations and timers during refill
- Text that displays current air time at the bottom of the player's screen when underwater and wearing gear - Text that displays current air time at the bottom of the player's screen when underwater and wearing gear
+1 -1
View File
@@ -115,7 +115,7 @@ local function startOxygenLevelDecrementerThread()
CreateThread(function() CreateThread(function()
while currentGear.enabled do while currentGear.enabled do
if IsPedSwimmingUnderWater(cache.ped) and oxygenLevel > 0 then if IsPedSwimmingUnderWater(cache.ped) and oxygenLevel > 0 then
oxygenLevel -= 1 oxygenLevel -= config.decayRate
if oxygenLevel % 10 == 0 and oxygenLevel ~= config.startingOxygenLevel then if oxygenLevel % 10 == 0 and oxygenLevel ~= config.startingOxygenLevel then
-- Initiate breathing suit audio -- Initiate breathing suit audio
end end
+2 -1
View File
@@ -2,5 +2,6 @@ return {
startingOxygenLevel = 100, startingOxygenLevel = 100,
putOnSuitTimeMs = 5000, putOnSuitTimeMs = 5000,
takeOffSuitTimeMs = 5000, takeOffSuitTimeMs = 5000,
refillTankTimeMs = 5000 refillTankTimeMs = 5000,
decayRate = 1, -- The rate at which the oxygen level decays. Defaults to 1.
} }