KillTimer

Description

Kills (stops) a running timer.

NameDescription
timeridThe ID of the timer to kill (returned by SetTimer or SetTimerEx).

Returns

This function always returns 0.

Examples

new
gConnectTimer[MAX_PLAYERS] = {-1, ...};
public OnPlayerConnect(playerid)
{
print("Starting timer...");
gConnectTimer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(gConnectTimer[playerid]);
gConnectTimer[playerid] = -1;
return 1;
}
forward WelcomeTimer(playerid);
public WelcomeTimer(playerid)
{
SendClientMessage(playerid, -1, "Welcome!");
}

Related Functions