# Guardian Duty Menu v1

### ✨ Features

Guardian Duty is a high-performance, standalone management suite designed for professional roleplay communities.

* Dynamic Duty Selection: A clean UI using `ox_lib` allows players to select their authorized department and input their name/callsign.
* ACE Integration: Automates permission handling by adding players to a specific principal group (e.g., `group.officer_duty`) only while they are clocked in.
* Live Officer Blips: Real-time GPS synchronization that shows officers to each other on the map, including heading and cone-of-sight.
* Automated Time Tracking: Precisely logs every second spent on duty and stores it in a MySQL database.
* Discord Synchronization:
  * Live Logs: Beautifully formatted embeds for clock-ins and clock-outs.
  * Slash Commands: Check user hours, view department leaderboards, and see who is active in voice channels directly from Discord.
* Bodycam Overlay: Integrated NUI bodycam that displays officer name, callsign, and a live timestamp when duty is active.
* Data Persistence: Uses KVPs to remember a player's last used name and callsign for faster clock-ins.

```lua
Config = {}

-- Discord Webhook for duty logs
Config.Webhook = ''

-- Department selects
Config.Departments = {
    { value = "DHS", label = "U.S. DHS" },
    { value = "FBI", label = "Federal Bureau of Investigation" },
    { value = "EMS", label = "Emergency Medical Services" },
    { value = "CIA", label = "Central Intelligence Agency" }
}

-- Department-specific ACE permissions
Config.DepartmentPermissions = {
    DHS = "duty.dhs",
    FBI = "duty.fbi",
    EMS = "duty.ems",
    CIA = "duty.cia"
}

-- Ace Permission Settings
Config.EnableAcePermissions = true
Config.OnDutyGroupName = "officer_duty"
-- While on duty, the player is added to 'group.officer_duty'
-- add_ace resource.GuardianDuty command.add_principal allow
-- add_ace resource.GuardianDuty command.remove_principal allow

-- Department-specific logos (for Discord embeds, bodycam overlays, etc.)
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",
    ["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"
}

-- Bodycam display settings
Config.BodycamSettings = {
    enabled = true,
    showLogo = true,
    showTimestamp = true,
    overlayOpacity = 30,
    recordingDotBlink = true
}

-- Enable or disable blips globally
Config.EnableBlips = true

Config.ResetHoursAfterDays = 7
-- For a 7-day reset, use: Config.ResetHoursAfterDays = 7
-- For a 14-day reset, use: Config.ResetHoursAfterDays = 14
-- To disable, use: Config.ResetHoursAfterDays = nil

-- Blip styles for each department
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 }
}
```


---

# Agent Instructions: 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:

```
GET https://guardiandevlabs.gitbook.io/guardiandevlabs/paid-scripts/guardian-duty-menu-v1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
