Guardian Duty Menu

The Guardian Duty System is a comprehensive duty tracking solution for FiveM servers, designed to store and manage duty logs in a database. This system enables players to toggle their On Duty and Off Duty status using the /duty command while maintaining a secure and structured record of duty activity. Each duty session is logged with player details, including name, callsign, department, and time spent on duty, ensuring accurate tracking of service hours. The system integrates permissions to restrict duty access to authorized roles (e.g., DHS, FBI, EMS) and provides real-time notifications using ox_lib. Additionally, all duty changes are automatically logged to Discord via webhooks, enhancing transparency and accountability across departments.


Features:

  • Database Integration – Stores duty logs in a structured database for better data management and retrieval.

  • On Duty & Off Duty Tracking – Players can toggle their duty status using the /duty command.

  • Time Logging – Automatically records the total time spent on duty for each session.

  • Department Permissions – Restricts duty access based on predefined department roles (e.g., DHS, FBI, EMS).

  • Real-Time Notifications – Uses ox_lib to notify players when they go on or off duty.

  • Blip Management – Adds or removes a blip on the map when a player changes duty status.

  • Discord Logging – Sends detailed duty logs to a Discord webhook for better accountability.


Preview:

In game Duty Menu
Body Cam
Discord Logs when going on duty and off duty
Userhours Discord bot Command
Active Department Command when nobodys on duty
Active Department Command when somebody is on duty

# Config.lua

Config = {}

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

--Discord Ace Permissions
Config.AllowedRoles = {
    'dhs',
    'cia',
    'fbi',
}

-- Department selects (This is where you add more departments to the menu)
Config.Departments = {
    {value = "DHS", label = "Department of Homeland Security"},
    {value = "FBI", label = "Federal Bureau of Investigation"},
    {value = "EMS", label = "Emergency Medical Services"}
}

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",
}

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

Last updated