I finally got it working..
Before today I tought that the timer function only worked with integers, but today I spotted the word "float" in the description and tested that..
It seems to do the trick.
function GM:HUDPaint()
cntPcnt = math.floor((300/cntMax)*cntTest)
cntPcntD3 = math.floor(cntPcnt/3)
if stopdraw == false then
draw.RoundedBox(2, boxLeft, boxTop, cntPcnt, 25, Color(0, 255, 0) )
draw.RoundedBox(2, boxLeft+cntPcnt, boxTop, 300-cntPcnt, 25, Color(255, 0, 0) )
draw.SimpleText(cntPcntD3, "ScoreboardText", boxLeft+150, 47, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
if cntPcnt >= 300 then
stopdraw = true
print(string.ToMinutesSecondsMilliseconds(1234.5678))
end
end
function advanceProgressA()
cntTest = cntTest + 1
if cntTest < cntMax then
timer.Create("ProgressTimerB", 0.1, 1, advanceProgressB, "")
end
end
function advanceProgressB()
cntTest = cntTest + 1
if cntTest < cntMax then
timer.Create("ProgressTimerA", 0.1, 1, advanceProgressA, "")
end
end
function startProgress(durationMS)
cntMax = math.Round(durationMS/10)
cntTest = 0
timer.Create("ProgressTimerA", 0.1, 1, advanceProgressA, "")
stopdraw = false
end
startProgress(3000)