diff --git a/README.md b/README.md index f577549..792109e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Works with [qbx_diving](https://github.com/Qbox-project/qbx_diving/), a coral di # Features - 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) - animations and timers during refill - Text that displays current air time at the bottom of the player's screen when underwater and wearing gear diff --git a/client/main.lua b/client/main.lua index b1e0ef8..42b8628 100644 --- a/client/main.lua +++ b/client/main.lua @@ -115,7 +115,7 @@ local function startOxygenLevelDecrementerThread() CreateThread(function() while currentGear.enabled do if IsPedSwimmingUnderWater(cache.ped) and oxygenLevel > 0 then - oxygenLevel -= 1 + oxygenLevel -= config.decayRate if oxygenLevel % 10 == 0 and oxygenLevel ~= config.startingOxygenLevel then -- Initiate breathing suit audio end @@ -167,4 +167,4 @@ RegisterNetEvent('qbx_divegear:client:useGear', function() else putOnSuit() end -end) \ No newline at end of file +end) diff --git a/config/client.lua b/config/client.lua index c61e1e8..1665c0a 100644 --- a/config/client.lua +++ b/config/client.lua @@ -2,5 +2,6 @@ return { startingOxygenLevel = 100, putOnSuitTimeMs = 5000, takeOffSuitTimeMs = 5000, - refillTankTimeMs = 5000 -} \ No newline at end of file + refillTankTimeMs = 5000, + decayRate = 1, -- The rate at which the oxygen level decays. Defaults to 1. +}