Installation

Guardian Duty System v2 - Setup Instructions

{% hint style="info" %} Guardian Duty System v2 features a fully custom built-in UI — no ox_lib dependency required. Follow each step carefully before starting your server. {% endhint %}


1. Database Setup

Ensure you have a MySQL or MariaDB database ready. Run the following SQL to create the required tables: Database SQL

Then add the following to your server.cfg — replace the values with your own database credentials:

set gd_dbHost "localhost"
set gd_dbUser "root"
set gd_dbPassword ""
set gd_dbName "department_hours"

2. Configuring the Duty Manager Bot

  • Open the Duty_Manager_Bot folder

  • Open (or create) the .env file and fill in your credentials:

BOT_TOKEN=
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_NAME=
circle-info

The bot isn't ran off the server you will need a VPS. Here's a Free Hosting for a Bot Free Hostingarrow-up-right Here's a Paid Option VPS Paid VPSarrow-up-right


3. Configuring the Script

Open config.lua and update the following:

  • Set Config.Webhook to your Discord webhook URL for duty logs

  • Define department access under departmentPermissions

  • Add departments under Config.Departments

  • Add department logos under Config.DepartmentLogos

Ace Permissions

Grant players access to the /duty command and specific departments using ace permissions in your server.cfg:

circle-info

Each department you add in Config.Departments needs a matching ace permission entry. Players without the ace for a department will not see it in the menu.


4. Installing the Script

  1. Place the GuardianDuty folder inside your server's resources directory

  2. Add the following to your server.cfg:


5. Usage

Command
Description

/duty

Opens the duty tablet to clock on or off

  • Players select their name, callsign, and department on the login screen before clocking in

  • The body-worn camera overlay activates automatically when clocking in and can be toggled from the dashboard

  • Duty status and session data are logged to the database and sent to your Discord webhook

  • Admins with the correct ace permission can access Officer Management to issue suspensions and view kick history


6. Troubleshooting

circle-info

Database isn't recording duty logs Ensure your database connection details in server.cfg are correct and that oxmysql is installed and ensured before GuardianDutyMenu in your server.cfg.

circle-info

Discord logging isn't working Double-check that Config.Webhook in config.lua contains a valid Discord webhook URL. Test the webhook manually via a tool like Postman or Insomnia.

circle-info

Players can't see certain departments Each department requires a matching ace permission. Make sure the player's group has the correct ace assigned — e.g. add_ace group.officer dhs.duty allow.

circle-info

Body cam not showing on clock-in The bodycam activates by default on every fresh clock-in. If it was manually toggled off during a previous session it will remain off until the next clock-out. Clocking out and back in will always restore it.

Last updated