diff --git a/client/main.lua b/client/main.lua index f7d1b3b..9881103 100644 --- a/client/main.lua +++ b/client/main.lua @@ -55,6 +55,20 @@ local function takeOffSuit() ClearPedTasks(cache.ped) end +local function DrawText(text) + ClearPedTasks(cache.ped) + SetTextFont(4) + SetTextProportional(true) + SetTextScale(0.0, 0.45) + SetTextDropshadow(1, 0, 0, 0, 255) + SetTextEdge(1, 0, 0, 0, 255) + SetTextDropShadow() + SetTextOutline() + BeginTextCommandDisplayText("STRING") + AddTextComponentSubstringPlayerName(text) + EndTextCommandDisplayText(0.45, 0.90) +end + local function putOnSuit() if oxygenLevel <= 0 then exports.qbx_core:Notify(Lang:t("error.need_otube"), 'error') @@ -111,7 +125,7 @@ local function putOnSuit() CreateThread(function() while currentGear.enabled do if IsPedSwimmingUnderWater(cache.ped) then - DrawText2D(oxygenLevel..'⏱', vec2(0.45, 0.90), 1.0, 1.0, 0.45) + DrawText(oxygenLevel..'⏱') end Wait(0) end diff --git a/fxmanifest.lua b/fxmanifest.lua index c4cb9d2..0440b2e 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -4,13 +4,16 @@ game 'gta5' description 'items to help players breathe and move underwater' version '0.0.0' -shared_script { +shared_scripts { '@ox_lib/init.lua', - '@qb-core/shared/locale.lua', + '@qbx_core/import.lua', + '@qbx_core/shared/locale.lua', 'locales/en.lua', 'locales/*.lua', 'config.lua', - '@qbx_core/import.lua', +} + +modules { 'qbx_core:utils', }