> For the complete documentation index, see [llms.txt](https://nexeum.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nexeum.gitbook.io/docs/nex-duty/listeners.md).

# Listeners

## On Duty Start

`nex-duty:server:onDutyStart`

**Example:**

{% code overflow="wrap" %}

```lua
AddEventHandler("nex-duty:server:onDutyStart", function(source, callsign, entity_id)
    -- do cool thing here!
end)
```

{% endcode %}

**Returns**

| Value       | Description              | Example   |
| ----------- | ------------------------ | --------- |
| `source`    | The source of the unit   | `21`      |
| `callsign`  | The callsign of the unit | `"1S-21"` |
| `entity_id` | The entity identifier    | `"sasp"`  |

## On Duty End

`nex-duty:server:onDutyEnd`

**Example:**

{% code overflow="wrap" %}

```lua
AddEventHandler("nex-duty:server:onDutyEnd", function(source, entity_id)
    -- do cool thing here!
end)
```

{% endcode %}

**Returns**

| Value       | Description            | Example  |
| ----------- | ---------------------- | -------- |
| `source`    | The source of the unit | `21`     |
| `entity_id` | The entity identifier  | `"sasp"` |

## On Unit Suspended

`nex-duty:server:onUnitSuspended`

**Example:**

{% code overflow="wrap" %}

```lua
AddEventHandler("nex-duty:server:onUnitSuspended", function(source, entity_id, suspension_end)
    -- do cool thing here!
end)
```

{% endcode %}

**Returns**

| Value            | Description                                        | Example        |
| ---------------- | -------------------------------------------------- | -------------- |
| `source`         | The source of the unit                             | `21`           |
| `entity_id`      | The entity identifier                              | `"sasp"`       |
| `suspension_end` | A UTC epoch timestamp of when the suspension ends. | `"1767225600"` |
