Help
Remember Me?
Home
Forum
Download
Scripting docs
Wiki
Main
Special Pages
Books
Recent Changes
Blogs
Wiki
Main
CreateTimer
This site has been archived and made available for preservation purposes. No edits can be made.
If this is your first visit, be sure to check out the
FAQ
by clicking the link above. You may have to
register
before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
article
discussion
source
history
Viewing source for:
CreateTimer
Creates a timer. [h="2"] Declaration [/h] [highlight=cpp] VAULTSCRIPT VAULTSPACE Timer (*VAULTAPI(CreateTimer))(VAULTSPACE RawFunction(), VAULTSPACE Interval) VAULTCPP(noexcept); [/highlight] [highlight=c] native CreateTimer(const func{}, interval); [/highlight] [h="2"] Parameters [/h] [b][wiki="Function"]Function[/wiki][/b] - the function of the timer [b][wiki="Interval"]Interval[/wiki][/b] - the timer interval in milliseconds [h="2"] Return value [/h] Returns a [wiki="Timer"]Timer[/wiki] referring to the newly created timer. [h="2"] Usage example (C++) [/h] [highlight=cpp] Result VAULTSCRIPT MyTimer() { // Timer function return static_cast<Result>(0); } Void VAULTSCRIPT exec() noexcept { CreateTimer(MyTimer, static_cast<Interval>(5000)); } [/highlight] [h="2"] Usage example (PAWN) [/h] [highlight=c] forward MyTimer(); public MyTimer() { // Timer function return 0; } main() { CreateTimer("MyTimer", 5000); } [/highlight] [h="2"] Related pages [/h] [list][*][wiki]CreateTimerEx[/wiki] [*][wiki]KillTimer[/wiki] [/LIST] [category]VaultMP interface[/category] [category]Scripting functions[/category] [category]Misc functions[/category]