Installation Guide
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 integrations, you can leave the rest of the server configuration alone.
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.
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.
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.
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.
Entities Configuration
id
This is the main identifier of the entity, and is used as part of the ace permission to grant players access to the entity.
name
This is the primary name of the entity.
image_url
The Image URL is only required if using the DutyLogs integration, and should include an image hosted with a .png.
short_name
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 State Police, instead of San Andreas State Police.
prefix
This is the prefix for the entity, for example, "You have gone off duty with <entity_name>" where required.
colour
If has_blips 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 here.
has_blips
A true or false option to toggle whether the entity has duty blips shown in the in-game map.
require_callsign
This controls whether or not when a player goes on duty, a callsign is required before going on duty or not. This is a true or false option.
loadout
If you want units to be automatically provided weapons when going on duty, this should be the id of the configured loadout from Config.Loadouts. If you don't want to provide a loadout, you can keep this option blank.
enable_bodycam
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 true or false option.
can_view
This is an array of other entities id'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: {}
logging
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.
Rank Configuration
rank
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.
name
This is the Display Name of the rank.
can_direct_message
A true or false option, used as part of the DutyLogs.com integrations for direct messages.
is_supervisor
A true or false option to label a rank as being a Supervisor. Supervisors can send off duty, and suspend, non-supervisor members.
is_command
A true or false option to label a rank as being a Command member. Command can send off duty, and suspend, non-command members, and supervisors.
manage_suspensions
A true or false option, allowing the ability to manage active suspensions in the /duty manage menu.
has_global_permissions
A true or false 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.
ace_permissions
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 police-tools.spike_strip inside the array, and the units will receive this when they go on duty, and it'll be removed when going off duty.
groups
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 job.police whilst they're on duty, you would add job.police 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.
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!
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.
sasp
member
nex-duty.sasp.member
sasp
supervisor
nex-duty.sasp.supervisor
sasp
high_command
nex-duty.sasp.high_command
staff
junior_moderator
nex-duty.staff.junior_moderator
staff
moderator
nex-duty.staff.moderator
staff
senior_moderator
nex-duty.staff.senior_moderator
If you want to test out an ace permission, here's a useful placeholder command to use:
add_ace identifier.discord:<discord_id> nex-duty.<entity>.<rank> allowadd_ace identifier.discord:123456789123456789 nex-duty.sasp.member allowIf you've read through this while guide, and are still left with questions, you can join our discord server. 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.
Last updated