KillTimer
From SA-MP Wiki
Description:
Kills (stops) a running timer.
(timerid)
timerid | The ID of the timer to kill (returned by SetTimer or SetTimerEx). |
Return Values:
This function always returns 0.
new connect_timer[MAX_PLAYERS]; public OnPlayerConnect(playerid) { print("Starting timer..."); connect_timer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid); return 1; } public OnPlayerDisconnect(playerid) { KillTimer(connect_timer[playerid]); return 1; } forward WelcomeTimer(playerid); public WelcomeTimer(playerid) { SendClientMessage(playerid, -1, "Welcome!"); }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetTimer: Set a timer.
- SetTimerEx: Set a timer with parameters.