Installation Guide
Follow these verified steps for a complete, zero-friction integration of XR-MDT, natively engineered for your framework.1. βοΈ Prerequisites
You must have the following resources running before starting XR-MDT:| Dependency | Required | Notes |
|---|---|---|
oxmysql | β Yes | All database operations use MySQL.query.await / MySQL.insert.await etc. |
ox_lib | β Yes | Used for callbacks (lib.callback), notifications, and menus. |
qb-core / es_extended / qbx_core | β One of these | Your selected Framework Core. |
[!NOTE] Thefxmanifest.luaalso uses@ox_lib/init.luaas a shared script. Make sureox_libis started beforexr-mdtin yourserver.cfg.
2. π¦ Core Setup
- Download: Grab the latest
xr-mdtrelease from your Keymaster portal. - Extract: Unarchive directly into your serverβs
resources/folder. - Database Setup: Import the SQL file from the
INSTALL/folder into your database. The following tables are required:
mdt_logsβ Central audit log storagemdt_settingsβ Global MDT settings
lspd_reportsβ Police incident reportslspd_citizen_dataβ Mugshots and citizen MDT datalspd_convictionsβ Criminal conviction recordslspd_licensesβ Driver/weapon license trackinglspd_warrantsβ Active warrantslspd_incidentsβ Incident records
ems_citizen_dataβ Patient recordsems_medical_recordsβ Medical history
doj_casesβ Court case records
mdt_business_dataβ Business panel data
mdt_armory_kitsβ Weapon kit templatesmdt_armory_stockβ Current armory stock
[!IMPORTANT]
XR-MDT automatically validates all required tables on every resource start and prints missing tables to the server console. If any table is missing, you will see a ^1INCOMPLETE^7 status in the splash screen.
- Initial Boot: Add
ensure xr-mdtinto yourserver.cfg. Ensure it is placed afterox_liband your framework core.
3. π― Integration Guidelines by Framework
π΅ QB-Core & Qbox Core
- Framework is auto-detected. XR-MDT checks for
qbx_corefirst, thenqb-core. - Charinfo (firstname, lastname, phone) is read from
PlayerData.charinfo. - The citizen unique identifier used is
PlayerData.citizenid.
[!TIP] For Qbox (qbx_core), the bridge usesexports.qbx_core:GetPlayer(source)β this is handled automatically.
π’ ESX Legacy (Latest)
ESX relies on theusers table. XR-MDT requires two additional columns for full functionality.
Required Column Migration
Apply the following SQL if you are using ESX:
[!IMPORTANT]
If these columns are missing, XR-MDT will print an error to the console on every player load. Import INSTALL/database_esx.sql for a complete schema.
On startup, XR-MDT automatically populates ssn for any users who do not have one yet.
Vehicle Identification Requirements
For ESX vehicle tracking in the MDT, theowned_vehicles table also needs these columns:
Synchronizing Phone Numbers
If your phone script stores the phone number under a different column name, update this inconfig.main.lua:
4. π± Item Schemas
XR-MDT uses the following item names (configurable inConfig.Items in config.main.lua):
| Item Name | Default Key | Purpose |
|---|---|---|
tablet | Config.Items.tablet | Opens the MDT |
bodycam | Config.Items.bodycam | Toggles bodycam |
gps | Config.Items.gps | Toggles GPS tracker |
document | Config.Items.document | Views a printed document |
tracking_band | Config.Items.tracking_band | Toggles ankle tracking band |
data/items.lua)
[!TIP] For2. QB-Core (document, theclient = { export = 'xr-mdt.document' }syntax ensures the item opens on the client side via the client export. This is the recommended approach forox_inventory.
shared/items.lua)
[!TIP] IfConfig.InventoryAutoRegister = trueis set inconfig.main.lua, XR-MDT automatically registers all usable items usingBridge.RegisterUsableItem. No extra code needed in your inventory script (except fortabletβ see below).
5. π₯οΈ Tablet Item Registration
Thetablet item is not auto-registered via the item loop. Instead, it is opened by a server-side event triggered by the client command/keybind.
If you want players to open the MDT by using the tablet item from their inventory (instead of the /mdt command), register it manually in your inventory:
6. π° Finance & Account Sync
XR-MDT supports most banking resources by resolving them automatically viaBridge.Bank in editable/server/main.lua.
Auto-detected banking resources (in order of priority):
Renewed-Bankingβexports['Renewed-Banking']:getAccountMoney(accountName)xr-bankβexports['xr-bank']:GetAccountBalance(accountName)qbx_managementβexports['qbx_management']:GetAccount(accountName).amountqb-bankingβexports['qb-banking']:GetAccountBalance(accountName)qb-managementβTriggerEvent('qb-management:server:GetAccount', ...)esx_addonaccountβ Society accounts viaGetSharedAccount(society)
[!NOTE]
All banking transactions (fines, bills, bonuses) are automatically recorded in the bank_statements table when using the Bridge methods.
To use a completely custom banking resource, override the Bridge.Bank functions in editable/server/main.lua:
