1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-06-25 00:04:15 +02:00
parent be02d05ba8
commit fc7ea910e9
35 changed files with 11992 additions and 1 deletions

View file

@ -0,0 +1,39 @@
local currentTimerOnFinish = nil
---@param label string
---@param time number
---@param position string
---@param onFinish function
local showTimer = function(label, time, position, onFinish)
currentTimerOnFinish = onFinish
SendNUIMessage({
action = 'timer',
data = {
label = label,
time = time,
position = position,
}
})
SendNUIMessage({
action = 'setVisibleTimer',
data = true
})
end
exports("showTimer", showTimer)
local hideTimer = function()
SendNUIMessage({
action = 'setVisibleTimer',
data = false
})
currentTimerOnFinish = nil
end
exports("hideTimer", hideTimer)
RegisterNuiCallback('finishTimer', function(data, cb)
if currentTimerOnFinish then
currentTimerOnFinish()
hideTimer()
end
cb(true)
end)