> For the complete documentation index, see [llms.txt](https://guardiandevlabs.gitbook.io/guardiandevlabs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guardiandevlabs.gitbook.io/guardiandevlabs/paid-scripts/guardian-duty-menu-v2.md).

# Guardian Duty Menu v2

## 👮 Guardian Duty System v2

**Guardian Duty System v2** is a comprehensive duty tracking solution for FiveM servers — built around a fully custom, self-contained UI with no framework dependencies. It gives departments a structured, professional way to manage on-duty personnel, track service hours, and maintain accountability across your entire server.

Players toggle their duty status via the `/duty` command, which opens a sleek tablet interface where they authenticate with their name, callsign, and department before going on shift. Every session is recorded in full — player details, department, time on duty — and changes are pushed to Discord automatically via webhooks.

***

### ✨ Features

**Database Integration**\
Duty sessions, hours, suspensions, and kick history are all stored in a structured MySQL/MariaDB database for reliable data management and retrieval.<br>

**On Duty & Off Duty Tracking**\
Players authenticate and clock in via the `/duty` command. Sessions are tracked in real time with live duty duration displayed directly on the tablet.<br>

**Duty Hours Logging**\
Total time on duty is automatically recorded per player, per department. Officers and admins can view current and archived hour records directly from the tablet.<br>

**Department Permissions**\
Restrict access to specific departments using FiveM ace permissions. Only authorized roles will see and be able to select their assigned department.<br>

**Body-Worn Camera Overlay**\
A live bodycam overlay displays officer name, callsign, department, and timestamp. Toggleable from the dashboard — state persists across tablet opens until the next clock-out. <br>

**Officer Management**\
Admins can issue suspensions, view kick history, end active suspensions, and delete records — all from within the tablet interface.<br>

**Active Roster**\
A real-time view of all personnel currently on duty, including name, callsign, and department. Admin actions (kick, suspend) are accessible directly from the roster. <br>

**Discord Logging**\
All duty changes are automatically sent to a configured Discord webhook, keeping departments informed and accountable without any manual effort.<br>

**Customisable UI Colors**\
Officers can personalise their tablet's accent, background, and text colors from the settings page. Changes save locally and persist between sessions.

***

**Preview:**<br>

***

```lua
Config = {}

Config.Webhook = ''

Config.Departments = {
    { value = "DHS", label = "U.S. DHS" },
    { value = "FBI", label = "Federal Bureau of Investigation" },
    { value = "BCSO", label = "Blaine County Sheriff's Office" },
    { value = "EMS", label = "Emergency Medical Services" },
    { value = "CIA", label = "Central Intelligence Agency" }
}

Config.DepartmentPermissions = {
    DHS = "duty.dhs",
    BCSO = "duty.bcso",
    FBI = "duty.fbi",
    EMS = "duty.ems",
    CIA = "duty.cia"
}

Config.EnableAcePermissions = true
Config.OnDutyGroupName = "officer_duty"

Config.TimeOffDuty = "30s" -- Options: "30s", "1m", "5m", "1h", etc.
Config.AdminPermission = "guardian.admin"

Config.Notification = "3" -- 1 = okokNotify, 2 = CodemNotification, 3 = GuardianNotification, 4 = ox_lib

-- Options: "top-right", "top-left", "center-right", "center-left", "bottom-right", "bottom-left"
Config.NotificationLocation = "center-right"

Config.DepartmentLogos = {
    ["DHS"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Seal_of_the_United_States_Department_of_Homeland_Security.svg/1200px-Seal_of_the_United_States_Department_of_Homeland_Security.svg.png",
    ["CIA"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/2/25/Seal_of_the_Central_Intelligence_Agency.svg/800px-Seal_of_the_Central_Intelligence_Agency.svg.png",
    ["FBI"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Seal_of_the_Federal_Bureau_of_Investigation.svg/1200px-Seal_of_the_Federal_Bureau_of_Investigation.svg.png",
    ["BCSO"] = "https://wiki.21jumpclick.fr/images/2/28/Logo_BCSO.png",
    ["EMS"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Star_of_life2.svg/1200px-Star_of_life2.svg.png",
    ["default"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Emblem-person-red.svg/1024px-Emblem-person-red.svg.png"
}

Config.BodycamSettings = {
    enabled = true,
    showLogo = true,
    showTimestamp = true,
    overlayOpacity = 30,
    recordingDotBlink = true
}

Config.EnableBlips = true

Config.ResetHoursAfterDays = 7

Config.DepartmentBlips = {
    ["DHS"] = { sprite = 1, color = 60 },
    ["FBI"] = { sprite = 1, color = 29 },
    ["EMS"] = { sprite = 1, color = 3 },
    ["CIA"] = { sprite = 1, color = 26 },
    ["default"] = { sprite = 1, color = 2 }
}
```

{% hint style="success" %}
\[Paid] [Duty Menu](https://guardianlabs.tebex.io/package/guardiandutymenu)
{% endhint %}
