# killTimer (Compartilhado)

> Cancela um timer antes de ele terminar.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Compartilhado
- **Categoria**: Tempo e assíncrono
- **URL**: https://wiki.mymp.gg/pt/killTimer

## Sintaxe

```lua
bool killTimer(timer timer)
```

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `timer` | `timer` | O timer, o número que `setTimer` devolveu. |

## Retorno

`true` se o timer foi cancelado, `false` se ele não existe neste recurso.

## Exemplo

```lua
local reminder = setTimer(function()
    outputDebugString("ainda aqui")
end, 60000, 0)

addCommandHandler("quiet", function()
    if isTimer(reminder) then
        killTimer(reminder)
    end
end)
```

## Veja também

- [setTimer (Compartilhado)](https://wiki.mymp.gg/pt/setTimer.md): Chama uma função depois de um intervalo, uma vez ou repetidamente.
- [isTimer (Compartilhado)](https://wiki.mymp.gg/pt/isTimer.md): Diz se um timer ainda existe neste recurso.
- [resetTimer (Compartilhado)](https://wiki.mymp.gg/pt/resetTimer.md): Recomeça a contagem de um timer do zero, com o mesmo intervalo. As repetições que faltam não mudam.
