(info) Other great resources: Official JS API docs, Scripting Forum

removeTimer()

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

 

Syntax

Queues 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.

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

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

setTimer("foo", 1000);
queue("foo", 2000);
 
removeTimer("foo"); // cancel both the timer and the queue
Availability 3.1 B1+

Requires:

  • Warzone 3.1 or above
Contents

Jump to:

See also

Related articles:

Â