🔃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.
]]
-- Example usage:
exports['pp-mdt']:AddDispatchCall({
title = 'Test',
description = 'Test',
showCitizen = 'name',
coords = vec3(-1543.69, -1198.46, 1.22),
duration = 5 * 60000,
blip = {
color = 1,
sprite = 1,
scale = 0.8,
},
code = {
code = 'TEST',
color = 'red'
},
flash = true,
}, source)
title
string
The title of the dispatch call that will be visible in the MDT.
description
string
The description of the dispatch call providing detailed information about the incident.
showCitizen
string
Specifies what citizen information to display: "name"
for full name or "gender"
for gender.
blip
table
Contains map location data for the dispatch call. It includes the following sub-fields:
duration
number
Time (in milliseconds) after the dispatch notification will be deleted. If an officer is still responding to the call after this time, it will be deleted after the last officer has stopped responding.
blip.coords
vec3
Coordinates for the exact location on the map. Defaults to the player's current location if not provided.
blip.radius
number
The radius around the coords
where the blip will appear. If provided, the blip will appear randomly within this radius.
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
blip.scale
number
The scale of the blip, determining its size on the map.
code
table
The dispatch code and the color it will be displayed in. It includes the following sub-fields:
code.code
string
The dispatch code, such as "10-91"
. This is typically a standard code used in the dispatch system.
code.color
string
The color associated with the dispatch code. This can be any valid color string (e.g., "pink"
, "red"
).
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
flash
boolean
Determines if the notification should flash on the screen.
weapon
string
Information about any weapon involved in the dispatch call.
AddDashcam
local success = exports['pp-mdt']:AddDashcam(vehicle)
--[[
Function: AddDashcam
Parameters:
vehicle (entity): The vehicle entity to which the dashcam is added.
Return:
success (boolean): Returns `true` if the dashcam was successfully added and `false` if the addition failed.
]]
Last updated
Was this helpful?