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

# Installation Guide

{% stepper %}
{% step %}

### Script Permissions

In order for the script to apply and remove ace permissions and groups, you need to give the resource access to execute commands. In your `server.cfg`, add the following line:&#x20;

{% code overflow="wrap" %}

```javascript
add_ace resource.nex-duty command allow
```

{% endcode %}
{% endstep %}

{% step %}

### Server Configuration

In `config/server_config.lua`, insert your Discord Bot token into `Server_Config.BotToken`  and your servers name into the `Server_Config.MessageFooter`. If you're not using [DutyLogs.com](https://dutylogs.com/) integrations, you can leave the rest of the server configuration alone.
{% endstep %}

{% step %}

### Shared Configuration

It's now time to work through the `config/shared_config.lua`. This is a detailed configuration file, everything in the file has comments next to the option to provide information on the option.&#x20;

It's recommended that you read through all the options, and their comments, to understand how the script works. A lot of the options are set by default, but you will have to adjust `Config.ServerName` to your servers name, insert the optional identifiers to `Config.GlobalLogging` etc.&#x20;

In the script, `Config.Entities` is an umbrella term for Departments and Teams, as many servers include to have both departments (like LEO, Fire etc) and their Staff Team setup through nex-duty. In the default version, we include two entities: an LEO Department and a Staff Team. You can copy and paste these to create as many more as you wish.&#x20;

Image Icons for entities are stored in the `ui/assets` folder, the file must be a `.png` and named with the identifier (id) of the entity, such as: `bcso.png` or `lspd.png`.&#x20;

**Entities Configuration**

<table><thead><tr><th width="186.6363525390625">Option</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>This is the main identifier of the entity, and is used as part of the ace permission to grant players access to the entity. </td></tr><tr><td><code>name</code></td><td>This is the primary name of the entity.</td></tr><tr><td><code>image_url</code></td><td>The Image URL is only required if using the DutyLogs integration, and should include an image hosted with a <code>.png</code>.</td></tr><tr><td><code>short_name</code></td><td>In parts of the script and notifications, a short name for the entity will be used. This can be a shortened version of the main name, such as <code>State Police</code>, instead of <code>San Andreas State Police</code>. </td></tr><tr><td><code>prefix</code></td><td>This is the prefix for the entity, for example, "You have gone off duty with &#x3C;entity_name>" where required.</td></tr><tr><td><code>colour</code></td><td>If <code>has_blips</code> is true, duty blips will be shown in the in-game map, this provides the option to configure the colour of the blip. The available colours can be found <a href="https://docs.fivem.net/docs/game-references/blips/#blip-colors">here</a>. </td></tr><tr><td><code>has_blips</code></td><td>A <code>true</code> or <code>false</code> option to toggle whether the entity has duty blips shown in the in-game map.</td></tr><tr><td><code>require_callsign</code></td><td>This controls whether or not when a player goes on duty, a callsign is required before going on duty or not. This is a <code>true</code> or <code>false</code> option.</td></tr><tr><td><code>loadout</code></td><td>If you want units to be automatically provided weapons when going on duty, this should be the <code>id</code> of the configured loadout from <code>Config.Loadouts</code>. If you don't want to provide a loadout, you can keep this option blank.</td></tr><tr><td><code>enable_bodycam</code></td><td>This controls whether or not when a player goes on duty, the ability to enable the bodycam is provided before going on duty or not. This is a <code>true</code> or <code>false</code> option.</td></tr><tr><td><code>can_view</code></td><td>This is an array of other entities <code>id</code>'s that the configured entity can view through the duty blip system, both in-game and for servers using the DutyLogs livemap. If you don't want the entity to view any others, this can be kept empty like: <code>{}</code></td></tr><tr><td><code>logging</code></td><td>This is the Independent Logging for the entity, if your server has separate discord or area for a department or team, you can configure the guild and channel identifier that the log messages will be sent to. </td></tr></tbody></table>

**Rank Configuration**

<table><thead><tr><th width="232.0908203125">Option</th><th>Description</th></tr></thead><tbody><tr><td><code>rank</code></td><td>This, like with Entities, is the main identifier for the rank, and is used as part of the ace permission to grant players access to the entity. </td></tr><tr><td><code>name</code></td><td>This is the Display Name of the rank.</td></tr><tr><td><code>can_direct_message</code></td><td>A <code>true</code> or <code>false</code> option, used as part of the DutyLogs.com integrations for direct messages.</td></tr><tr><td><code>is_supervisor</code></td><td>A <code>true</code> or <code>false</code> option to label a rank as being a Supervisor. Supervisors can send off duty, and suspend, non-supervisor members. </td></tr><tr><td><code>is_command</code></td><td>A <code>true</code> or <code>false</code> option to label a rank as being a Command member. Command can send off duty, and suspend, non-command members, and supervisors. </td></tr><tr><td><code>manage_suspensions</code></td><td>A <code>true</code> or <code>false</code> option, allowing the ability to manage active suspensions in the <code>/duty manage</code> menu.</td></tr><tr><td><code>has_global_permissions</code></td><td>A <code>true</code> or <code>false</code> option, which provides global management powers across all entities, bypassing both Supervisors and Command members. This was created for members of staff to use to manage department members.</td></tr><tr><td><code>ace_permissions</code></td><td>This is an array of ace permissions that will be granted, and removed, when going on and off duty. For example, if you want to grant users access to a certain script only whilst they're on duty, you can input the ace permission for that script, like <code>police-tools.spike_strip</code> inside the array, and the units will receive this when they go on duty, and it'll be removed when going off duty. </td></tr><tr><td><code>groups</code></td><td>This is an array of groups that will be granted, and removed, when going on and off duty. For example, if you want to add users to an existing permissions group, such as <code>job.police</code> whilst they're on duty, you would add <code>job.police</code> inside the array, and the units will be added to this group whilst they're on duty, and be removed once they go off duty. </td></tr></tbody></table>
{% endstep %}

{% step %}

### Notifications

In `functions/sv_notifications.lua`, insert your notifications export/event into the appropriate place. Without completing this step, you won't receive any notifications for any errors, or actions. This is a step a few people miss, and wonder why nothing happens when executing a command they don't have access to. Make sure you do this!
{% endstep %}

{% step %}

### Database Integration

In `database.sql`, this contains the tables for the script. You can copy the contents of the file, and insert the tables into your servers database.&#x20;
{% endstep %}

{% step %}

### Going on Duty

It's now permissions time. Our permissions system is dynamic, and what we mean by that is they change depending on the entity and rank you wish to grant players. Here's three examples from each pre-configured entities in the default shared configuration.

<table><thead><tr><th width="129.5455322265625">Entity</th><th width="235.727294921875">Rank</th><th>Ace Permission</th></tr></thead><tbody><tr><td><code>sasp</code></td><td><code>member</code></td><td><code>nex-duty.sasp.member</code></td></tr><tr><td><code>sasp</code></td><td><code>supervisor</code></td><td><code>nex-duty.sasp.supervisor</code></td></tr><tr><td><code>sasp</code></td><td><code>high_command</code></td><td><code>nex-duty.sasp.high_command</code></td></tr><tr><td><code>staff</code></td><td><code>junior_moderator</code></td><td><code>nex-duty.staff.junior_moderator</code></td></tr><tr><td><code>staff</code></td><td><code>moderator</code></td><td><code>nex-duty.staff.moderator</code></td></tr><tr><td><code>staff</code></td><td><code>senior_moderator</code></td><td><code>nex-duty.staff.senior_moderator</code></td></tr></tbody></table>

If you want to test out an ace permission, here's a useful placeholder command to use:

{% tabs %}
{% tab title="Placeholder" %}
{% code overflow="wrap" %}

```javascript
add_ace identifier.discord:<discord_id> nex-duty.<entity>.<rank> allow
```

{% endcode %}
{% endtab %}

{% tab title="Example" %}
{% code overflow="wrap" %}

```js
add_ace identifier.discord:123456789123456789 nex-duty.sasp.member allow
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

If you've read through this while guide, and are still left with questions, you can join our [discord server](https://discord.nexeumstudios.com/). Once you've joined, navigate to the `network-support` channel at the top of the discord, create a ticket, list your question, or issue, inside the ticket and our team will get back to you soon.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nexeum.gitbook.io/docs/nex-duty/installation-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
