Meters UI - OutDated
You can create multiple circle meters with timer
Last updated
You can create multiple circle meters with timer
Last updated
You can create 5 meters in same time. All meters run async.
local uiData = {
imgColor = `COLOR_GREEN`,
isIconBackgroundVisible = 0,
meterColor = `COLOR_GREEN`,
meterValue = 1.0,
meterVisible = true,
overlayColor = `COLOR_GREEN`,
overlayTxd = "scoretimer_textures",
overlayTxn = "SCORETIMER_GENERIC_CROSS",
overlayVisible = false,
secondaryImgColor = `COLOR_PURE_WHITE`,
secondaryTxd = "0",
secondaryTxn = "0",
showAlternateIcons = 0,
showBlinkIcon = 0,
showPulse = 0,
txd = "blips",
txn = "blip_ambient_train",
visible = true,
}
local meterData = createMeter(uiData)
.
.
.
local meterData = createMeter(uiData)
local uiData = {
txd = "hud_textures",
txn = "bank_debt",
showBlinkIcon = 0,
isIconBackgroundVisible = 0,
showPulse = 1,
}
meterData:updateMeter(uiData)
.
.
.
local meterData = createMeter(uiData)
local time = 20 -- 20 second
meterData:SetTimer(time,function(iscomplete)
print(iscomplete) -- when time is over run this line
end)
Wait(3000)
meterData:timerPause()
Wait(2000)
meterData:timerResume()
Wait(2000)
meterData:timerStop() -- if you use this function before not ending time, isComplete return "false"
RegisterCommand("createMeter",function()
local uiData = {
imgColor = `COLOR_GREEN`,
isIconBackgroundVisible = 0,
meterColor = `COLOR_GREEN`,
meterValue = 1.0,
meterVisible = true,
overlayColor = `COLOR_GREEN`,
overlayTxd = "scoretimer_textures",
overlayTxn = "SCORETIMER_GENERIC_CROSS",
overlayVisible = false,
secondaryImgColor = `COLOR_PURE_WHITE`,
secondaryTxd = 0,
secondaryTxn = 0,
showAlternateIcons = 0,
showBlinkIcon = 0,
showPulse = 0,
txd = "blips",
txn = "blip_ambient_train",
visible = true,
}
local meterData = exports["qadr_ui"]:createMeter(uiData)
local wait = math.random(1000,5000)
print("wait: "..wait)
Wait(wait)
local uiData = {
txd = "hud_textures",
txn = "bank_debt",
showBlinkIcon = 0,
isIconBackgroundVisible = 0,
showPulse = 0,
}
meterData:updateMeter(uiData)
meterData:SetTimer(20,function(iscomplete)
print("iscomplete",iscomplete)
if iscomplete then
print("timer is complete")
end
end)
wait = math.random(1000,5000)
print("wait: "..wait)
Wait(wait)
print("timer paused")
meterData:timerPause()
wait = math.random(1000,5000)
print("wait: "..wait)
Wait(wait)
print("timer resumed")
meterData:timerResume()
wait = math.random(1000,5000)
Wait(wait)
local luck = math.random(1,2)
if luck == 1 then
print("unlucky timer stopped")
meterData:timerStop()
end
end)