Squirrel/Functions/Timers/NewTimer
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This creates a new timer == Syntax == <code>timer NewTime( string function, int interval, int repeat, args... )</code> == Arguments == * '''function''' This is the function t...) |
Revision as of 01:29, 7 February 2009
This creates a new timer
Syntax
timer NewTime( string function, int interval, int repeat, args... )
Arguments
- function This is the function the timer will call
- interval The interval the timer will fire at in milliseconds
- repeat How many times the function will repeat (0 is infinate)
- args Any arguments you want to pass to the function when called
Example
This will start a timer saying BOO! 3 times every 5 seconds when a player joins
function OnPlayerJoin( id, name ) { NewTimer( "MessagePlayer", 5000, 3, "BOO!", id ); }
Notes
The function MessagePlayer and call OnPlayerJoin were used in in this example. More info about them in corresponding pages.
Related Functions
- NewTimer
- Timer.Delete
- Timer.Start
- Timer.Stop