warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
IsValidTimer
warning
This function was added in omp v1.1.0.2612 and will not work in earlier versions!
Description
Checks if a timer is valid.
Parameters
Name | Description |
---|---|
timerid | The ID of the timer to check. |
Return Values
true: Timer is valid.
false: Timer is not valid.
Examples
new g_Timer;
public OnGameModeInit()
{
g_Timer = SetTimer("TimerCallback", 60000, true);
return 1;
}
public OnGameModeExit()
{
if (IsValidTimer(g_Timer))
{
printf("Timer ID %d is valid.", g_Timer);
KillTimer(g_Timer);
}
else
{
printf("Timer ID %d is not valid.", g_Timer);
}
return 1;
}
Related Functions
- SetTimer: Set a timer.
- SetTimerEx: Set a timer with parameters.
- KillTimer: Stop a timer.
- IsRepeatingTimer: Checks if a timer is set to repeat.
- CountRunningTimers: Get the running timers.