> For the complete documentation index, see [llms.txt](https://freilichtbuehne.gitbook.io/nova-defender/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freilichtbuehne.gitbook.io/nova-defender/lua-api-deprecated/detections.md).

# Detections

Detections are collected for each player

{% hint style="info" %}
Each detection has a predefined identifier. Unknown identifiers will be ignored. `admin_manual` will always get accepted.&#x20;
{% endhint %}

## Hooks

<details>

<summary>swatch_config_detection</summary>

#### Arguments

1. **(String)** steamID32
2. **(Player)** ply
3. **(String)** detectionIdentifier

</details>

## Functions

<details>

<summary>sWatch.checkDetection</summary>

Returns if this detection can be triggered by a specific player. This prevents a detection occuring multiple times for one player and enables you to temporary ignore a detection. This is already done inside [/pages/euVlF6nbmcFqmDBIO1NQ#swatch.kickplayer](https://freilichtbuehne.gitbook.io/nova-defender/lua-api-deprecated/pages/euVlF6nbmcFqmDBIO1NQ#swatch.kickplayer "mention") and [/pages/euVlF6nbmcFqmDBIO1NQ#swatch.banplayer](https://freilichtbuehne.gitbook.io/nova-defender/lua-api-deprecated/pages/euVlF6nbmcFqmDBIO1NQ#swatch.banplayer "mention").

#### Arguments

1. **(Player|SteamID32|SteamID64)** player
2. **(String)** detectionIdentifier

#### Returns

1. **(Boolean)** allowed - `false` if detection should not be handeled, `true` otherwise

</details>

<details>

<summary>sWatch.addDetection</summary>

Adds a detection for a player. Detections will display within the admin menus 'Players Online' tab. Will run hook [#swatch\_config\_detection](#swatch_config_detection "mention")

#### Arguments

1. **(Player|SteamID32|SteamID64)** player
2. **(String)** detectionIdentifier
3. **(String)** description (optional)

</details>

<details>

<summary>sWatch.getPlayerDetections</summary>

#### Arguments

1. **(Player|SteamID32|SteamID64)** player

#### Returns

1. **(Table)** detections - `{}` if no detections found
2. **(Table)** detectionDescriptions - contains identifier, description and time of detection. Will persist even after [#swatch.cleardetections](#swatch.cleardetections "mention").
3. **(Number)** detectionCount

</details>

<details>

<summary>sWatch.clearDetections</summary>

#### Arguments

1. **(Player|SteamID32|SteamID64)** player

</details>
