note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to 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.