Exports
Series of exports that are documented and available for wasabi_mdt. These are good for implementing other systems, adding dispatch to robberies, and much more!
Client Exports
OpenMDT
**exports.wasabi_mdt:OpenMDT(targetPage, cameraId)
**
Opens the MDT system. It will open to a specific target page or camera if defined.
targetPage (string, optional): The target page you want to open.
cameraId (int, optional): Opens MDT to specific CCTV camera view.
CreateDispatch
**exports.wasabi_mdt:CreateDispatch(data)
**
Creates a custom dispatch call.
data (table):
type(string): Type of dispatch (e.g. 'robbery', 'assault', 'disturbance')title(string): The title of the dispatchdescription(string): The description of the dispatchlocation(string): The location name of the dispatch (e.g. 'Pacific Bank')coords(table / optional): Coordinates of the crime. If not provided, will take triggering officer's position. (e.g.{x = number, y = number, z = number})priority(int / optional): An optional priority level (1-5, default if not defined is 2)departments(table / optional): Jobs that will receive the alert. If not provided, it will send the alert to all departments.
Example:
exports.wasabi_mdt:CreateDispatch({
type = 'robbery',
title = 'Store Robbery',
description = 'Armed suspect at convenience store',
location = '24/7 Vinewood',
coords = {x = 100, y = 200, z = 30},
priority = 4,
departments = { 'police', 'sheriff' }
})
SendPremadeDispatch
**exports.wasabi_mdt:SendPremadeDispatch(dispatchType, overrides)
**
Sends a premade dispatch call (defined in config) with optional overrides.
Returns true or false depending on success of dispatch being sent.
dispatchType (string)**: The premade dispatch type that you wish to use from within **Config.PremadeDispatches.
overrides (table, optional):
location(strings, optional): Overrides the location name of the premade dispatch defined in parameter "dispatchType".coords(table, optional): Overrides the coordinates of the premade dispatch ({x = number, y = number, z = number}).title(string, optional): Overrides the title.description(string, optional): Overrides the description.priority(number, optional): Override priority (1-5).
GetPlayerData
exports.wasabi_mdt:GetPlayerData()
Returns a table of various data of the local player
Returns: table - can be customized within the script!
- ped
- coords
- location
- street
- area
- gender
Example:
local player = exports.wasabi_mdt:GetPlayerData()
exports['wasabi_mdt']:CreateDispatch({
type = 'disturbance',
title = 'Suspicious Activity Reported',
description = 'A suspicious person has been reported in the ' player.area.. '. Possible illegal activity.',
location = player.location,
coords = {x = player.coords.x, y = player.coords.y, z = player.coords.z},
priority = 3
})
Server Exports
Announcements
GetAnnouncement
**exports.wasabi_mdt:GetAnnouncement(announcementId)
**
Returns announcement data for the specified announcementId
announcementId (number): The announcement ID you which to fetch from the export***.***
Example return data:
{
id = 22,
title = 'October LEO Meeting',
content = 'We have our monthly LEO meeting today. The meeting will be MANDATORY and will take place tomorrow, 3PM, MRPD.',
priority = 'medium',
created_at = 1759432445,
expires_at = 1759544045,
author = 'John Doe',
department = 'police'
}
GetAllAnnouncements
**exports.wasabi_mdt:GetAllAnnouncements()
**
Returns all active announcement data within an array or empty.
Example return data:
{
{
id = 22,
title = 'October LEO Meeting',
content = 'We have our monthly LEO meeting today. The meeting will be MANDATORY and will take place tomorrow, 3PM, MRPD.',
priority = 'medium',
created_at = 1759432445,
expires_at = 1759544045,
author = 'John Doe',
department = 'police'
},
{
id = 16,
title = 'Training Drill Reminder',
content = 'All LEOs are expected to participate in the upcoming training drill at Sandy Shores Airfield. Be prepared with full gear. This is crucial for improving tactical coordination.',
priority = 'high',
created_at = 1759211045,
expires_at = 1759322645,
author = 'Jane Smith',
department = 'sheriff'
},
{
id = 10,
title = 'Community Outreach Event',
content = 'Join us this weekend for the community outreach event at Legion Square. Officers will assist with safety demonstrations and answer public questions. Attendance is optional but encouraged.',
priority = 'low',
created_at = 1759100000,
expires_at = 1759760000,
author = 'Michael Johnson',
department = 'police'
}
}
GetAnnouncementsByDepartment
**exports.wasabi_mdt:GetAnnouncementsByDepartment(department)
**
Returns all active announcements for the defined department
department (string): The department(job) you which to fetch from the export***.***
Example return data:
{
{
id = 22,
title = 'October LEO Meeting',
content = 'We have our monthly LEO meeting today. The meeting will be MANDATORY and will take place tomorrow, 3PM, MRPD.',
priority = 'medium',
created_at = 1759432445,
expires_at = 1759544045,
author = 'John Doe',
department = 'police'
},
{
id = 10,
title = 'Community Outreach Event',
content = 'Join us this weekend for the community outreach event at Legion Square. Officers will assist with safety demonstrations and answer public questions. Attendance is optional but encouraged.',
priority = 'low',
created_at = 1759100000,
expires_at = 1759760000,
author = 'Michael Johnson',
department = 'police'
}
}
CreateAnnouncement
**exports.wasabi_mdt:CreateAnnouncement(data)
**
Creates an announcement from outside the MDT interface. Returns the announcement object if successful or false.
data (table):
title(string): Title of the announcementcontent(string, optional): The content of the announcementpriority(string, optional): The priority of the announcement, default of 'medium' if not defined ('low', 'medium', or 'high)created_at(number, optional): The unix time stamp in which the announcement was created, default to the time export triggered if not definedexpires_at(number, optional): The unix time stamp in which the announcement is set to expire, default to default expire days from configurationauthor(string, optional): The author of the announcement's name, default to 'System' if not defineddepartment(string): The department(job) in which the announcement was intended for
Example:
local announcementData = {
title = 'October LEO Meeting',
content = 'We have our monthly LEO meeting today. The meeting will be MANDATORY and will take place tomorrow, 3PM, MRPD.',
priority = 'medium',
author = 'John Doe',
department = 'police'
}
local newAnnouncement = exports.wasabi_mdt:CreateAnnouncement(announcementData)
Example return data:
{
id = 22,
title = 'October LEO Meeting',
content = 'We have our monthly LEO meeting today. The meeting will be MANDATORY and will take place tomorrow, 3PM, MRPD.',
priority = 'medium',
created_at = 1703124000,
expires_at = 1703125000,
author = 'John Doe',
department = 'police'
}
BOLOs
GetBOLO
**exports.wasabi_mdt:GetBOLO(boloId)
**
Returns BOLO data for the specified boloId
boloId (number): The BOLO ID you which to fetch from the export***.***
Example return data:
{
id = 1,
title = "Stolen Vehicle Alert",
description = "Red sedan involved in hit and run on Main Street",
vehicle_id = 123,
plate = "ABC123",
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
resolved_by = nil,
resolved_by_name = nil,
metadata = {
location = "Main Street",
time = "14:30"
},
created_at = 1703123456,
updated_at = 1703123456,
resolved_at = nil,
vehicle_model = "adder",
vehicle_owner = "John Doe"
}
GetAllBOLOs
exports.wasabi_mdt:GetAllBOLOs()
Returns all BOLOs in the system
Example return data:
{
{
id = 1,
title = "Stolen Vehicle Alert",
description = "Red sedan involved in hit and run on Main Street",
vehicle_id = 123,
plate = "ABC123",
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
resolved_by = nil,
resolved_by_name = nil,
metadata = {
location = "Main Street",
time = "14:30"
},
created_at = 1703123456,
updated_at = 1703123456,
resolved_at = nil,
vehicle_model = "adder",
vehicle_owner = "John Doe"
},
{
id = 2,
title = "Suspicious Person",
description = "Individual matching robbery suspect description",
vehicle_id = nil,
plate = nil,
status = "resolved",
issued_by = "char1:987654321",
issued_by_name = "Officer Smith",
resolved_by = "char1:123456789",
resolved_by_name = "Officer Johnson",
metadata = {
height = "6'2\"",
clothing = "Black hoodie"
},
created_at = 1703120000,
updated_at = 1703121000,
resolved_at = 1703121000,
vehicle_model = nil,
vehicle_owner = nil
}
}
GetActiveBOLOs
exports.wasabi_mdt:GetActiveBOLOs()
Returns only active BOLOs from the system
Example return data:
{
{
id = 1,
title = "Stolen Vehicle Alert",
description = "Red sedan involved in hit and run on Main Street",
vehicle_id = 123,
plate = "ABC123",
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
resolved_by = nil,
resolved_by_name = nil,
metadata = {
location = "Main Street",
time = "14:30"
},
created_at = 1703123456,
updated_at = 1703123456,
resolved_at = nil,
vehicle_model = "adder",
vehicle_owner = "John Doe"
},
{
id = 3,
title = "Missing Person",
description = "Elderly woman last seen near Central Park",
vehicle_id = nil,
plate = nil,
status = "active",
issued_by = "char1:555666777",
issued_by_name = "Officer Davis",
resolved_by = nil,
resolved_by_name = nil,
metadata = {
age = "75",
clothing = "Blue dress"
},
created_at = 1703122000,
updated_at = 1703122000,
resolved_at = nil,
vehicle_model = nil,
vehicle_owner = nil
}
}
CreateBOLO
exports.wasabi_mdt:CreateBOLO(data)
Creates a BOLO from outside the MDT interface. Returns the BOLO object if successful or false.
data (table):
title(string): BOLO titledescription(string): BOLO descriptionvehicle_id(number, optional): An optional vehicle ID if applicableplate(string, optional): Vehicle plate numberstatus(string, optional): Current status of BOLO, default of 'active' if not defined ('active', 'resolved', and 'expired')issued_by(string, optional): The officer's identifier issuing the BOLO (defaults to 'system')issued_by_name(string, optional): The officer's name (defaults to 'System')metadata(table, optional): Additional metadata
Example:
local boloData = {
title = "Armed Robbery Suspect",
description = "Male suspect armed with handgun, last seen fleeing north on 5th Street",
plate = "XYZ789",
metadata = {
weapon = "handgun",
direction = "north",
street = "5th Street"
}
}
local newBolo = exports.wasabi_mdt:CreateBOLO(boloData)
Example return data:
{
id = 4,
title = "Armed Robbery Suspect",
description = "Male suspect armed with handgun, last seen fleeing north on 5th Street",
vehicle_id = nil,
plate = "XYZ789",
status = "active",
issued_by = "system",
issued_by_name = "System",
resolved_by = nil,
resolved_by_name = nil,
metadata = {
weapon = "handgun",
direction = "north",
street = "5th Street"
},
created_at = 1703124000,
updated_at = 1703124000,
resolved_at = nil,
vehicle_model = nil,
vehicle_owner = nil
}
Cameras
GetCamera
exports.wasabi_mdt:GetCamera(cameraId)
Returns camera data for the specified cameraId
cameraId(number): The camera ID you wish to fetch from export.
Example return data:
{
id = 1,
name = "Downtown Intersection Cam",
location = "Main Street & 5th Avenue",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
rotation = {
x = 0.0,
y = 0.0,
z = 45.0
},
departments = {"police", "sasp"},
model = "prop_cctv_cam_01a",
metadata = {
range = 50.0,
night_vision = true,
recording = true
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456,
updated_at = 1703123456
}
GetAllCameras
exports.wasabi_mdt:GetAllCameras()
Returns all cameras in the system
Example return data:
{
{
id = 1,
name = "Downtown Intersection Cam",
location = "Main Street & 5th Avenue",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
rotation = {
x = 0.0,
y = 0.0,
z = 45.0
},
departments = {"police", "sasp"},
model = "prop_cctv_cam_01a",
metadata = {
range = 50.0,
night_vision = true,
recording = true
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456,
updated_at = 1703123456
},
{
id = 2,
name = "Bank Security Cam",
location = "Fleeca Bank Downtown",
coords = {
x = 150.0,
y = -1040.0,
z = 29.4
},
rotation = {
x = 0.0,
y = 0.0,
z = 90.0
},
departments = {"all"},
model = "prop_cctv_cam_01a",
metadata = {
range = 30.0,
night_vision = false,
recording = true
},
created_by = "char1:987654321",
created_by_name = "Officer Smith",
created_at = 1703120000,
updated_at = 1703120000
},
{
id = 3,
name = "Highway Patrol Cam",
location = "Highway 1 North",
coords = {
x = 1000.0,
y = 2000.0,
z = 50.0
},
rotation = {
x = 0.0,
y = 0.0,
z = 180.0
},
departments = {"police"},
model = "prop_cctv_cam_01a",
metadata = {
range = 100.0,
night_vision = true,
recording = true,
speed_detection = true
},
created_by = "char1:555666777",
created_by_name = "Officer Davis",
created_at = 1703122000,
updated_at = 1703122000
}
}
GetCamerasByDepartment
exports.wasabi_mdt:GetCamerasByDepartment(department)
Returns cameras accessible to the specified department
department(string): The department name to filter cameras by (e.g., "police", "sasp", "lssd")
Example return data (for department "police"):
{
{
id = 1,
name = "Downtown Intersection Cam",
location = "Main Street & 5th Avenue",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
rotation = {
x = 0.0,
y = 0.0,
z = 45.0
},
departments = {"police", "sasp"},
model = "prop_cctv_cam_01a",
metadata = {
range = 50.0,
night_vision = true,
recording = true
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456,
updated_at = 1703123456
},
{
id = 2,
name = "Bank Security Cam",
location = "Fleeca Bank Downtown",
coords = {
x = 150.0,
y = -1040.0,
z = 29.4
},
rotation = {
x = 0.0,
y = 0.0,
z = 90.0
},
departments = {"all"},
model = "prop_cctv_cam_01a",
metadata = {
range = 30.0,
night_vision = false,
recording = true
},
created_by = "char1:987654321",
created_by_name = "Officer Smith",
created_at = 1703120000,
updated_at = 1703120000
},
{
id = 3,
name = "Highway Patrol Cam",
location = "Highway 1 North",
coords = {
x = 1000.0,
y = 2000.0,
z = 50.0
},
rotation = {
x = 0.0,
y = 0.0,
z = 180.0
},
departments = {"police"},
model = "prop_cctv_cam_01a",
metadata = {
range = 100.0,
night_vision = true,
recording = true,
speed_detection = true
},
created_by = "char1:555666777",
created_by_name = "Officer Davis",
created_at = 1703122000,
updated_at = 1703122000
}
}
CreateCamera
exports.wasabi_mdt:CreateCamera(data)
Creates a new camera and returns the created camera object
data (table):
name(string): Camera namecoords(table): Camera coordinates (x,y,z)location(string, optional): Camera location description (defaults to "Unknown Location")rotation(table, optional): Camera rotation (x,y,z) (defaults to{x=0.0, y=0.0, z=0.0})departments(table, optional): Array of department names (defaults to{"all"})model(string, optional): Camera model prop (defaults to "prop_cctv_cam_01a")metadata(table, optional): Additional metadatacreated_by(string): Creator's identifiercreated_by_name(string): Creator's name
Example:
local cameraData = {
name = "Hospital Entry",
location = "Pillbox Hill Medical Center",
coords = {
x = 200.0,
y = -800.0,
z = 30.0
},
rotation = {
x = 0.0,
y = 0.0,
z = 270.0
},
departments = {"police", "sasp"},
model = "prop_cctv_cam_01a",
metadata = {
range = 40.0,
night_vision = true,
recording = true,
motion_detection = true
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson"
}
local newCamera = exports.wasabi_mdt:CreateCamera(cameraData)
Example return data:
{
id = 4,
name = "Hospital Entrance",
location = "Pillbox Hill Medical Center",
coords = {
x = 200.0,
y = -800.0,
z = 30.0
},
rotation = {
x = 0.0,
y = 0.0,
z = 270.0
},
departments = {"police", "sasp"},
model = "prop_cctv_cam_01a",
metadata = {
range = 40.0,
night_vision = true,
recording = true,
motion_detection = true
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703124000,
updated_at = 1703124000
}
Charges
GetCharge
exports.wasabi_mdt:GetCharge(chargeId)
Returns charge data for the specified chargeId
chargeId(number): The charge ID you wish to fetch from export.
Example return data:
{
id = 1,
title = "Assault",
description = "Unlawfully causing physical harm to another person",
jail_time = 30,
fine = 500,
category = "misdemeanor",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
severity = "moderate",
points = 2
},
created_at = 1703123456,
updated_at = 1703123456
}
GetAllCharges
exports.wasabi_mdt:GetAllCharges()
Returns all charges in the system
Example return data:
{
{
id = 1,
title = "Assault",
description = "Unlawfully causing physical harm to another person",
jail_time = 30,
fine = 500,
category = "misdemeanor",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
severity = "moderate",
points = 2
},
created_at = 1703123456,
updated_at = 1703123456
},
{
id = 2,
title = "Armed Robbery",
description = "Robbery committed while armed with a deadly weapon",
jail_time = 120,
fine = 2500,
category = "felony",
created_by = "char1:987654321",
created_by_name = "Officer Smith",
metadata = {
severity = "high",
points = 5,
weapon_required = true
},
created_at = 1703120000,
updated_at = 1703120000
},
{
id = 3,
title = "Jaywalking",
description = "Crossing the street outside of designated crosswalk areas",
jail_time = 0,
fine = 50,
category = "infraction",
created_by = "char1:555666777",
created_by_name = "Officer Davis",
metadata = {
severity = "low",
points = 0
},
created_at = 1703122000,
updated_at = 1703122000
},
{
id = 4,
title = "Drug Possession",
description = "Possession of controlled substances without prescription",
jail_time = 60,
fine = 1000,
category = "felony",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
severity = "high",
points = 3,
drug_type = "controlled"
},
created_at = 1703121000,
updated_at = 1703121000
}
}
GetChargesByCategory
exports.wasabi_mdt:GetChargesByCategory(category)
Returns charges filtered by the specified category
category(string): The charge category to filter by ("felony", "misdemeanor", "infraction")
Example return data (for category "felony"):
{
{
id = 2,
title = "Armed Robbery",
description = "Robbery committed while armed with a deadly weapon",
jail_time = 120,
fine = 2500,
category = "felony",
created_by = "char1:987654321",
created_by_name = "Officer Smith",
metadata = {
severity = "high",
points = 5,
weapon_required = true
},
created_at = 1703120000,
updated_at = 1703120000
},
{
id = 4,
title = "Drug Possession",
description = "Possession of controlled substances without prescription",
jail_time = 60,
fine = 1000,
category = "felony",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
severity = "high",
points = 3,
drug_type = "controlled"
},
created_at = 1703121000,
updated_at = 1703121000
},
{
id = 5,
title = "Murder",
description = "Unlawful killing of another person with malice aforethought",
jail_time = 300,
fine = 10000,
category = "felony",
created_by = "char1:111222333",
created_by_name = "Detective Brown",
metadata = {
severity = "maximum",
points = 10,
parole_eligible = false
},
created_at = 1703123000,
updated_at = 1703123000
}
}
CreateCharge
exports.wasabi_mdt:CreateCharge(data)
Creates a new charge and returns the created charge object
data (table):
title(string): Charge titledescription(string): Charge descriptionjail_time(number, optional): Jail time in minutes (defaults to 0)fine(number, optional): Fine amount in dollars (defaults to 0)category(string, optional): Charge category (defaults to "misdemeanor")created_by(string, optional): Creator identifier (defaults to "system")created_by_name(string, optional): Creator name (defaults to "System")metadata(table, optional): Additional metadata
Example:
local chargeData = {
title = "Reckless Driving",
description = "Operating a vehicle with willful disregard for safety",
jail_time = 15,
fine = 750,
category = "misdemeanor",
metadata = {
severity = "moderate",
points = 2,
license_suspension = true
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson"
}
local newCharge = exports.wasabi_mdt:CreateCharge(chargeData)
Example return data:
{
id = 6,
title = "Reckless Driving",
description = "Operating a vehicle with willful disregard for safety",
jail_time = 15,
fine = 750,
category = "misdemeanor",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
severity = "moderate",
points = 2,
license_suspension = true
},
created_at = 1703124000,
updated_at = 1703124000
}
Citizen
GetCitizen
exports.wasabi_mdt:GetCitizen(identifier)
Returns citizen data for the specified identifier
identifier(string): The citizen identifier you wish to fetch from export.
Example return data:
{
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe",
dob = "1990-05-15",
phone = "555-0123",
gender = "male",
fingerprint = "A1B2C3D4E5",
metadata = {
address = "123 Main Street",
emergency_contact = "Jane Doe - 555-0124",
medical_conditions = "None",
avatarPhotoId = 1
},
created_at = 1703123456,
updated_at = 1703123456,
job = "mechanic",
job_label = "Mechanic",
job_grade = 2,
job_grade_label = "Senior Mechanic",
hasWarrant = false,
photos = {
{
id = 1,
url = "https://example.com/photos/citizen_1.jpg",
entity_type = "citizen",
entity_id = "citizen:1234561703123456",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456
}
},
avatar = {
id = 1,
url = "https://example.com/photos/citizen_1.jpg",
entity_type = "citizen",
entity_id = "citizen:1234561703123456",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456
}
}
CreateCitizen
exports.wasabi_mdt:CreateCitizen(data)
Creates a new citizen and returns the created citizen object
data (table):
firstname(string): Citizen's first namelastname(string): Citizen's last nameidentifier(string, optional): Citizen identifier (auto-generated if not provided)dob(string, optional): Date of birth (defaults to "Unknown")phone(string, optional): Phone number (defaults to "Unknown")gender(string, optional): Gender (defaults to "other")job(string, optional): Job namejob_grade(number, optional): Job grade level (defaults to 0)fingerprint(string, optional): Fingerprint (auto-generated if not provided)metadata(table, optional): Additional metadata
Example:
local citizenData = {
firstname = "Jane",
lastname = "Smith",
dob = "1985-08-22",
phone = "555-9876",
gender = "female",
job = "doctor",
job_grade = 3,
metadata = {
address = "456 Oak Avenue",
emergency_contact = "Bob Smith - 555-9877",
medical_conditions = "Diabetes",
blood_type = "O+"
}
}
local newCitizen = exports.wasabi_mdt:CreateCitizen(citizenData)
Example return data:
{
identifier = "citizen:7890121703124000",
name = "Jane Smith",
firstname = "Jane",
lastname = "Smith",
dob = "1985-08-22",
phone = "555-9876",
gender = "female",
fingerprint = "F6G7H8I9J0",
metadata = {
address = "456 Oak Avenue",
emergency_contact = "Bob Smith - 555-9877",
medical_conditions = "Diabetes",
blood_type = "O+"
},
created_at = 1703124000,
updated_at = 1703124000,
job = "doctor",
job_label = "Doctor",
job_grade = 3,
job_grade_label = "Senior Doctor",
hasWarrant = false,
photos = {},
avatar = nil
}
SearchCitizens
exports.wasabi_mdt:SearchCitizens(query)
Searches citizens by name, identifier, phone, or fingerprint
query(string): Search term to match against citizen data
Example return data:
{
{
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe",
dob = "1990-05-15",
phone = "555-0123",
gender = "male",
fingerprint = "A1B2C3D4E5",
metadata = {
address = "123 Main Street",
emergency_contact = "Jane Doe - 555-0124",
medical_conditions = "None"
},
created_at = 1703123456,
updated_at = 1703123456,
job = "mechanic",
job_label = "Mechanic",
job_grade = 2,
job_grade_label = "Senior Mechanic",
hasWarrant = false,
photos = {},
avatar = nil
},
{
identifier = "citizen:7890121703124000",
name = "Jane Smith",
firstname = "Jane",
lastname = "Smith",
dob = "1985-08-22",
phone = "555-9876",
gender = "female",
fingerprint = "F6G7H8I9J0",
metadata = {
address = "456 Oak Avenue",
emergency_contact = "Bob Smith - 555-9877",
medical_conditions = "Diabetes",
blood_type = "O+"
},
created_at = 1703124000,
updated_at = 1703124000,
job = "doctor",
job_label = "Doctor",
job_grade = 3,
job_grade_label = "Senior Doctor",
hasWarrant = false,
photos = {},
avatar = nil
},
{
identifier = "citizen:3456781703125000",
name = "Mike Johnson",
firstname = "Mike",
lastname = "Johnson",
dob = "1992-12-03",
phone = "555-4567",
gender = "male",
fingerprint = "K1L2M3N4O5",
metadata = {
address = "789 Pine Street",
emergency_contact = "Sarah Johnson - 555-4568"
},
created_at = 1703125000,
updated_at = 1703125000,
job = "police",
job_label = "Police Officer",
job_grade = 1,
job_grade_label = "Officer",
hasWarrant = false,
photos = {},
avatar = nil
}
}
Dispatch
CreateDispatch
exports.wasabi_mdt:CreateDispatch(data)
Creates a new dispatch and returns the created dispatch object
data (table):
type(string): Dispatch type (e.g., "disturbance", "traffic", "emergency")title(string): Dispatch titlecoords(table): Dispatch coordinates (x,y,z)description(string, optional): Dispatch description (defaults to empty string)location(string, optional): Location description (defaults to "Unknown Location")priority(number, optional): Priority level 1-5 (1=low, 5=emergency, defaults to 1)status(string, optional): Dispatch status (defaults to "pending")created_by(string, optional): Creator identifiercreated_by_name(string, optional): Creator name (defaults to "System")departments(string|table, optional): Department(s) to send to (defaults to "all")metadata(table, optional): Additional metadata
Example:
local dispatchData = {
type = "disturbance",
title = "Domestic Dispute",
description = "Reports of loud arguing and potential violence at residence",
location = "123 Main Street",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
priority = 3,
departments = {"police", "sasp"},
metadata = {
caller_name = "Anonymous",
caller_phone = "555-0123",
weapons_involved = false,
injuries_reported = false
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson"
}
local newDispatch = exports.wasabi_mdt:CreateDispatch(dispatchData)
Example return data:
{
id = "DISP-0001",
type = "disturbance",
title = "Domestic Dispute",
description = "Reports of loud arguing and potential violence at residence",
location = "123 Main Street",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
priority = 3,
status = "pending",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456,
updated_at = 1703123456,
completed_at = nil,
assigned_officers = {},
departments = {"police", "sasp"},
metadata = {
caller_name = "Anonymous",
caller_phone = "555-0123",
weapons_involved = false,
injuries_reported = false
}
}
GetActiveDispatches
exports.wasabi_mdt:GetActiveDispatches()
Returns all currently active dispatches
Example return data:
{
["DISP-0001"] = {
id = "DISP-0001",
type = "disturbance",
title = "Domestic Dispute",
description = "Reports of loud arguing and potential violence at residence",
location = "123 Main Street",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
priority = 3,
status = "assigned",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456,
updated_at = 1703124000,
completed_at = nil,
assigned_officers = {
["char1:987654321"] = {
name = "Officer Smith",
status = "en_route",
assigned_at = 1703123500,
updated_at = 1703124000
}
},
departments = {"police", "sasp"},
metadata = {
caller_name = "Anonymous",
caller_phone = "555-0123",
weapons_involved = false,
injuries_reported = false
}
},
["DISP-0002"] = {
id = "DISP-0002",
type = "traffic",
title = "Vehicle Accident",
description = "Two vehicle collision with injuries reported",
location = "Highway 1 & Oak Street",
coords = {
x = 1000.0,
y = 2000.0,
z = 50.0
},
priority = 4,
status = "on_scene",
created_by = "char1:555666777",
created_by_name = "Officer Davis",
created_at = 1703122000,
updated_at = 1703123000,
completed_at = nil,
assigned_officers = {
["char1:111222333"] = {
name = "Officer Brown",
status = "on_scene",
assigned_at = 1703122100,
updated_at = 1703123000
},
["char1:444555666"] = {
name = "Officer Wilson",
status = "on_scene",
assigned_at = 1703122200,
updated_at = 1703123000
}
},
departments = "all",
metadata = {
vehicles_involved = 2,
injuries_reported = true,
road_blocked = true,
tow_required = true
}
},
["DISP-0003"] = {
id = "DISP-0003",
type = "emergency",
title = "Armed Robbery",
description = "Bank robbery in progress, suspects armed",
location = "Fleeca Bank Downtown",
coords = {
x = 150.0,
y = -1040.0,
z = 29.4
},
priority = 5,
status = "pending",
created_by = "system",
created_by_name = "System",
created_at = 1703125000,
updated_at = 1703125000,
completed_at = nil,
assigned_officers = {},
departments = {"police", "sasp"},
metadata = {
suspects_count = 2,
weapons_confirmed = true,
hostages_reported = false,
alarm_triggered = true
}
}
}
Evidence
GetEvidence
**exports.wasabi_mdt:GetEvidence(evidenceId)
**
Returns evidence data for the specified evidenceId
evidenceId(number): The evidence ID you wish to fetch from export
Example return data:
{
id = 1,
evidence_number = "EV-000001",
evidence_type = "weapon",
description = "Glock 17 handgun found at crime scene",
notes = "Serial number partially obscured, needs forensic analysis",
location_found = "123 Main Street, Apartment 4B",
storage_location = "Evidence Room A-12",
status = "checked_in",
collected_by = "char1:123456789",
collected_by_name = "Officer Johnson",
collecting_officer = {
identifier = "char1:123456789",
name = "Officer Johnson"
},
metadata = {
serial_number = "GLK123456",
caliber = "9mm",
condition = "good",
dna_collected = true,
fingerprint_collected = true
},
avatar = nil,
created_at = 1703123456,
updated_at = 1703123456,
chain_of_custody = {
{
id = 1,
evidence_id = 1,
officer_identifier = "char1:123456789",
officer_name = "Officer Johnson",
action = "collected",
notes = "Evidence collected",
timestamp = 1703123456
}
},
photos = {
{
id = 1,
url = "https://example.com/photos/evidence_1.jpg",
entity_type = "evidence",
entity_id = "1",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123456
}
},
linked_citizens = {
{
citizen = {
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe"
},
metadata = {
relationship = "suspect",
notes = "Found in suspect's apartment"
},
link_id = 1
}
},
linked_vehicles = {},
linked_weapons = {},
linked_properties = {},
linked_officers = {}
}
GetAllEvidence
exports.wasabi_mdt:GetAllEvidence()
Returns all evidence in the system
Example return data:
{
{
id = 1,
evidence_number = "EV-000001",
evidence_type = "weapon",
description = "Glock 17 handgun found at crime scene",
notes = "Serial number partially obscured, needs forensic analysis",
location_found = "123 Main Street, Apartment 4B",
storage_location = "Evidence Room A-12",
status = "checked_in",
collected_by = "char1:123456789",
collected_by_name = "Officer Johnson",
collecting_officer = {
identifier = "char1:123456789",
name = "Officer Johnson"
},
metadata = {
serial_number = "GLK123456",
caliber = "9mm",
condition = "good",
dna_collected = true,
fingerprint_collected = true
},
avatar = nil,
created_at = 1703123456,
updated_at = 1703123456,
chain_of_custody = {
{
id = 1,
evidence_id = 1,
officer_identifier = "char1:123456789",
officer_name = "Officer Johnson",
action = "collected",
notes = "Evidence collected",
timestamp = 1703123456
}
},
photos = {},
linked_citizens = {},
linked_vehicles = {},
linked_weapons = {},
linked_properties = {},
linked_officers = {}
},
{
id = 2,
evidence_number = "EV-000002",
evidence_type = "drugs",
description = "Small bag of white powder substance",
notes = "Field tested positive for cocaine",
location_found = "Vehicle search - License plate ABC123",
storage_location = "Evidence Room B-05",
status = "checked_out",
collected_by = "char1:987654321",
collected_by_name = "Officer Smith",
collecting_officer = {
identifier = "char1:987654321",
name = "Officer Smith"
},
metadata = {
weight = "2.5 grams",
field_test_result = "positive",
lab_test_pending = true,
packaging = "plastic bag"
},
avatar = nil,
created_at = 1703122000,
updated_at = 1703124000,
chain_of_custody = {
{
id = 2,
evidence_id = 2,
officer_identifier = "char1:987654321",
officer_name = "Officer Smith",
action = "collected",
notes = "Evidence collected",
timestamp = 1703122000
},
{
id = 3,
evidence_id = 2,
officer_identifier = "char1:555666777",
officer_name = "Officer Davis",
action = "checked_out",
notes = "Taking to lab for analysis",
timestamp = 1703124000
}
},
photos = {},
linked_citizens = {},
linked_vehicles = {},
linked_weapons = {},
linked_properties = {},
linked_officers = {}
},
{
id = 3,
evidence_number = "EV-000003",
evidence_type = "clothing",
description = "Blood-stained shirt found at scene",
notes = "Blood appears to be from victim, needs DNA analysis",
location_found = "Alley behind 456 Oak Street",
storage_location = "Evidence Room C-18",
status = "checked_in",
collected_by = "char1:111222333",
collected_by_name = "Detective Brown",
collecting_officer = {
identifier = "char1:111222333",
name = "Detective Brown"
},
metadata = {
color = "blue",
size = "large",
blood_stains = true,
dna_collected = true,
fabric_type = "cotton"
},
avatar = nil,
created_at = 1703121000,
updated_at = 1703121000,
chain_of_custody = {
{
id = 4,
evidence_id = 3,
officer_identifier = "char1:111222333",
officer_name = "Detective Brown",
action = "collected",
notes = "Evidence collected",
timestamp = 1703121000
}
},
photos = {},
linked_citizens = {},
linked_vehicles = {},
linked_weapons = {},
linked_properties = {},
linked_officers = {}
}
}
CreateEvidence
exports.wasabi_mdt:CreateEvidence(data)
Creates a new evidence item and returns the created evidence object
data (table):
evidence_type(string): Type of evidence (e.g., "weapon", "drugs", "clothing", "document")description(string): Evidence descriptioncollected_by(string): Officer identifier who collected the evidenceevidence_number(string, optional): Evidence number (auto-generated if not provided)notes(string, optional): Additional notes (defaults to empty string)location_found(string, optional): Where evidence was found (defaults to "Unknown")storage_location(string, optional): Where evidence is stored (defaults to "Evidence Room")status(string, optional): Evidence status (defaults to "checked_in")collected_by_name(string, optional): Officer name (defaults to "Unknown Officer")metadata(table, optional): Additional metadata
Example:
local evidenceData = {
evidence_type = "document",
description = "Bank statement showing suspicious transactions",
notes = "Multiple large cash deposits, potential money laundering",
location_found = "Suspect's residence - 789 Pine Street",
storage_location = "Evidence Room D-03",
metadata = {
bank_name = "Fleeca Bank",
account_holder = "John Doe",
suspicious_amounts = true,
date_range = "2023-11-01 to 2023-12-01"
},
collected_by = "char1:123456789",
collected_by_name = "Officer Johnson"
}
local newEvidence = exports.wasabi_mdt:CreateEvidence(evidenceData)
Example return data:
{
id = 4,
evidence_number = "EV-000004",
evidence_type = "document",
description = "Bank statement showing suspicious transactions",
notes = "Multiple large cash deposits, potential money laundering",
location_found = "Suspect's residence - 789 Pine Street",
storage_location = "Evidence Room D-03",
status = "checked_in",
collected_by = "char1:123456789",
collected_by_name = "Officer Johnson",
collecting_officer = {
identifier = "char1:123456789",
name = "Officer Johnson"
},
metadata = {
bank_name = "Fleeca Bank",
account_holder = "John Doe",
suspicious_amounts = true,
date_range = "2023-11-01 to 2023-12-01"
},
avatar = nil,
created_at = 1703125000,
updated_at = 1703125000,
chain_of_custody = {
{
id = 5,
evidence_id = 4,
officer_identifier = "char1:123456789",
officer_name = "Officer Johnson",
action = "collected",
notes = "Evidence collected",
timestamp = 1703125000
}
},
photos = {},
linked_citizens = {},
linked_vehicles = {},
linked_weapons = {},
linked_properties = {},
linked_officers = {}
}
Incidents
GetIncident
exports.wasabi_mdt:GetIncident(incidentId)
Returns incident data for the specified incidentId
incidentId(number): The incident ID you wish to fetch from export
Example return data:
{
id = 1,
incident_number = "INC-000001",
title = "Domestic Violence Incident",
description = "Report of domestic violence at residence, victim sustained minor injuries",
location = "123 Main Street, Apartment 4B",
status = "open",
primary_citizen = "citizen:1234561703123456",
primary_citizen_data = {
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe",
dob = "1990-05-15",
phone = "555-0123",
gender = "male",
fingerprint = "A1B2C3D4E5"
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
closed_by = nil,
closed_by_name = nil,
total_fine = 1500,
total_jail_time = 60,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 5000,
max_jail = 120,
metadata = {
victim_injuries = "minor",
weapons_involved = false,
children_present = true,
emergency_services_called = true
},
created_at = 1703123456,
updated_at = 1703123456,
closed_at = nil,
notes = {
{
id = 1,
content = "Victim was cooperative and provided statement",
entity_type = "incident",
entity_id = "1",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
created_at = 1703123500
}
},
linked_charges = {
{
id = 1,
title = "Assault",
description = "Unlawfully causing physical harm to another person",
jail_time = 30,
fine = 500,
category = "misdemeanor",
link_metadata = {
adjusted_fine = 500,
adjusted_jail = 30
},
link_id = 1
},
{
id = 2,
title = "Domestic Violence",
description = "Violence committed against family member",
jail_time = 30,
fine = 1000,
category = "felony",
link_metadata = {
adjusted_fine = 1000,
adjusted_jail = 30
},
link_id = 2
}
},
linked_citizens = {
{
citizen = {
identifier = "citizen:7890121703124000",
name = "Jane Smith",
firstname = "Jane",
lastname = "Smith"
},
metadata = {
role = "victim",
relationship = "spouse"
},
link_id = 3
}
},
linked_vehicles = {},
linked_evidence = {
{
evidence = {
id = 1,
evidence_number = "EV-000001",
evidence_type = "weapon",
description = "Kitchen knife found at scene"
},
metadata = {
relevance = "potential weapon",
collected_at_scene = true
},
link_id = 4
}
},
linked_officers = {}
}
GetAllIncidents
exports.wasabi_mdt:GetAllIncidents()
Returns all incidents in the system
Example return data:
{
{
id = 1,
incident_number = "INC-000001",
title = "Domestic Violence Incident",
description = "Report of domestic violence at residence, victim sustained minor injuries",
location = "123 Main Street, Apartment 4B",
status = "open",
primary_citizen = "citizen:1234561703123456",
primary_citizen_data = {
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe"
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
closed_by = nil,
closed_by_name = nil,
total_fine = 1500,
total_jail_time = 60,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 5000,
max_jail = 120,
metadata = {
victim_injuries = "minor",
weapons_involved = false
},
created_at = 1703123456,
updated_at = 1703123456,
closed_at = nil,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
},
{
id = 2,
incident_number = "INC-000002",
title = "Traffic Accident with Injuries",
description = "Two vehicle collision resulting in injuries",
location = "Highway 1 & Oak Street",
status = "closed",
primary_citizen = "citizen:3456781703125000",
primary_citizen_data = {
identifier = "citizen:3456781703125000",
name = "Mike Johnson",
firstname = "Mike",
lastname = "Johnson"
},
created_by = "char1:987654321",
created_by_name = "Officer Smith",
closed_by = "char1:555666777",
closed_by_name = "Officer Davis",
total_fine = 750,
total_jail_time = 15,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 2000,
max_jail = 30,
metadata = {
vehicles_involved = 2,
injuries_reported = true,
road_blocked = true
},
created_at = 1703122000,
updated_at = 1703123000,
closed_at = 1703123000,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
}
}
GetIncidentsByCitizen
exports.wasabi_mdt:GetIncidentsByCitizen(citizenId)
Returns incidents associated with the specified citizen
citizenId(string): The citizen identifier to filter incidents by
Example return data:
{
{
id = 1,
incident_number = "INC-000001",
title = "Domestic Violence Incident",
description = "Report of domestic violence at residence, victim sustained minor injuries",
location = "123 Main Street, Apartment 4B",
status = "open",
primary_citizen = "citizen:1234561703123456",
primary_citizen_data = {
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe"
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
closed_by = nil,
closed_by_name = nil,
total_fine = 1500,
total_jail_time = 60,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 5000,
max_jail = 120,
metadata = {
victim_injuries = "minor",
weapons_involved = false
},
created_at = 1703123456,
updated_at = 1703123456,
closed_at = nil,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
},
{
id = 3,
incident_number = "INC-000003",
title = "Public Disturbance",
description = "Loud noise complaint and disorderly conduct",
location = "456 Oak Avenue",
status = "closed",
primary_citizen = "citizen:1234561703123456",
primary_citizen_data = {
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe"
},
created_by = "char1:111222333",
created_by_name = "Detective Brown",
closed_by = "char1:111222333",
closed_by_name = "Detective Brown",
total_fine = 200,
total_jail_time = 0,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 1000,
max_jail = 15,
metadata = {
noise_complaint = true,
alcohol_involved = true
},
created_at = 1703121000,
updated_at = 1703121500,
closed_at = 1703121500,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
}
}
GetRecentIncidents
exports.wasabi_mdt:GetRecentIncidents(limit)
Returns the most recent incidents, limited by the specified number
limit(number): Maximum number of recent incidents to return (defaults to 10)
Example return data (limit = 5):
{
{
id = 1,
incident_number = "INC-000001",
title = "Domestic Violence Incident",
description = "Report of domestic violence at residence, victim sustained minor injuries",
location = "123 Main Street, Apartment 4B",
status = "open",
primary_citizen = "citizen:1234561703123456",
primary_citizen_data = {
identifier = "citizen:1234561703123456",
name = "John Doe",
firstname = "John",
lastname = "Doe"
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
closed_by = nil,
closed_by_name = nil,
total_fine = 1500,
total_jail_time = 60,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 5000,
max_jail = 120,
metadata = {
victim_injuries = "minor",
weapons_involved = false
},
created_at = 1703123456,
updated_at = 1703123456,
closed_at = nil,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
},
{
id = 2,
incident_number = "INC-000002",
title = "Traffic Accident with Injuries",
description = "Two vehicle collision resulting in injuries",
location = "Highway 1 & Oak Street",
status = "closed",
primary_citizen = "citizen:3456781703125000",
primary_citizen_data = {
identifier = "citizen:3456781703125000",
name = "Mike Johnson",
firstname = "Mike",
lastname = "Johnson"
},
created_by = "char1:987654321",
created_by_name = "Officer Smith",
closed_by = "char1:555666777",
closed_by_name = "Officer Davis",
total_fine = 750,
total_jail_time = 15,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 2000,
max_jail = 30,
metadata = {
vehicles_involved = 2,
injuries_reported = true,
road_blocked = true
},
created_at = 1703122000,
updated_at = 1703123000,
closed_at = 1703123000,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
}
}
CreateIncident
exports.wasabi_mdt:CreateIncident(data)
Creates a new incident and returns the created incident object
data (table):
title(string): Incident titlecreated_by(string): Officer identifier who created the incidentcollected_by(string): Officer identifier who collected the evidenceincident_number(string, optional): Incident number (auto-generated if not provided)description(string, optional): Incident description (defaults to empty string)location(string, optional): Incident location (defaults to "Unknown")status(string, optional): Incident status (defaults to "open")primary_citizen(string, optional): Primary citizen identifiercreated_by_name(string, optional): Officer name (defaults to "Unknown Officer")total_fine(number, optional): Total fine amount (defaults to 0)total_jail_time(number, optional): Total jail time in months (defaults to 0)fine_reduction(number, optional): Fine reduction percentage (defaults to 0)jail_reduction(number, optional): Jail time reduction percentage (defaults to 0)manual_fine(boolean, optional): Whether fine was manually set (defaults to false)manual_jail(boolean, optional): Whether jail time was manually set (defaults to false)max_fine(number, optional): Maximum fine allowed (defaults to 0)max_jail(number, optional): Maximum jail time allowed (defaults to 0)metadata(table, optional): Additional metadata
Example:
local incidentData = {
title = "Drug Possession Arrest",
description = "Suspect found in possession of controlled substances during traffic stop",
location = "Highway 1, Mile Marker 15",
primary_citizen = "citizen:7890121703124000",
metadata = {
traffic_stop_initiated = true,
consent_to_search = false,
warrant_obtained = true,
substances_found = "cocaine, marijuana"
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson"
}
local newIncident = exports.wasabi_mdt:CreateIncident(incidentData)
Example return data:
{
id = 4,
incident_number = "INC-000004",
title = "Drug Possession Arrest",
description = "Suspect found in possession of controlled substances during traffic stop",
location = "Highway 1, Mile Marker 15",
status = "open",
primary_citizen = "citizen:7890121703124000",
primary_citizen_data = {
identifier = "citizen:7890121703124000",
name = "Jane Smith",
firstname = "Jane",
lastname = "Smith"
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
closed_by = nil,
closed_by_name = nil,
total_fine = 0,
total_jail_time = 0,
fine_reduction = 0,
jail_reduction = 0,
manual_fine = false,
manual_jail = false,
max_fine = 0,
max_jail = 0,
metadata = {
traffic_stop_initiated = true,
consent_to_search = false,
warrant_obtained = true,
substances_found = "cocaine, marijuana"
},
created_at = 1703125000,
updated_at = 1703125000,
closed_at = nil,
notes = {},
linked_charges = {},
linked_citizens = {},
linked_vehicles = {},
linked_evidence = {},
linked_officers = {}
}
Notes
GetNote
exports.wasabi_mdt:GetNote(noteId)
Returns note data for the specified noteId
noteId(number): The note ID you wish to fetch from export.
Example return data:
{
id = 1,
content = "Suspect was cooperative during questioning and provided detailed statement about the incident. No signs of intoxication observed.",
entity_type = "citizen",
entity_id = "citizen:1234561703123456",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
interview_duration = "45 minutes",
witness_present = true,
recording_made = true,
follow_up_required = false
},
created_at = 1703123456,
updated_at = 1703123456
}
CreateNote
exports.wasabi_mdt:CreateNote(data)
Creates a new note and returns the created note object
data (table):
content(string): Note content/textentity_type(string): Type of entity the note is attached to (e.g., "citizen", "incident", "evidence", "vehicle")entity_id(string): ID of the entity the note is attached tocreated_by(string): Officer identifier who created the notecreated_by_name(string, optional): Officer name (defaults to "Unknown")metadata(table, optional): Additional metadata
Example:
local noteData = {
content = "Vehicle was found abandoned with keys still in ignition. No signs of forced entry. Owner claims vehicle was stolen from parking lot.",
entity_type = "vehicle",
entity_id = "123",
metadata = {
investigation_status = "ongoing",
theft_report_filed = true,
owner_interviewed = true,
forensic_evidence_collected = false
},
created_by = "char1:123456789",
created_by_name = "Officer Johnson"
}
local newNote = exports.wasabi_mdt:CreateNote(noteData)
Example return data:
{
id = 2,
content = "Vehicle was found abandoned with keys still in ignition. No signs of forced entry. Owner claims vehicle was stolen from parking lot.",
entity_type = "vehicle",
entity_id = "123",
created_by = "char1:123456789",
created_by_name = "Officer Johnson",
metadata = {
investigation_status = "ongoing",
theft_report_filed = true,
owner_interviewed = true,
forensic_evidence_collected = false
},
created_at = 1703124000,
updated_at = 1703124000
}
Photos
GetPhoto
exports.wasabi_mdt:GetPhoto(photoId)
Returns photo data for the specified photoId
photoId(number): The photo ID you wish to fetch from export
Example return data:
{
id = 1,
url = "https://example.com/photos/mdt_photo_123456.jpg",
entity_type = "citizen",
entity_id = "citizen:1234561703123456",
uploaded_by = "char1:123456789",
uploaded_by_name = "Officer Johnson",
description = "Mugshot taken during booking process",
metadata = {
photo_type = "mugshot",
camera_used = "department_camera_01",
lighting_conditions = "good",
quality_rating = "high",
facial_recognition_processed = true
},
created_at = 1703123456
}
CreatePhoto
exports.wasabi_mdt:CreatePhoto(data)
Creates a new photo record and returns the created photo object
data (table):
url(string): URL where the photo is storedstored_id(string): Unique identifier for the photo in cloud storageentity_type(string): Type of entity the photo is attached to (e.g., "citizen", "incident", "evidence", "vehicle")entity_id(string|number): ID of the entity the photo is attached touploaded_by(string): Officer identifier who uploaded the photouploaded_by_name(string, optional): Officer name (defaults to "Unknown")description(string, optional): Photo description (defaults to empty string)metadata(table, optional): Additional metadata
Example:
local photoData = {
url = "https://example.com/photos/evidence_weapon_001.jpg",
stored_id = "img_abc123def456",
entity_type = "evidence",
entity_id = "1",
description = "Weapon found at crime scene - Glock 17 handgun",
metadata = {
photo_type = "evidence",
evidence_number = "EV-000001",
crime_scene_location = "123 Main Street",
forensic_analysis_required = true,
serial_number_visible = true,
condition = "good"
},
uploaded_by = "char1:123456789",
uploaded_by_name = "Officer Johnson"
}
local newPhoto = exports.wasabi_mdt:CreatePhoto(photoData)
Example return data:
{
id = 2,
url = "https://example.com/photos/evidence_weapon_001.jpg",
entity_type = "evidence",
entity_id = "1",
uploaded_by = "char1:123456789",
uploaded_by_name = "Officer Johnson",
description = "Weapon found at crime scene - Glock 17 handgun",
metadata = {
photo_type = "evidence",
evidence_number = "EV-000001",
crime_scene_location = "123 Main Street",
forensic_analysis_required = true,
serial_number_visible = true,
condition = "good"
},
created_at = 1703124000
}
Properties
GetProperty
exports.wasabi_mdt:GetProperty(propertyId)
Returns property data for the specified propertyId
propertyId(number): The property ID you wish to fetch from export
Example return data:
{
id = 1,
address = "123 Main Street",
property_type = "house",
property_label = "Residential House",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
metadata = {
bedrooms = 3,
bathrooms = 2,
square_feet = 1500,
year_built = 1995,
flagged = false,
notes = "Well maintained property"
},
created_at = 1703123456,
updated_at = 1703123456,
flagged = false,
photos = {
{
id = 1,
url = "https://example.com/photos/property_1.jpg",
entity_type = "property",
entity_id = "1",
uploaded_by = "char1:123456789",
uploaded_by_name = "Officer Johnson",
description = "Front view of property",
created_at = 1703123456
}
},
avatar = nil
}
GetAllProperties
exports.wasabi_mdt:GetAllProperties()
Returns all properties in the system
Example return data:
{
{
id = 1,
address = "123 Main Street",
property_type = "house",
property_label = "Residential House",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
metadata = {
bedrooms = 3,
bathrooms = 2,
square_feet = 1500,
year_built = 1995,
flagged = false
},
created_at = 1703123456,
updated_at = 1703123456,
flagged = false,
photos = {},
avatar = nil
},
{
id = 2,
address = "456 Oak Avenue",
property_type = "apartment",
property_label = "Apartment Complex",
owner_id = "citizen:7890121703124000",
owner_name = "Jane Smith",
coords = {
x = 200.0,
y = -800.0,
z = 30.0
},
metadata = {
unit_number = "4B",
bedrooms = 2,
bathrooms = 1,
square_feet = 900,
year_built = 2010,
flagged = true,
flagged_reason = "Previous drug activity"
},
created_at = 1703122000,
updated_at = 1703122000,
flagged = true,
photos = {},
avatar = nil
},
{
id = 3,
address = "789 Pine Street",
property_type = "business",
property_label = "Commercial Building",
owner_id = "citizen:3456781703125000",
owner_name = "Mike Johnson",
coords = {
x = 1000.0,
y = 2000.0,
z = 50.0
},
metadata = {
business_type = "restaurant",
square_feet = 2500,
year_built = 1985,
flagged = false,
license_number = "BL-2023-001"
},
created_at = 1703121000,
updated_at = 1703121000,
flagged = false,
photos = {},
avatar = nil
}
}
CreateProperty
exports.wasabi_mdt:CreateProperty(data)
Creates a new property and returns the created property object
data (table):
address(string): URL where the photo is storedproperty_type(string): Unique identifier for the photo in cloud storageowner_id(string, optional): Type of entity the photo is attached to (e.g., "citizen", "incident", "evidence", "vehicle")coords(table, optional): Property coordinates (x, y, z), defaults to{x=0.0, y=0.0, z=0.0}metadata(table, optional): Additional metadata
Example:
local propertyData = {
address = "321 Elm Street",
property_type = "warehouse",
owner_id = "citizen:111222333444555",
coords = {
x = 1500.0,
y = 3000.0,
z = 25.0
},
metadata = {
square_feet = 5000,
year_built = 2000,
business_type = "storage",
flagged = false,
security_level = "high",
access_restrictions = "authorized personnel only"
}
}
local newProperty = exports.wasabi_mdt:CreateProperty(propertyData)
Example return data:
{
id = 4,
address = "321 Elm Street",
property_type = "warehouse",
property_label = "Warehouse",
owner_id = "citizen:111222333444555",
owner_name = "Robert Wilson",
coords = {
x = 1500.0,
y = 3000.0,
z = 25.0
},
metadata = {
square_feet = 5000,
year_built = 2000,
business_type = "storage",
flagged = false,
security_level = "high",
access_restrictions = "authorized personnel only"
},
created_at = 1703125000,
updated_at = 1703125000,
flagged = false,
photos = {},
avatar = nil
}
SearchProperties
exports.wasabi_mdt:SearchProperties(query)
Searches properties by address, property type, property label, or owner name
query(string): Search term to match against property data
Example return data:
{
{
id = 1,
address = "123 Main Street",
property_type = "house",
property_label = "Residential House",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
coords = {
x = -265.5,
y = -957.2,
z = 31.2
},
metadata = {
bedrooms = 3,
bathrooms = 2,
square_feet = 1500,
year_built = 1995,
flagged = false
},
created_at = 1703123456,
updated_at = 1703123456,
flagged = false,
photos = {},
avatar = nil
},
{
id = 2,
address = "456 Oak Avenue",
property_type = "apartment",
property_label = "Apartment Complex",
owner_id = "citizen:7890121703124000",
owner_name = "Jane Smith",
coords = {
x = 200.0,
y = -800.0,
z = 30.0
},
metadata = {
unit_number = "4B",
bedrooms = 2,
bathrooms = 1,
square_feet = 900,
year_built = 2010,
flagged = true,
flagged_reason = "Previous drug activity"
},
created_at = 1703122000,
updated_at = 1703122000,
flagged = true,
photos = {},
avatar = nil
}
}
Vehicles
GetVehicle
exports.wasabi_mdt:GetVehicle(vehicleId)
Returns vehicle data for the specified vehicleId
vehicleId(number): The vehicle ID you wish to fetch from export
Example return data:
{
id = 1,
plate = "ABC123",
model = "adder",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
metadata = {
color = "red",
year = 2020,
vin = "1HGBH41JXMN109186",
insurance_status = "active",
registration_expiry = "2024-12-31",
flagged = false,
notes = "Well maintained vehicle"
},
created_at = 1703123456,
updated_at = 1703123456,
hasWarrants = false,
flagged = false,
photos = {
{
id = 1,
url = "https://example.com/photos/vehicle_1.jpg",
entity_type = "vehicle",
entity_id = "1",
uploaded_by = "char1:123456789",
uploaded_by_name = "Officer Johnson",
description = "Front view of vehicle",
created_at = 1703123456
}
},
avatar = nil,
vehicle_type = "car",
vehicle_type_label = "Car"
}
GetVehicleByPlate
exports.wasabi_mdt:GetVehicleByPlate(plate)
Returns vehicle data for the specified license plate
plate(string): The license plate number to search for
Example return data:
{
id = 2,
plate = "XYZ789",
model = "zentorno",
owner_id = "citizen:7890121703124000",
owner_name = "Jane Smith",
metadata = {
color = "blue",
year = 2019,
vin = "2HGBH41JXMN109187",
insurance_status = "expired",
registration_expiry = "2023-06-30",
flagged = true,
flagged_reason = "Multiple traffic violations"
},
created_at = 1703122000,
updated_at = 1703123000,
hasWarrants = false,
flagged = true,
photos = {},
avatar = nil,
vehicle_type = "car",
vehicle_type_label = "Car"
}
CreateVehicle
exports.wasabi_mdt:CreateVehicle(data)
Creates a new vehicle and returns the created vehicle object
data (table):
plate(string): License plate numbermodel(string): Vehicle model namevehicle_type(string, optional): Type of vehicle (defaults to "car")owner_id(string, optional): Citizen identifier of the vehicle ownermetadata(table, optional): Additional metadata
Example:
local vehicleData = {
plate = "DEF456",
model = "sultan",
vehicle_type = "car",
owner_id = "citizen:3456781703125000",
metadata = {
color = "white",
year = 2021,
vin = "3HGBH41JXMN109188",
insurance_status = "active",
registration_expiry = "2025-03-15",
flagged = false,
custom_modifications = "Tinted windows, aftermarket exhaust"
}
}
local newVehicle = exports.wasabi_mdt:CreateVehicle(vehicleData)
Example return data:
{
id = 3,
plate = "DEF456",
model = "sultan",
owner_id = "citizen:3456781703125000",
owner_name = "Mike Johnson",
metadata = {
color = "white",
year = 2021,
vin = "3HGBH41JXMN109188",
insurance_status = "active",
registration_expiry = "2025-03-15",
flagged = false,
custom_modifications = "Tinted windows, aftermarket exhaust"
},
created_at = 1703124000,
updated_at = 1703124000,
hasWarrants = false,
flagged = false,
photos = {},
avatar = nil,
vehicle_type = "car",
vehicle_type_label = "Car"
}
SearchVehicles
exports.wasabi_mdt:SearchVehicles(query)
Searches vehicles by plate, model, or owner name
query(string): Search term to match against vehicle data
Example return data:
{
{
id = 1,
plate = "ABC123",
model = "adder",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
metadata = {
color = "red",
year = 2020,
vin = "1HGBH41JXMN109186",
insurance_status = "active",
registration_expiry = "2024-12-31",
flagged = false
},
created_at = 1703123456,
updated_at = 1703123456,
hasWarrants = false,
flagged = false,
photos = {},
avatar = nil,
vehicle_type = "car",
vehicle_type_label = "Car"
},
{
id = 2,
plate = "XYZ789",
model = "zentorno",
owner_id = "citizen:7890121703124000",
owner_name = "Jane Smith",
metadata = {
color = "blue",
year = 2019,
vin = "2HGBH41JXMN109187",
insurance_status = "expired",
registration_expiry = "2023-06-30",
flagged = true,
flagged_reason = "Multiple traffic violations"
},
created_at = 1703122000,
updated_at = 1703123000,
hasWarrants = false,
flagged = true,
photos = {},
avatar = nil,
vehicle_type = "car",
vehicle_type_label = "Car"
}
}
Warrants
GetWarrant
exports.wasabi_mdt:GetWarrant(warrantId)
Returns warrant data for the specified warrantId
warrantId(number): The warrant ID you wish to fetch from export
Example return data:
{
id = 1,
title = "Search Warrant - Drug Investigation",
description = "Warrant issued for search of residence based on probable cause of drug activity. Suspect has been under surveillance for 2 weeks.",
citizen_id = "citizen:1234561703123456",
property_id = 1,
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "search",
probable_cause = "drug_activity",
surveillance_period = "2 weeks",
evidence_collected = false,
judge_approval = true,
expiration_date = "2024-01-15"
},
created_at = 1703123456,
updated_at = 1703123456,
served_at = nil,
citizen_name = "John Doe",
citizen_dob = "1990-05-15",
property_address = "123 Main Street",
linked_charges = {
{
charge = {
id = 1,
title = "Drug Possession",
description = "Possession of controlled substances",
jail_time = 60,
fine = 1000,
category = "felony"
},
metadata = {
link_type = "charge"
},
link_id = 1
}
},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
}
GetAllWarrants
exports.wasabi_mdt:GetAllWarrants()
Returns all warrants in the system
Example return data:
{
{
id = 1,
title = "Search Warrant - Drug Investigation",
description = "Warrant issued for search of residence based on probable cause of drug activity",
citizen_id = "citizen:1234561703123456",
property_id = 1,
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "search",
probable_cause = "drug_activity"
},
created_at = 1703123456,
updated_at = 1703123456,
served_at = nil,
citizen_name = "John Doe",
citizen_dob = "1990-05-15",
property_address = "123 Main Street",
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
},
{
id = 2,
title = "Arrest Warrant - Assault",
description = "Warrant for arrest of suspect involved in assault case",
citizen_id = "citizen:7890121703124000",
property_id = nil,
status = "served",
issued_by = "char1:987654321",
issued_by_name = "Detective Smith",
served_by = "char1:555666777",
served_by_name = "Officer Davis",
metadata = {
warrant_type = "arrest",
probable_cause = "assault",
victim_interviewed = true
},
created_at = 1703122000,
updated_at = 1703123000,
served_at = 1703123000,
citizen_name = "Jane Smith",
citizen_dob = "1985-08-22",
property_address = nil,
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
},
{
id = 3,
title = "Search Warrant - Property",
description = "Warrant to search business property for stolen goods",
citizen_id = "citizen:3456781703125000",
property_id = 3,
status = "cancelled",
issued_by = "char1:111222333",
issued_by_name = "Detective Brown",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "search",
probable_cause = "stolen_goods",
cancelled_reason = "Evidence insufficient"
},
created_at = 1703121000,
updated_at = 1703121500,
served_at = nil,
citizen_name = "Mike Johnson",
citizen_dob = "1992-12-03",
property_address = "789 Pine Street",
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
}
}
GetActiveWarrants
exports.wasabi_mdt:GetActiveWarrants()
Returns only active warrants (status = "active")
Example return data:
{
{
id = 1,
title = "Search Warrant - Drug Investigation",
description = "Warrant issued for search of residence based on probable cause of drug activity",
citizen_id = "citizen:1234561703123456",
property_id = 1,
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "search",
probable_cause = "drug_activity",
surveillance_period = "2 weeks",
evidence_collected = false,
judge_approval = true,
expiration_date = "2024-01-15"
},
created_at = 1703123456,
updated_at = 1703123456,
served_at = nil,
citizen_name = "John Doe",
citizen_dob = "1990-05-15",
property_address = "123 Main Street",
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
},
{
id = 4,
title = "Arrest Warrant - Robbery",
description = "Warrant for arrest of suspect in armed robbery case",
citizen_id = "citizen:111222333444555",
property_id = nil,
status = "active",
issued_by = "char1:444555666",
issued_by_name = "Officer Wilson",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "arrest",
probable_cause = "armed_robbery",
victim_identified = true,
weapon_involved = true
},
created_at = 1703125000,
updated_at = 1703125000,
served_at = nil,
citizen_name = "Robert Wilson",
citizen_dob = "1988-03-10",
property_address = nil,
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
}
}
GetWarrantsByCitizen
exports.wasabi_mdt:GetWarrantsByCitizen(citizenId)
Returns warrants associated with the specified citizen
- citizenId (string): The citizen identifier to filter warrants by
Example return data:
{
{
id = 1,
title = "Search Warrant - Drug Investigation",
description = "Warrant issued for search of residence based on probable cause of drug activity",
citizen_id = "citizen:1234561703123456",
property_id = 1,
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "search",
probable_cause = "drug_activity"
},
created_at = 1703123456,
updated_at = 1703123456,
served_at = nil,
citizen_name = "John Doe",
citizen_dob = "1990-05-15",
property_address = "123 Main Street",
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
},
{
id = 5,
title = "Arrest Warrant - Traffic Violations",
description = "Warrant for arrest due to multiple unpaid traffic violations",
citizen_id = "citizen:1234561703123456",
property_id = nil,
status = "served",
issued_by = "char1:777888999",
issued_by_name = "Officer Martinez",
served_by = "char1:123456789",
served_by_name = "Officer Johnson",
metadata = {
warrant_type = "arrest",
probable_cause = "traffic_violations",
violations_count = 5,
total_fines = 2500
},
created_at = 1703120000,
updated_at = 1703124000,
served_at = 1703124000,
citizen_name = "John Doe",
citizen_dob = "1990-05-15",
property_address = nil,
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
}
}
CreateWarrant
exports.wasabi_mdt:CreateWarrant(data)
Creates a new warrant and returns the created warrant object
data (table):
title(string): Warrant titledescription(string): Warrant descriptioncitizen_id(string): Citizen identifier the warrant is issued forproperty_id(number, optional): Property ID if warrant is for a specific propertystatus(string, optional): Warrant status (defaults to "active"), options of "active", "served", and "cancelled"issued_by(string, optional): Officer identifier who issued the warrant (defaults to "system")issued_by_name(string, optional): Officer name (defaults to "System")metadata(table, optional): Additional metadata
Example:
local warrantData = {
title = "Arrest Warrant - Burglary",
description = "Warrant for arrest of suspect involved in residential burglary. Suspect identified through surveillance footage.",
citizen_id = "citizen:555666777888999",
metadata = {
warrant_type = "arrest",
probable_cause = "burglary",
surveillance_evidence = true,
victim_interviewed = true,
stolen_items_value = 5000,
judge_approval = true
},
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson"
}
local newWarrant = exports.wasabi_mdt:CreateWarrant(warrantData)
Example return data:
{
id = 6,
title = "Arrest Warrant - Burglary",
description = "Warrant for arrest of suspect involved in residential burglary. Suspect identified through surveillance footage.",
citizen_id = "citizen:555666777888999",
property_id = nil,
status = "active",
issued_by = "char1:123456789",
issued_by_name = "Officer Johnson",
served_by = nil,
served_by_name = nil,
metadata = {
warrant_type = "arrest",
probable_cause = "burglary",
surveillance_evidence = true,
victim_interviewed = true,
stolen_items_value = 5000,
judge_approval = true
},
created_at = 1703126000,
updated_at = 1703126000,
served_at = nil,
citizen_name = "Alice Brown",
citizen_dob = "1995-07-20",
property_address = nil,
linked_charges = {},
linked_citizens = {},
linked_properties = {},
linked_officers = {}
}
Weapons
GetWeapon
exports.wasabi_mdt:GetWeapon(weaponId)
Returns weapon data for the specified weaponId
weaponId(number): The weapon ID you wish to fetch from export
Example return data:
{
id = 1,
serial_number = "AB-12345678",
weapon_type = "pistol",
weapon_label = "Pistol",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
metadata = {
caliber = "9mm",
manufacturer = "Glock",
model = "G17",
condition = "excellent",
purchase_date = "2023-01-15",
registration_status = "registered",
flagged = false,
notes = "Legally owned firearm"
},
created_at = 1703123456,
updated_at = 1703123456,
flagged = false
}
GetWeaponBySerial
exports.wasabi_mdt:GetWeaponBySerial(serial)
Returns weapon data for the specified serial number
- serial (string): The weapon serial number to search for
Example return data:
{
id = 2,
serial_number = "CD-87654321",
weapon_type = "rifle",
weapon_label = "Assault Rifle",
owner_id = "citizen:7890121703124000",
owner_name = "Jane Smith",
metadata = {
caliber = "5.56mm",
manufacturer = "Colt",
model = "AR-15",
condition = "good",
purchase_date = "2022-08-20",
registration_status = "registered",
flagged = true,
flagged_reason = "Used in crime",
notes = "Weapon involved in previous incident"
},
created_at = 1703122000,
updated_at = 1703123000,
flagged = true
}
CreateWeapon
exports.wasabi_mdt:CreateWeapon(data)
Creates a new weapon and returns the created weapon object
data (table):
weapon_type(string): Type of weapon (e.g., "pistol", "rifle", "shotgun")serial_number(string, optional): Weapon serial number (auto-generated if not provided)owner_id(string, optional): Citizen identifier of the weapon ownermetadata(table, optional): Additional metadata
Example:
local weaponData = {
weapon_type = "shotgun",
serial_number = "EF-11223344",
owner_id = "citizen:3456781703125000",
metadata = {
caliber = "12 gauge",
manufacturer = "Remington",
model = "870",
condition = "good",
purchase_date = "2023-05-10",
registration_status = "registered",
flagged = false,
barrel_length = "18 inches",
capacity = "5 rounds"
}
}
local newWeapon = exports.wasabi_mdt:CreateWeapon(weaponData)
Example return data:
{
id = 3,
serial_number = "EF-11223344",
weapon_type = "shotgun",
weapon_label = "Shotgun",
owner_id = "citizen:3456781703125000",
owner_name = "Mike Johnson",
metadata = {
caliber = "12 gauge",
manufacturer = "Remington",
model = "870",
condition = "good",
purchase_date = "2023-05-10",
registration_status = "registered",
flagged = false,
barrel_length = "18 inches",
capacity = "5 rounds"
},
created_at = 1703124000,
updated_at = 1703124000,
flagged = false
}
SearchWeapons
exports.wasabi_mdt:SearchWeapons(query)
Searches weapons by serial number, weapon type, weapon label, or owner name
query(string): Search term to match against weapon data
Example return data:
{
{
id = 1,
serial_number = "AB-12345678",
weapon_type = "pistol",
weapon_label = "Pistol",
owner_id = "citizen:1234561703123456",
owner_name = "John Doe",
metadata = {
caliber = "9mm",
manufacturer = "Glock",
model = "G17",
condition = "excellent",
purchase_date = "2023-01-15",
registration_status = "registered",
flagged = false
},
created_at = 1703123456,
updated_at = 1703123456,
flagged = false
},
{
id = 2,
serial_number = "CD-87654321",
weapon_type = "rifle",
weapon_label = "Assault Rifle",
owner_id = "citizen:7890121703124000",
owner_name = "Jane Smith",
metadata = {
caliber = "5.56mm",
manufacturer = "Colt",
model = "AR-15",
condition = "good",
purchase_date = "2022-08-20",
registration_status = "registered",
flagged = true,
flagged_reason = "Used in crime"
},
created_at = 1703122000,
updated_at = 1703123000,
flagged = true
}
}
Utility
IsOfficer
exports.wasabi_mdt:IsOfficer(identifier)
Checks if the given identifier belongs to an officer with MDT access
identifier(string): The player identifier to check (e.g., 'char1:abc123')
Returns true if player is an officer with MDT access or false if not
HasPermission
exports.wasabi_mdt:HasPermission(identifier, permission)
Checks if the given identifier has a specific permission
identifier(string): The player identifier to check (e.g., 'char1:abc123')permission(string): The permission to check (e.g., 'mdt.citizens.create', 'mdt.charges.edit')
Returns true if player has the specified permission or else false
GetOfficers
exports.wasabi_mdt:GetOfficers()
Returns all officers currently in the system
Example return data:
{
["char1:abc123"] = {
identifier = "char1:abc123",
name = "John Doe",
department = "police",
job = "Police Officer",
gradeLabel = "Officer",
grade = 0,
callsign = "1A-12",
location = "Mission Row Police Station",
arrests = 5,
citations = 12,
reports = 8,
convictionRate = 85.5,
onDuty = true,
onDutySince = 1703123456
},
["char2:def456"] = {
identifier = "char2:def456",
name = "Jane Smith",
department = "police",
job = "Police Officer",
gradeLabel = "Senior Officer",
grade = 1,
callsign = "2B-15",
location = "Vespucci Police Station",
arrests = 12,
citations = 25,
reports = 15,
convictionRate = 92.3,
onDuty = false,
onDutySince = nil
}
}
GetDepartmentOfficers
exports.wasabi_mdt:GetDepartmentOfficers(department)
Returns all officers from a specific department
department(string): The department name to filter by (e.g., 'police', 'lssd', 'sasp')
Example return data:
{
["char1:abc123"] = {
identifier = "char1:abc123",
name = "John Doe",
department = "police",
job = "Police Officer",
gradeLabel = "Officer",
grade = 0,
callsign = "1A-12",
location = "Mission Row Police Station",
arrests = 5,
citations = 12,
reports = 8,
convictionRate = 85.5,
onDuty = true,
onDutySince = 1703123456
},
["char3:ghi789"] = {
identifier = "char3:ghi789",
name = "Mike Johnson",
department = "police",
job = "Police Officer",
gradeLabel = "Detective",
grade = 2,
callsign = "3C-08",
location = "Davis Police Station",
arrests = 8,
citations = 18,
reports = 12,
convictionRate = 88.7,
onDuty = true,
onDutySince = 1703120000
}
}
RefreshOfficers
exports.wasabi_mdt:RefreshOfficers()
Refreshes officer locations and updates their status