getTimerDetails | Multi Theft Auto: Wiki Skip to content

getTimerDetails

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is for getting the details of a running timer.

Syntax

getTimerDetails ( )

Code Examples

server

This example creates a 1 second (1000 ms) timer that will run 10 times, and you can see the timer details by using the command: timerdetails.

theTimer = setTimer(function() end, 1000, 10) -- A timer that does nothing.
function timerDetails()
local remaining, executesRemaining, timeInterval = getTimerDetails(theTimer) -- Get the timers details
if (remaining and executesRemaining and timeInterval) then
outputChatBox("Time remaining this second: "..remaining.." Executes remaining: "..executesRemaining.." Time interval: "..timeInterval)
else
outputChatBox("Timer no longer exists")
end
end
addCommandHandler("timerdetails", timerDetails)