Installation
-
Install the dependencies
koja-mdt needs these resources started before it:oxmysql- your framework (
es_extended,qb-coreorqbx_core) koja-lib
screenshot-basicfor photo upload and selfies, and an inventory if you want item based features. -
Add the resource
Use the release zip. It contains the built interface inweb/build. Put thekoja-mdtfolder in your resources directory. -
Edit server.cfg
Ensure koja-mdt after its dependencies:The manifest declaresserver.cfgensure oxmysql ensure es_extended # or qb-core / qbx_core ensure koja-lib ensure screenshot-basic # optional ensure koja-mdtoxmysqlandkoja-libas dependencies, so the resource will not start without them. To keep bodycam footage and images on Cloudflare R2, S3 or Fivemanage instead of the server disk, add the storage keys toserver.cfgwithset(never inshared/config.lua). See Storage and CDN. -
Database
Nothing to import by hand in a normal install. On every start the resource readskoja-mdt.sqland runs it statement by statement. Every statement isCREATE TABLE IF NOT EXISTS, so restarts are safe. Columns added in later versions are added automatically withALTER TABLEwhen missing.
The penal code fromFile What it is koja-mdt.sqlAll tables. Run automatically at start. sql/custody.sql,sql/divisions.sql,sql/admin.sql,sql/web.sqlThe same module tables, run again by their own modules at start. Safe to ignore. sql/mail.sql,sql/forms.sqlCopies of the mail and forms tables, also contained in koja-mdt.sql. Safe to ignore.sql/jobs_fire.sqlOptional and not run automatically. ESX only: adds a firejob with grades to thejobsandjob_gradestables if it does not exist yet. Import it yourself if you want a ready LSFD job.shared/penalcode.luais seeded into the database on first start. After that, charges are edited in game. See Database for the table list. -
Add inventory items (optional)
Items are only needed for the features below. If you do not use them, skip this step.
Item names come from the config. Use the same names in your inventory.Item Config Used for mdt_tabletConfig.Open.itemOpening the MDT by using the item. Set Config.Open.requireItem = trueto make the item mandatory.citationConfig.Citations.itemPrinted traffic citations. Using it shows the paper. mdt_documentConfig.Forms.itemA signed form document. Using it shows the document. bodycamConfig.Bodycams.itemBody camera. Only required when Config.Bodycams.requireItem = true.Add to
ox_inventory/data/items.lua. Items are made usable through koja-lib:ox_inventory/data/items.lua['mdt_tablet'] = { label = 'MDT Tablet', weight = 500, stack = false, close = true, server = { export = 'koja-lib.useItem' }, }, ['citation'] = { label = 'Citation', weight = 10, stack = false, close = true, consume = 0, description = 'A printed traffic citation.', server = { export = 'koja-lib.useItem' }, }, ['mdt_document'] = { label = 'Document', weight = 10, stack = false, close = true, consume = 0, description = 'A signed MDT document.', server = { export = 'koja-lib.useItem' }, }, ['bodycam'] = { label = 'Body camera', weight = 150, stack = false, close = true, consume = 0, server = { export = 'koja-lib.useItem' }, },stack = falsekeeps each citation separate with its own metadata.consume = 0means using the item does not remove it. Thecitationentry is the one from the official citations guide; the other three follow the same pattern.Copy
docs/citation.pnganddocs/mdt_document.pngintoox_inventory/web/images/.Add to
qb-core/shared/items.lua:qb-core/shared/items.luamdt_tablet = { name = 'mdt_tablet', label = 'MDT Tablet', weight = 500, type = 'item', image = 'mdt_tablet.png', unique = true, useable = true, shouldClose = true, description = 'Mobile data terminal.' }, citation = { name = 'citation', label = 'Citation', weight = 10, type = 'item', image = 'citation.png', unique = true, useable = true, shouldClose = true, description = 'A printed traffic citation.' }, mdt_document = { name = 'mdt_document', label = 'Document', weight = 10, type = 'item', image = 'mdt_document.png', unique = true, useable = true, shouldClose = true, description = 'A signed MDT document.' }, bodycam = { name = 'bodycam', label = 'Body camera', weight = 150, type = 'item', image = 'bodycam.png', unique = true, useable = true, shouldClose = true, description = 'Department-issued body camera.' },INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('mdt_tablet', 'MDT Tablet', 1, 0, 1), ('citation', 'Citation', 1, 0, 1), ('mdt_document', 'Document', 1, 0, 1), ('bodycam', 'Body camera', 1, 0, 1);If your inventory does not store item metadata, using a
citationopens the latest citation written to that player.Nothing to do. When
koja_grid_inventoryis started andConfig.Inventory.systemis'auto', koja-mdt registerscitation,mdt_documentandbodycamitself fromConfig.Inventory.items(size, weight, image). SetConfig.Inventory.registerItems = falseto register them yourself, orConfig.Inventory.system = 'framework'to use the framework inventory instead. -
Set ace permissions
Two optional aces are used. Add them toserver.cfgfor your admins:server.cfgadd_ace group.admin koja-mdt.admin allow add_ace group.admin koja-mdt.debug allow add_ace group.admin koja-mdt.cameras allow add_principal identifier.license:xxxxxxxxxxxxxxxx group.adminAce Config Grants koja-mdt.adminConfig.Admin.aceFull access to the Admin panel, even without an MDT rank. By default the generic commandace also works (Config.Admin.allowCommandAce).koja-mdt.debugConfig.DebugTools.acesThe /mdtdebugdemo and test commands. See Demo mode. The genericcommandace also works.koja-mdt.camerasConfig.Cameras.adminAcePlacing and editing CCTV cameras. -
Map your jobs to departments
Openshared/departments.luaand make sure thejobsof each department match the job names on your server. A framework job that is not listed in any department has no MDT access. See Departments and permissions. -
Restart and check the console
Start the server. The console prints a startup banner with the detected framework, jail, inventory, radial and target integrations. If a line saysnonefor something you use, check that the resource is started beforekoja-mdtor set the option explicitly. See Integrations.
First-run checklist
- Server starts without SQL errors in the console.
-
koja-lib,oxmysqland your framework are started beforekoja-mdt. - Your job names are listed in
shared/departments.lua. - Set
Config.Localeto your server language. See Translations. - Join with a police job and press F6 or type
/mdt. The tablet opens. - Go on duty from the dashboard or with
/mdtduty. - Search a citizen and a plate to check the framework bridge returns data.
- Write a test report and process a suspect to check fine and jail. See
Config.Processingin Configuration. - If you use the tablet item,
Config.Open.requireItemmatches your inventory setup. - If you want photos,
Config.Camera.uploadUrlis set andscreenshot-basicis started. - Type
/mdtweband open the address to check the web portal. - Before going live: decide whether the demo tools stay on (
Config.DebugTools.enabled) and who has the admin aces.