SetTimer
From SA-MP Wiki
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 | Interval in milliseconds. |
| repeating | Boolean if the timer should occur repeatedly or only once |
| Returns | The ID of the timer that was started |
| Note: Timer IDs are never used twice. You can use KillTimer() on a timer ID and it won't matter if it's running or not. |
forward message(); public OnGameModeInit() { print("Starting timer..."); SetTimer("message", 1000, false); // Set a timer of 1000 miliseconds (1 second) } public message() { print("1 second has passed."); }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetTimerEx: Set a timer with parameters.
- KillTimer: Stop a timer.
