SetTimer
From SA-MP Wiki
Description:
Sets a 'timer' to call a function after some time. Can be set to repeat.
(funcname[], interval, repeating)
funcname[] | Name of the function to call as a string. This must be a public function (forwarded). A null string here will crash the server. |
interval | Interval in milliseconds. |
repeating | Boolean (true/false) on whether the timer should repeat or not. |
Return Values:
The ID of the timer that was started. Timer IDs start at 1.
Notes |
|
Example Usage:
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.