Events and Custom Features
The CR-DispatchMDT script includes custom features and events to enhance your server police related script . MDT and dispatch system. CR-MDT Notify, location name retrieval, and dispatch alerts with simple examples. Each feature specifies client-side or server-side usage for easy integration.
Custom Pause Menu Integration
Syncs the MDT with your server’s custom pause menu.
Client Side: Trigger the
sriyo-policeMDT:trackPauseMenu
event:true
: Pause menu opens.false
: Pause menu closes.
Example
Notes
Ensure your pause menu script triggers these events correctly.
Test in a staging environment to avoid MDT UI conflicts.
CR-MDT Notify System
Displays customizable notifications for alerts or messages using Font Awesome icons.
Client Side: Use the export or trigger the
sriyo-policeMDT:cr-MDTNotify
event.Server Side: Trigger the event to notify all or specific players.
Options
title
: Notification title (e.g.,Robbery Alert
).description
: Message (e.g.,Store robbery in progress!
).type
:success
,error
,info
, orwarning
.duration
: Display time in milliseconds (e.g.,3000
).card
:short
orlong
.position
:tl
(top-left),tc
(top-center),tr
(top-right).progressable
:true
orfalse
(shows progress bar).
Examples
Client Side: Using Export
Client Side: Using Event
Server Side: Notify All
Server Side: Specific Player
Notes
Keep
description
short (<100 characters).Avoid
duration
>10000ms to prevent overlap.Test
position
andcard
for UI compatibility.
Location Name Retrieval
Gets the GTA V or custom location name (from Dispatch.Locations
in config.json
) based on player coordinates.
Client Side: Call the
CR_LocationName
export.
Example
Notes
Returns custom names (e.g.,
Main Garage
) if within a configured radius.Falls back to GTA V location if no custom match.
Ensure
Dispatch.Locations
has correct coordinates .
Dispatch Alert Event
Triggers server-side dispatch alerts (e.g., robberies) with player coordinates and messages.
Client Side: Send alert to server via
sriyo-policeMDT:cr-DispatchAlert
.Server Side: Processes and forwards alerts to MDT.
Options
Message
: Alert message (e.g.,Store robbery has been triggered
).Title
: Alert title (e.g.,Store Robbery
).Type
:success
,error
,info
, orwarning
.Response.x
,Response.y
,Response.z
: Player coordinates.
Example
Notes
Use for incidents like robberies or emergencies.
Server notifies whitelisted jobs (e.g.,
police
) perconfig.json
.Ensure accurate coordinates for blips or location data.
Best Practices
Test: Try features in a staging environment.
Performance: Use reasonable
duration
in notifications and avoid frequent alerts.Icons: Stick to free Font Awesome icons.
Locations: Update
Dispatch.Locations
for new areas.Backup: Save
config.json
before changes.
Last updated