feat: variable decay time oxygen timer (#17)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
+2
-2
@@ -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
|
||||||
@@ -167,4 +167,4 @@ RegisterNetEvent('qbx_divegear:client:useGear', function()
|
|||||||
else
|
else
|
||||||
putOnSuit()
|
putOnSuit()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
+3
-2
@@ -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.
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user