🔃Server

getUserPatrol

local patrol = exports['pp-ems-mdt']:getUserPatrol(identifier)

--[[
    It will return the patrol object if the user is currently assigned to a patrol.

    Parameters:
    - identifier (string): The unique identifier of the user to check.

    Returns:
    - (table or nil): The patrol object if the user is in a patrol, or nil if they are not.
]]

AddDispatchCall

exports['pp-ems-mdt']:AddDispatchCall(data, source)

--[[
    Function: AddDispatchCall

    Adds a new dispatch call to the MDT system. This function handles the creation of a dispatch entry,
    including the caller's information, coordinates, and other relevant details. The dispatch call is then
    broadcasted to all clients.

    Parameters:
    - data (table): A table containing the dispatch call details such as title, description, blip information, and citizen data.
    - source (number): The player's server ID who initiated the dispatch call.
]]

Field Name

Data Type

Description

Required

title

string

The title of the dispatch call that will be visible in the MDT.

Yes

description

string

The description of the dispatch call providing detailed information about the incident.

Yes

showCitizen

string

Specifies what citizen information to display: "name" for full name or "gender" for gender.

Yes

coords

vec3

Coordinates for the exact location on the map. Defaults to the player's current location if not provided.

No

blip

table

Contains map location data for the dispatch call. It includes the following sub-fields:

No

blip.radius

number

The radius around the coords where the blip will appear. If provided, the blip will appear randomly within this radius.

No

blip.color

number

The color of the blip on the map. FiveM Blip Colors Reference

No

blip.sprite

number

The sprite or icon used for the blip on the map, represented by a numeric value. This defines how the blip appears visually on the map. FiveM Blip Sprites Reference

No

blip.scale

number

The scale of the blip, determining its size on the map.

No

code

table

The dispatch code and the color it will be displayed in. It includes the following sub-fields:

No

code.code

string

The dispatch code, such as "10-91". This is typically a standard code used in the dispatch system.

No

code.color

string

The color associated with the dispatch code. This can be any valid color string (e.g., "pink", "red").

No

sound

string

The sound that plays when the dispatch call is received. If not provided, the default is "default". You can add sounds by adding .mp3 file into pp-mdt/web/build/public/sounds

No

flash

boolean

Determines if the notification should flash on the screen.

No

Last updated