mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

getTimerDetails returns strange numbers as the remaining time inside the timer function

Open FileEX opened this issue 1 year ago • 0 comments

Describe the bug

The getTimerDetails function returns strange numbers as the remaining time. This problem only occurs when we use getTimerDetails inside a timer function. Otherwise, it returns the correct remaining time.

image

image

Steps to reproduce

local exampleTimer

function timerCallback()
	local remainingTime = getTimerDetails(sourceTimer)
	print('Reamining time in callback: ', remainingTime)
end
exampleTimer = setTimer(timerCallback, 1000, 10)

setTimer(function()
	local remainingTime = getTimerDetails(exampleTimer)
	print('Remaining time beyond callback: ', remainingTime)
end, 100, 10) -- 100 or 1000

Version

Multi Theft Auto v1.6-release-22396

Additional context

No response

Relevant log output

No response

Security Policy

  • [X] I have read and understood the Security Policy and this issue is not security related.

FileEX avatar Apr 01 '24 21:04 FileEX