SetTimer
From SA-MP Wiki
SetTimer
Sets a timer to call a function after some time.
(funcname[], interval, repeating)
| funcname[] | Name of the function to call as a string. Needs to be a public! |
| interval | Inverval in milliseconds. |
| repeating | Boolean if the timer should occur repeatedly or only once |
Important note: The function that should be called, must be public. The means it has to be forwarded as well.
| Returns | The ID of the timer created. |
forward message(); public OnGameModeInit( ) { print("Starting timer..."); SetTimer("message",1000,false); } public message() { print("1 second has passed."); }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- SetTimerEx: Set a timer with parameters.
- KillTimer: Stop a timer.
