resetTimer | Multi Theft Auto: Wiki Skip to content

resetTimer

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 allows you to reset the value of the elapsed time in existing timers. The function resets the "execution time" value for timers with a limited number of repetitions.

Syntax

resetTimer ( )

Code Examples

server
-- This example shows how you can reset timer by using /rtimer command.
local timerElement = false
function timerFunction()
print("Timer function executed at "..getTickCount())
end
timerElement = setTimer(timerFunction, 3000, 0)
function timerResetCommand()
local validTimer = isTimer(timerElement)
if validTimer then
print("Timer has been resetted.")
resetTimer(timerElement)
end
end
addCommandHandler("rtimer", timerResetCommand)