Skip to main content
The MDT supports ESX, QBCore, and Qbox out of the box. For anything else, write an adapter: a set of functions that tell the MDT how to read your players, jobs, characters, and vehicles.

Setup

1

Copy the standalone adapter

Copy the standalone folders and name them custom. Copy qb-core or esx instead if your framework is based on one.
2

Rename the provider

Change 'standalone' to 'custom' in the first lines of core.lua, players.lua, and vehicles.lua:
3

Select it

config/config.lua
4

Fill in the functions

Replace each function body with calls to your framework. Each function below shows what it must return.
A function you leave out of players.lua or vehicles.lua counts as unsupported. The MDT treats it as an empty result and, with Config.Debug = true, warns once. You can build the adapter step by step.

Players

File: core.lua.

GetOnlineSources

Returns the server ids of every loaded player.

GetPlayerIdentifier

Returns the character’s unique identifier, such as a citizen id. Returns nil if not loaded. If the identifier isn’t readable (like license:abc...), set Bridge.Framework.ReadableIdentifier = false. The MDT then shows the birthdate instead.

GetSourceFromIdentifier

Returns the server id of an online character, or nil if offline.

GetCharacterName

Returns the first name and last name.

GetPlayerData

Returns your framework’s player object, or nil if not loaded.

HasGroup

Optional.
Returns true if the player is in any of groups. Used for Config.AdminGroups. Without it, the MDT checks the ACE in Config.AdminAce.

Jobs and duty

File: core.lua.

GetJobs

Returns every job, keyed by name. Grades are labels keyed by the level as a string:

GetJobInfo

Returns one job in the same shape as GetJobs, or nil.

GetPlayerJob

Returns the online player’s job, or nil.

GetPlayerJobByIdentifier

Same as GetPlayerJob, but works for offline characters.

SetPlayerJob

Sets the character’s job. Returns true on success. Must work for offline characters.

GetJobPlayers

Returns the server ids of online players with job, and their count. With checkOnDuty, only those on duty.

GetPlayerDuty

Returns true if the player is on duty.

SetPlayerDuty

Sets duty. Returns true on success.

Callsign and badge

File: core.lua. Store these wherever your framework keeps character metadata.

GetPlayerMetadata

Returns the stored value for key, or nil.

SetPlayerMetadata

Stores a value. Returns true on success.

GetPlayerCallsign

Returns the online player’s callsign, or nil.

SetPlayerCallsign

Saves the callsign. Returns true on success.

SetPlayerBadge

Saves the badge number. Returns true on success.

Money

File: core.lua. type is the account name, such as 'cash' or 'bank'.

GetMoney

Returns the balance, or 0.

AddMoney

Returns true if the money was added.

RemoveMoney

Returns true if the money was removed. Must work for offline characters. With allowDebt, the balance may go negative.

GetBankAccount

Optional. Needed for Config.ShowCitizenBank.
Returns the account number and balance, or nil.

Items and weapons

File: core.lua.

CreateUseableItem

Registers a usable item, such as the tablet. Returns nothing.

GetItems

Returns every item, for the item pickers in the Admin panel.

GetWeapons

Returns the weapons officers can register.

GetWeaponLabel

Optional.
Returns a weapon’s label from its hash, for dispatch calls.

VehicleModels

Optional. A table of vehicle models keyed by spawn name, like QBCore.Shared.Vehicles. The MDT uses it for vehicle names and classes.

Characters

File: players.lua. These feed the Citizens page and the department pages. Every character is described with this shape. Only identifier is required.

GetIdentities

Always implement this one. Officers’ names come from it.
Returns a character for each identifier, keyed by identifier. Leave out characters that don’t exist.

SearchCitizens

Used when Config.AutoPopulateData = true.
Returns one page of characters and the total that match, ignoring offset and limit. If known_total is set, return it as total and skip counting. Match query against names and identifiers that start with it, or a phone number or fingerprint equal to it. request.sql holds ready-made SQL fragments for the MDT’s own filters and record counts. See the comments in players.lua for every field.

GetCapabilities

Returns which optional fields your characters have. nationality = false hides the nationality field and filter.

FindByPhoneNumbers

Returns the owner’s identifier for each phone number, keyed by number. Leave out unknown numbers.

GetNameMatchQuery

Returns a SELECT of one column: identifiers of characters whose name starts with query. Return nil if your data isn’t in SQL.

SetImage

Saves the character’s MDT photo. url = '' clears it. Returns false only if the character doesn’t exist. Return the photo as image in GetIdentities.

Job members

File: players.lua. These feed the roster, employees, and analytics pages. A job member is any character with that job, online or not.

ListJobMembers

Returns one page of members and the total that match. Fill name, image, callsign, badge, phone_number, grade, and last_seen. Without it, the roster lists only online officers.

GetJobMembersQuery

Returns a SELECT of one column named identifier: every member of job. Return nil if your data isn’t in SQL.

CountJobMembers

Returns the headcount, in total and per grade level:

GetCallsigns

Returns the stored callsign of every member of jobs, keyed by identifier. Used to keep callsigns unique.

IsBadgeTaken

Returns true if another member of job already has badge. Ignore the character except.

Vehicles

File: vehicles.lua. These feed the Vehicles page. Every vehicle is described with this shape:

IsAvailable

Returns true if this adapter reads real vehicles. Return false to use only vehicles officers register in the MDT.

SearchVehicles

Used when Config.AutoPopulateData = true.
Returns one page of vehicles (plate, model, owner_identifier, impounded) and the total that match. See the comments in vehicles.lua for every field.

GetVehicle

Returns one vehicle, or nil if no vehicle has this plate.

GetVehicles

Returns a vehicle for each plate, keyed by plate. Skip colors when with_color is false.

GetOwnedVehicles

Returns the vehicles a character owns, at most limit.

GetOwner

Returns the owner’s identifier, or nil. Called on every radar hit, so keep it fast.

GetOwnersQuery

Returns a SELECT of every identifier that owns a vehicle, such as SELECT DISTINCT owner FROM owned_vehicles. Return nil to hide the “owns a vehicle” filter.

GetImpoundedQuery

Returns a SELECT of every impounded plate, such as SELECT plate FROM owned_vehicles WHERE stored = 2. Return nil if your data isn’t in SQL.

SetImage

Saves the vehicle’s photo. url = '' clears it. Returns false only if the vehicle doesn’t exist.

Events

Trigger these from your framework’s events so the MDT stays in sync:
server/custom/framework/custom/core.lua
Also trigger player-unloaded on playerDropped.