Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Allows you to cancel all queued and timed calls associated with a specific function...

 

Syntax

Note
titleQueues are timers...

...

The queue() function uses the timer functionality behind the scenes, so when you use removeTimer() it will remove both timers and

...

queued calls for the specified function.

Overview

Excerpt

Allows you to cancel all timers associated with a specific function.

If there are multiple timers associated with a specific function, it's not possible to cancel one specific timer.

Syntax

Code Block
theme

...

RDark
languagejavascript
linenumberstrue
removeTimer(functionName);

Parameters

ParameterMandatoryTypeDescriptionGame version
functionName(tick)String

All timers (including queued function calls) associated with the named function (referenced by it's name in quotes) will be cancelled.

3.1 Beta 1

Return value

ValueTypeDescriptionGame version
undefinedUndefinedThe timers/queues associated with the function have been removed.3.1 Beta 1
<error>ErrorDid you forget to specify functionName as a string?3.1 Beta 1

Example

Code Block
theme

...

RDark
languagejavascript
title

...

Removing timers and queued calls...
linenumberstrue
function foo() {
  // do stuff
}

setTimer("foo", 1000);
queue("foo", 2000);
 
removeTimer("foo"); // cancel both 

...

the 

...

timer 

...

and 

...

the queue
Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

  • Warzone 3.1 or above
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: