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.
KillTimer
Description
Kills (stops) a running timer.
Name | Description |
---|---|
timerid | The ID of the timer to kill (returned by SetTimer or SetTimerEx). |
Returns
This function always returns 0.
Examples
new gConnectTimer[MAX_PLAYERS] = {0, ...};
public OnPlayerConnect(playerid)
{
print("Starting timer...");
gConnectTimer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(gConnectTimer[playerid]);
gConnectTimer[playerid] = 0;
return 1;
}
forward WelcomeTimer(playerid);
public WelcomeTimer(playerid)
{
SendClientMessage(playerid, -1, "Welcome!");
}
Related Functions
- SetTimer: Set a timer.
- SetTimerEx: Set a timer with parameters.
- IsValidTimer: Checks if a timer is valid.
- IsRepeatingTimer: Checks if a timer is set to repeat.
- GetTimerInterval: Gets the interval of a timer.
- GetTimerRemaining: Gets the remaining interval of a timer.
- CountRunningTimers: Get the running timers.