Skip to content

JericoFX/jk-beeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Not tested on a real server (is like "it worked on my machine")

JK-Beeper - FiveM Police Dispatch System

JK-Beeper

A comprehensive police beeper/dispatch system for FiveM servers using QBCore framework. This resource provides a realistic police communication system with a modern NUI interface and authentic beeper aesthetics.

Features

  • Modern NUI Interface: Clean, responsive design with authentic police beeper aesthetics
  • Real-time Messaging: Instant message distribution to authorized personnel
  • Job-based Authorization: Configurable job restrictions with callsign validation
  • Message Management: Mark as read, assign/release dispatches, delete messages individually
  • Coordinate Integration: Set waypoints from dispatch messages
  • Emergency Codes: Predefined emergency codes for different job types
  • Priority System: Low, normal, high, and emergency priority levels
  • Sound Notifications: Audio alerts for new messages
  • Message History: Persistent message storage with automatic cleanup
  • Admin Commands: Administrative tools for testing and management
  • Debug Mode: Optional debug logging for troubleshooting

Dependencies

  • QBCore Framework: Core framework for player and job management
  • ox_lib: For callbacks, notifications, and input dialogs
  • ox_inventory: For item management (beeper item)

Installation

  1. Download and extract the resource to your resources folder
  2. Add ensure jk-beeper to your server.cfg
  3. Add the beeper item to your inventory system:
-- Add to qb-core/shared/items.lua or your items configuration
['beeper'] = {
    ['name'] = 'beeper',
    ['label'] = 'Police Beeper',
    ['weight'] = 200,
    ['type'] = 'item',
    ['image'] = 'beeper.png',
    ['unique'] = false,
    ['useable'] = true,
    ['shouldClose'] = false,
    ['combinable'] = nil,
    ['description'] = 'Emergency services communication device'
}
  1. Restart your server

Configuration

Server Configuration (server/init.lua)

local Config = {
    Debug = false,                    -- Enable/disable debug logging
    BeeperItem = 'beeper',           -- Item name for beeper
    MaxMessages = 50,                -- Maximum messages in history
    MessageRetentionTime = 3600000,  -- Message retention time in milliseconds (1 hour)
    AllowedJobs = {
        police = {
            name = 'police',
            grades = { 0, 1, 2, 3, 4, 5 },  -- Allowed job grades
            codes = {
                ['10-0'] = 'Officer Down',
                ['10-4'] = 'Acknowledged',
                ['10-8'] = 'In Service',
                ['10-7'] = 'Out of Service',
                ['10-20'] = 'Location',
                ['10-54'] = 'Possible Dead Body',
                ['10-80'] = 'Pursuit in Progress',
                ['Code 1'] = 'Respond when convenient',
                ['Code 2'] = 'Urgent response',
                ['Code 3'] = 'Emergency response'
            }
        },
        ambulance = {
            name = 'ambulance',
            grades = { 0, 1, 2, 3, 4, 5 },
            codes = {
                ['10-52'] = 'Medical Emergency',
                ['10-54'] = 'Possible Dead Body',
                ['Code Blue'] = 'Cardiac Arrest',
                ['Code Red'] = 'Fire/Explosion',
                ['DOA'] = 'Dead on Arrival',
                ['ETA'] = 'Estimated Time of Arrival'
            }
        },
        sheriff = {
            name = 'sheriff',
            grades = { 0, 1, 2, 3, 4, 5 },
            codes = {
                ['10-0'] = 'Officer Down',
                ['10-4'] = 'Acknowledged',
                ['10-8'] = 'In Service',
                ['10-7'] = 'Out of Service',
                ['10-20'] = 'Location',
                ['10-54'] = 'Possible Dead Body',
                ['10-80'] = 'Pursuit in Progress'
            }
        },
        state = {
            name = 'state',
            grades = { 0, 1, 2, 3, 4, 5 },
            codes = {
                ['10-0'] = 'Officer Down',
                ['10-4'] = 'Acknowledged',
                ['10-8'] = 'In Service',
                ['10-7'] = 'Out of Service',
                ['10-20'] = 'Location'
            }
        }
    }
}

Client Configuration (client/init.lua)

local Config = {
    UseItem = false,              -- Enable item usage requirement
    BeeperItem = 'beeper',       -- Item name for beeper
    BeeperKey = 'F6',            -- Default keybind to toggle beeper
    MaxDistance = 100.0,         -- Maximum distance for certain features
    SoundFile = 'beeper_sound',  -- Sound file name
    SoundVolume = 0.5            -- Sound volume (0.0 - 1.0)
}

Keybinds

Default keybinds (configurable in-game via F1 > Settings > Keybinds):

  • F6: Toggle beeper interface
  • F7: Open emergency report menu
  • F8: Refresh messages

Usage

For Players

  1. Obtain a Beeper: Get a beeper item from inventory or admin
  2. Use the Item: Use the beeper item to activate the system (if UseItem is enabled)
  3. Toggle Interface: Press F6 to open/close the beeper interface
  4. Send Reports: Press F7 to open the emergency report menu
  5. Navigate Messages: Use the beeper buttons to navigate through messages
  6. Manage Dispatches:
    • Green button: Take/read dispatch
    • Red button: Delete message (individual) or release if assigned
    • Arrow buttons: Navigate between messages

For Administrators

Commands

  • /beepertest - Send a test message to all active beepers
  • /beepersend [title] [message] - Send a custom message

Permissions

Commands require appropriate ACE permissions:

  • command.beepertest
  • command.beepersend

Message System

Message Types

  • emergency: High-priority emergency calls
  • backup: Backup requests
  • medical: Medical emergencies
  • narcotics: Drug-related incidents
  • patrol: Routine patrol messages
  • administrative: Administrative messages
  • info: General information

Priority Levels

  • low: Non-urgent messages
  • normal: Standard priority
  • high: High priority
  • emergency: Emergency priority

Message Cleanup

  • Automatic Cleanup: Messages older than MessageRetentionTime are automatically deleted every 5 minutes
  • Individual Deletion: Players can delete messages individually (only affects their view)
  • Message Limit: Only the latest MaxMessages are kept in memory

Callsign System

The system includes callsign validation for certain jobs (police, sheriff, state). Players must have a valid callsign in their metadata to use the beeper system.

Setting Callsigns

Callsigns should be set in player metadata:

-- Example: Setting callsign via another resource
local Player = QBCore.Functions.GetPlayer(source)
Player.Functions.SetMetaData('callsign', 'ADAM-12')

API

Exports

-- Client-side exports
exports['jk-beeper']:toggleBeeper()
exports['jk-beeper']:activateBeeper()
exports['jk-beeper']:deactivateBeeper()
exports['jk-beeper']:isActive()
exports['jk-beeper']:hasItem()
exports['jk-beeper']:openReportMenu()

Events

Client Events

  • jk-beeper:receiveMessage - Receive a new message
  • jk-beeper:syncMessages - Sync message list
  • jk-beeper:messageAssigned - Message assigned to unit
  • jk-beeper:messageReleased - Message released by unit
  • jk-beeper:messageDeleted - Message deleted (individual)
  • jk-beeper:setWaypoint - Set waypoint from coordinates

Server Events

  • jk-beeper:markAsRead - Mark message as read
  • jk-beeper:assignMessage - Assign message to unit
  • jk-beeper:releaseMessage - Release message from unit
  • jk-beeper:deleteMessage - Delete message (individual)
  • jk-beeper:deactivateBeeper - Deactivate beeper

Callbacks

Server Callbacks

  • jk-beeper:sendMessage - Send a new message
  • jk-beeper:requestMessages - Request message list
  • jk-beeper:activateBeeper - Activate beeper system
  • jk-beeper:markCoordinates - Get coordinates from message
  • jk-beeper:hasItem - Check if player has beeper item
  • jk-beeper:checkJobAuthorization - Check job authorization
  • jk-beeper:getJobCodes - Get job-specific codes
  • jk-beeper:getCallsignInfo - Get callsign information

Troubleshooting

Common Issues

  1. Beeper not activating: Check job authorization and callsign validity
  2. No messages received: Verify job configuration and beeper activation
  3. Keybinds not working: Check ox_lib installation and keybind settings
  4. NUI not opening: Check for JavaScript errors in F8 console
  5. Messages not syncing: Enable debug mode to check server logs

Debug Mode

Enable debug logging in server configuration:

Config.Debug = true

Support

For support and updates, please visit our GitHub repository or contact the development team.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

GPL3 License Summary

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Author

JericoFX - Original Developer

Credits

  • Built for QBCore Framework
  • Uses ox_lib for enhanced functionality
  • Inspired by real police communication systems

About

Fivem Beeper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published