🔃Server

takeMugshot

exports['pp-mdt']:takeMugshot(source)

--[[
    it will trigger mugshot cutscene, take photo and update it in database
]]

isWanted

local isWanted, info = exports['pp-mdt']:isWanted(type, identifier)

--[[
    Checks if a citizen, vehicle, weapon, case, or evidence is wanted.

    Parameters:
    - type (string): "citizen", "vehicle", "weapon", "case", or "evidence".
    - identifier (string): The unique identifier to check (user identifier, plate, weapon serialnumber, case id, evidence id).

    Returns:
    - (boolean, string/number): True and ID if wanted, false and "not-found" if not, "invalid-type" for a wrong type.
]]

getUserPatrol

local patrol = exports['pp-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-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

blip

table

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

No

blip.coords

vec3

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

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

weapon

string

Information about any weapon involved in the dispatch call.

No

Last updated