LuaBeans Duty

LuaBeans Duty provides the in-game menu interface for the duty system, allowing players to access vehicles, uniforms, loadouts, and locations while on duty.

Overview

LuaBeans Duty is the UI layer that works alongside LuaBeans Bridge to provide a complete duty system experience. It includes:

  • Duty menu for selecting departments and going on/off duty

  • Vehicle spawning menu

  • Uniform selection menu

  • Loadout selection menu

  • Location markers and waypoints

Installation

Prerequisites

LuaBeans Duty requires LuaBeans Bridge to be installed and running first.

Step 1: Copy Resource

Copy the luabeans_duty resource folder into your FiveM server's resources directory:

cp -r /path/to/luabeans_duty fivem-server/resources/

Step 2: Configure Server

Add to your server.cfg (after luabeans):

Important: luabeans_duty must be started after luabeans.

Step 3: Verify Installation

  1. Ensure both resources start without errors

  2. Join server and test /duty command

  3. Verify menu appears when using commands

Commands

/duty

Open duty selection menu and go on duty.

Usage: /duty

Behavior:

  1. Shows menu with available departments

  2. Player selects department

  3. Confirmation prompt appears

  4. Player goes on duty after confirmation

/dutyrefresh

Refresh player profile data from web panel.

Usage: /dutyrefresh

Behavior:

  • Fetches latest departments and ranks

  • Updates permissions cache

  • Refreshes duty options

/duty_menu

Open the duty management menu.

Usage: /duty_menu

Behavior:

  • Opens menu with options:

    • Vehicles

    • Uniforms

    • Loadouts

    • Locations

    • Go Off Duty

Events

Client Events

luabeans_duty:client:duty_menu

Open the duty menu programmatically.

luabeans_duty:client:duty

Open duty selection menu programmatically.

Server Events

You can listen to duty events from LuaBeans Bridge (see Bridge documentation).

LuaBeans Duty uses a custom menu system built with FiveM's native UI. The menus are:

Duty Selection Menu

Displays when using /duty command:

  • Lists available departments

  • Shows department names and icons

  • Allows department selection

  • Shows confirmation before going on duty

Main Duty Menu

Accessible via /duty_menu command:

  • Vehicles - Spawn department vehicles

  • Uniforms - Change into department uniforms

  • Loadouts - Get department loadouts

  • Locations - View department locations

  • Go Off Duty - End duty session

Vehicle Menu

Lists available vehicles for the player's rank:

  • Vehicle categories (if configured)

  • Vehicle names and spawn codes

  • Rank requirements

  • Spawn location

Uniform Menu

Lists available uniforms for the player:

  • Gender-specific options (male/female/both)

  • Uniform categories

  • Rank requirements

  • Preview information

Loadout Menu

Lists available loadouts:

  • Weapons and items

  • Rank requirements

  • Loadout categories

  • Equipment details

Locations Menu

Shows department locations:

  • Location types (duty, garage, armory, locker)

  • Coordinates

  • Set waypoints

  • Location markers

Configuration

Edit config.lua to customize behavior:

ACE Permissions on Duty

Grant ACE permissions automatically when players go on duty:

You can customize menu appearance and behavior in config.lua:

Integration with Custom Menu Systems

If you use a custom menu system (like qb-menu or ox_lib), you can replace the default menu system:

Using ox_lib

Replace client/menu.lua with your custom implementation:

Duty Confirmation

When a player selects a department to go on duty, a confirmation prompt appears:

This prevents accidental duty toggling.

Troubleshooting

Issue: /duty_menu doesn't show menu

Solutions:

  1. Verify player is on duty (use /duty first)

  2. Check LuaBeans Bridge is running

  3. Verify player has department assigned

  4. Check console for errors

No Vehicles/Uniforms Showing

Issue: Menu is empty or missing options

Solutions:

  1. Verify items are configured in web panel

  2. Check player's rank meets requirements

  3. Verify department has vehicles/uniforms configured

  4. Refresh player data: /dutyrefresh

Commands Not Working

Issue: Commands don't respond

Solutions:

  1. Verify resource is started: ensure luabeans_duty

  2. Check command registration in console

  3. Verify player has access

  4. Check resource dependencies (LuaBeans Bridge)

Permission Errors

Issue: Player can't access certain options

Solutions:

  1. Check rank permissions in web panel

  2. Verify player's rank meets requirements

  3. Check department assignment

  4. Refresh player data

Issue: Menu conflicts with other resources

Solutions:

  1. Adjust menu positioning in config.lua

  2. Change keybinds if conflicts exist

  3. Customize menu implementation

  4. Coordinate with other menu resources

Features by Department Type

LEO Departments

  • Full vehicle spawning

  • Uniform management

  • Loadout system

  • Location markers

  • Rank-based access

Staff Departments

  • Basic vehicle access

  • Uniform selection

  • Location markers

  • Simplified loadouts

Business Departments

  • Vehicle access (business vehicles)

  • Uniform options (if configured)

  • Location markers

  • Custom permissions

Advanced Configuration

Custom Vehicle Spawning

Override default vehicle spawning behavior:

Custom Uniform Application

Override uniform application:

Custom Loadout Application

Override loadout application:

Performance Considerations

  • Menus are client-side only

  • Minimal server impact

  • Data is cached by LuaBeans Bridge

  • Efficient native menu rendering

Requirements

  • LuaBeans Bridge - Required dependency

  • Discord Identifiers - Required for all players

  • FiveM Server - Latest recommended build

Support

For issues with LuaBeans Duty:

Last updated