Squirrel/Functions/Timers/Delete
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with "Page in construction...") |
Phildeman101 (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | ||
+ | == 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
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
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(); }
As you can see, you must use the timers variable and then the .delete() to remove it.