> 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/events.md).

# Events

## Send Unit On Duty

<mark style="color:orange;">`Client to Server`</mark> `nex-duty:server:go_on_duty`

<table><thead><tr><th width="216.27276611328125">Argument</th><th width="139.7274169921875">Type</th><th width="300">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>entity_id</code></td><td>string</td><td>The entity identifier the player will be going on duty as</td><td><code>"lspd"</code></td></tr><tr><td><code>callsign [optional]</code></td><td>string</td><td>An optional callsign value for the </td><td><code>"1S-57"</code> or <code>null</code></td></tr><tr><td><code>loadout</code></td><td>integer</td><td>Whether the loadout for the entity should be applied to the player.</td><td><code>1</code> or <code>0</code></td></tr><tr><td><code>bodycam</code></td><td>integer</td><td>Whether the bodycam interface should be shown whilst on duty.</td><td><code>1</code> or <code>0</code></td></tr></tbody></table>

{% tabs %}
{% tab title="Client Side" %}

```lua
TriggerServerEvent("nex-duty:server:go_on_duty", "lspd", "1S-57", 0, 0)
```

{% endtab %}
{% endtabs %}

## Send Off / Suspend a Unit

<mark style="color:orange;">`Client to Server`</mark> `nex-duty:server:execute_user_action`

<table><thead><tr><th width="145.3636474609375">Argument</th><th width="139.7274169921875">Type</th><th width="300.45458984375">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>user</code></td><td>integer</td><td>The source of the player you intend to execute an action on.</td><td><code>12</code></td></tr><tr><td><code>action</code></td><td>string</td><td><code>suspend</code> or <code>offduty</code></td><td><code>suspend</code> or <code>offduty</code></td></tr><tr><td><code>data</code></td><td>object</td><td>The optional data for the function, length is required for a suspension, and is processed as an integer in hours.</td><td><pre><code>{
    "reason": "Reckless Engagement",
    "length": 12
}
</code></pre></td></tr><tr><td><code>entity</code></td><td>string</td><td>The entity identifier of the unit</td><td><code>lspd</code></td></tr></tbody></table>

{% tabs %}
{% tab title="Suspend \[Client Side]" %}
{% code overflow="wrap" %}

```lua
TriggerServerEvent("nex-duty:server:execute_user_action", 12, "suspend", { "reason": "Reckless Endangerment", "length": 12 }, "lspd")
```

{% endcode %}
{% endtab %}

{% tab title="Send Off \[Client Side]" %}
{% code overflow="wrap" %}

```lua
TriggerServerEvent("nex-duty:server:execute_user_action", 12, "offduty", { "reason": "Reckless Endangerment" }, "lspd")
```

{% endcode %}
{% endtab %}
{% endtabs %}
