<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gallardo956</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gallardo956"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Gallardo956"/>
	<updated>2026-04-29T19:33:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetTimer&amp;diff=82414</id>
		<title>ResetTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetTimer&amp;diff=82414"/>
		<updated>2025-08-24T09:15:41Z</updated>

		<summary type="html">&lt;p&gt;Gallardo956: I've tested many timers that have a limited number of repeats with a range of 5,000 ms and a limited repeat of 1 time, and it works, so it can lead many people astray.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to reset the value of the elapsed time in existing timers. The function resets the &amp;quot;execution time&amp;quot; value for timers with a limited number of repetitions.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool resetTimer ( timer theTimer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[timer]]:reset||}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theTimer:''' The [[timer]] whose elapsed time you wish to reset.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the timer was successfully reset, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This example shows how you can reset timer by using /rtimer command.&lt;br /&gt;
&lt;br /&gt;
local timerElement = false&lt;br /&gt;
&lt;br /&gt;
function timerFunction()&lt;br /&gt;
	print(&amp;quot;Timer function executed at &amp;quot;..getTickCount())&lt;br /&gt;
end&lt;br /&gt;
timerElement = setTimer(timerFunction, 3000, 0)&lt;br /&gt;
&lt;br /&gt;
function timerResetCommand()&lt;br /&gt;
	local validTimer = isTimer(timerElement)&lt;br /&gt;
&lt;br /&gt;
	if validTimer then&lt;br /&gt;
		print(&amp;quot;Timer has been resetted.&amp;quot;)&lt;br /&gt;
		resetTimer(timerElement)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;rtimer&amp;quot;, timerResetCommand)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Gallardo956</name></author>
	</entry>
</feed>