CodeRender
  • Welcome To Code Render
  • Scripts
    • CR-DispatchMDT
      • Script Configuration
      • UI Configuration
      • Events and Custom Features
    • CR-Loading Screen Configuration
    • CR-CaravanJob
Powered by GitBook
On this page
  • Framework
  • Main
  • Team Assignment
  • Dispatch
  • Discord Webhook
  • Bridge Event
  • Best Practices
  1. Scripts
  2. CR-DispatchMDT

Script Configuration

CR-DispatchMDT

The config.json file governs the server-side and client-side logic for the CR-DispatchMDT script, tailored for FiveM servers. This guide provides a clear and detailed breakdown of each configuration section, helping you customize the dispatch and MDT system effectively.


Framework

Setting

Value

Description

Framework

esx | qbcore | qbox

Specifies compatibility framework .

Note: Ensure your server uses the ESX or QB-CORE or QBOX framework to avoid compatibility issues.


Main

Core settings for MDT access, commands, and radio communication.

Setting

Value

Description

locals

en

Sets the translation locale (e.g., en for English). Add custom translations in the locals folder.

Mdt_Open_With_Command

true

If true, allows opening the MDT with a command.

RegisterCommand

crps

Slash command to access the MDT (e.g., /crps).

checkMDTItem

true

If true, requires an MDT item in the player’s inventory to open the MDT.

item.name

mdt

Inventory item name for MDT access. Must match your server’s inventory system.

item.label

mdt

Display label for the MDT item.

JobName

["police"]

Jobs authorized to use the MDT and dispatch system (e.g., police).

MainRadioChannel

1

Default radio channel for whitelisted jobs.

ResetCommand

resetPS

Command to reset the MDT system (e.g., /resetPS) in case of client errors.

Tip: Verify item.name and item.label match your inventory system to ensure smooth MDT access.


Team Assignment

Configures radio channel behavior for team assignments.

Setting

Value

Description

FallBackChannel

0

Radio channel players revert to after team assignment ends (0 disconnects them). Typically set to MainRadioChannel.


Dispatch

Manages incident handling, including panic buttons, blips, weapons, locations, and speed traps.

Panic Button

Setting

Value

Description

PanicCoolDown

0.2

Cooldown (in minutes) for the panic button after it’s triggered (e.g., 0.2 = 12 seconds).

Blip

Controls map blips for dispatch incidents.

Setting

Value

Description

InGameMapBlip

false

If true, shows blips on the in-game map when MDT is active. Note: Adds ~0.2ms to client-side performance.

BlipSprite

1

Sprite ID for blips (refer to FiveM documentation for options).

BlipColor

1

Color ID for blips (refer to FiveM documentation for options).

Warning: Enable InGameMapBlip cautiously on high-population servers due to performance impact.

Weapon Restrictions

Configures weapon-related dispatch alerts.

Setting

Value

Description

ignoreShootingForWhitelistedJobs

false

If true, WhitelistedJob roles (e.g., police) do not trigger shooting alerts.

WhitelistedJob

["police"]

Jobs exempt from shooting and speed trap alerts.

Whitelisted Weapons

Weapons that do not trigger dispatch alerts:

Weapon ID

Name

WEAPON_FLARE

Flare

WEAPON_FLAREGUN

Flaregun

WEAPON_FIREEXTINGUISHER

Fire Extinguisher

WEAPON_PETROLCAN

Petrol Can

WEAPON_STUNGUN

Stun Gun

Blacklisted Weapons

Weapons that trigger dispatch alerts:

Weapon ID

Name

WEAPON_ASSAULTRIFLE

AK-47

WEAPON_BULLPUPRIFLE

Bullpup Rifle

WEAPON_COMBATPISTOL

Combat Pistol

WEAPON_CARBINERIFLE

Carbine Rifle

WEAPON_CARBINERIFLE_MK2

Carbine Rifle MK2

WEAPON_HEAVYPISTOL

Heavy Pistol

WEAPON_MICROSMG

Mini Uzi

WEAPON_MUSKET

Musket Rifle

WEAPON_PISTOL

Pistol

WEAPON_PISTOL_MK2

Pistol MK2

WEAPON_PISTOL50

50cal Pistol

WEAPON_PUMPSHOTGUN

Pump Shotgun

WEAPON_REVOLVER

Revolver

WEAPON_SNSPISTOL

SNS Pistol

WEAPON_SMG

SMG

WEAPON_SPECIALCARBINE

Special Carbine

WEAPON_SAWNOFFSHOTGUN

Sawnoff Shotgun

Note: The WEAPON_FLARE appears in both lists in the provided config, which may be an error. Verify and correct to avoid conflicting behavior.

Locations

Defines key areas for dispatch activities.

Location

Coordinates (x, y, z)

Radius (meters)

Description

Main Garage

219.97, -804.38, 30.72

50.0

Vehicle storage and spawning area.

Hospital

285.32, -581.28, 43.38

50.0

Medical treatment location.

Police Station

428.01, -980.9, 30.71

50.0

Base for police operations.

Speed Trap

Configures automated speed enforcement zones.

Setting

Value

Description

ENABLE

true

Enables speed trap alerts for vehicles.

Type

info

Alert type (success, warning, info, error).

ignoreSpeedTrapForWhitelistedJobs

false

If true, WhitelistedJob roles are exempt from speed trap alerts.

Interval

10

Time (in seconds) between speed checks. Note: Keep at 10+ to avoid excessive notifications.

FineEnabled

false

If true, applies fines for speeding (currently disabled, pending future update).

WhitelistedJob

["police"]

Jobs exempt from speed traps if ignoreSpeedTrapForWhitelistedJobs is true.

Speed Trap Locations

Location

Coordinates (x, y, z)

Radius (meters)

Speed Limit (km/h)

Hospital Road

264.71, -578.21, 42.9

60.0

80

Police Station Road

399.13, -988.57, 29.01

60.0

80

Main Garage Road

222.56, -838.76, 29.95

100.0

40

Warning: Reducing Interval below 10 seconds may overwhelm players with notifications and increase client-side load.


Discord Webhook

Configures Discord integration for incident logging.

Setting

Value

Description

webhookURL

https://discord.com/api/webhooks/...

URL for sending incident notifications to Discord.

iconURL

https://cdn.discordapp.com/...

Embed icon URL for Discord notifications.

color

#FF0033

Embed color (red) for Discord notifications.

Tip: Keep webhookURL secure and avoid sharing it publicly to prevent misuse.


Bridge Event

Configures framework-specific event triggers for ESX, QBox, and QBCore. Do not modify unless instructed by the developer.

Client Events

Framework

Settings

esx

{}

qbox

{}

qbcore

{}

Expect this on future updates.

Server Events

Framework

Event

Trigger

ESX

PlayerLoaded

esx:playerLoaded

PlayerUnloaded

esx_multicharacter:relog

JobUpdate

esx:setJob

DutyUpdate

``

QBox

PlayerLoaded

QBCore:Server:OnPlayerLoaded

PlayerUnloaded

QBCore:Server:OnPlayerUnload

JobUpdate

QBCore:Server:OnJobUpdate

DutyUpdate

QBCore:Server:SetDuty

QBCore

PlayerLoaded

QBCore:Server:OnPlayerLoaded

PlayerUnloaded

QBCore:Server:OnPlayerUnload

JobUpdate

QBCore:Server:OnJobUpdate

DutyUpdate

QBCore:ToggleDuty


Best Practices

  • Performance: Disable InGameMapBlip on high-population servers to reduce client-side load (~0.2ms per player).

  • Speed Traps: Maintain Interval at 10 seconds or higher to prevent notification spam and optimize performance.

  • Localization: Create translation files in the locals folder for additional languages and update locals accordingly.

  • Security: Store webhookURL securely and avoid exposing it in public repositories or client-side code.

  • Inventory: Ensure item.name and item.label align with your server’s inventory system if checkMDTItem is enabled and useable item.

  • Testing: Test panic button cooldowns (PanicCoolDown) and speed trap locations in a staging environment to balance gameplay.

PreviousCR-DispatchMDTNextUI Configuration

Last updated 1 month ago

Warning: Modifying BridgeEvent settings may break framework compatibility. Contact the developer via for guidance.

Support: For customization or troubleshooting, join our or refer to the script’s documentation.

Discord
Discord community