Squirrel/Functions/Timers/Delete

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Page in construction...")
 
 
Line 1: Line 1:
Page in construction...
+
 
 +
== Syntax ==
 +
<code>Delete()</code>
 +
 
 +
 
 +
== How it works ==
 +
The timer delete function works by removing any timer you have defined in your script.
 +
Therefore, any new timer you create must be assigned a variable.
 +
 
 +
 
 +
== Example ==
 +
<code>function onPlayerJoin( player )
 +
{
 +
exampletimer <- NewTimer( "example", 5000, 0, player );
 +
}
 +
 
 +
function example( player )
 +
{
 +
MessagePlayer( "This is the function my timer is calling on..", pPlayer );
 +
}
 +
 
 +
function onPlayerPart( player, PartID )
 +
{
 +
exampletimer.Delete();
 +
}</code>
 +
 
 +
As you can see, you must use the timers variable and then the .delete() to remove it.

Latest revision as of 11:58, 16 November 2012

[edit] Syntax

  1. Delete()


[edit] How it works

The timer delete function works by removing any timer you have defined in your script. Therefore, any new timer you create must be assigned a variable.


[edit] Example

  1. function onPlayerJoin( player )
  2. {
  3. exampletimer <- NewTimer( "example", 5000, 0, player );
  4. }
  5.  
  6. function example( player )
  7. {
  8. MessagePlayer( "This is the function my timer is calling on..", pPlayer );
  9. }
  10.  
  11. function onPlayerPart( player, PartID )
  12. {
  13. exampletimer.Delete();
  14. }

As you can see, you must use the timers variable and then the .delete() to remove it.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox