Installation
The pre-installation notes, system requirements, installation steps and configuration setup.
Important Pre-Installation Notes
Section titled “Important Pre-Installation Notes”Emergency Response Simulator Compatible: It is possible to search NPCs and their vehicles in the MDT when they have been interacted with via the Emergency Response Simulator.
System Requirements & Compatibility
Section titled “System Requirements & Compatibility”OneSync Compatibility
Section titled “OneSync Compatibility”- OneSync Legacy: Fully tested and compatible
- OneSync Infinity: Fully tested and compatible
Framework Compatibility
Section titled “Framework Compatibility”-
Standalone: If no supported framework resource is running, the MDT runs in standalone mode: no automatic civilian generation from characters (players use council registration / staff workflows as you configure).
-
Auto civilian generation (framework bridge): When a supported framework is detected and started before or with the MDT, the resource syncs each loaded character into
nsmdt_civilians(create or update by framework id). Supported stacks (detection order on the server):Framework Resource / API Character id used for sync ESX es_extendedidentifierQBox qbx_core(GetPlayer)citizenidQBCore qb-corecitizenidOn first sync, a council-style personal id (e.g.
CIV-…) can be issued; identity documents may be auto-generated when your document types and council rules allow (see server logs for[MDT Framework]). Existing civilians are updated on subsequent loads (name, job, phone, etc., per bridge data). -
Framework fines: Optional bank/cash deduction for council fines when a framework player pays—configure
Config.FrameworkFineAccountinconfig.lua(ESX/QBCore/QBox). -
Custom banking (standalone): If you run a standalone server with your own banking resource (or want to override one specific operation on a framework server), the banking bridge exposes a
BankingBridge.Customslot you can plug into. Council fines, balance reads and any future money-moving feature will then go through your code instead of (or in addition to) the framework path. See Custom Banking Bridge below.
Dependencies
Section titled “Dependencies”- MySQL Database - Required for data storage
- oxmysql - Required database API
Installation Process
Section titled “Installation Process”Step 1: Database Setup (Required)
Section titled “Step 1: Database Setup (Required)”We assume you have a database for your FiveM server. If you do not have one, contact your hosting providers’ documentation on how to get and build one. This is a dependency for Night Shifts MDT to work.
- Set up your database via your hosting provider
- Connect to your database using credentials in an SQL connection string
- Add to server.cfg above the ensure/start of resources:
set mysql_connection_string "user=Your_Database_Username;password=Your_Database_Password;host=Your_Database_Host;port=3306;database=Your_Database_Name;charset=utf8mb4_general_ci"- Automatic Table Installation - When you boot up the server, the code will run queries to install required tables
Step 2: Install oxmysql (Required)
Section titled “Step 2: Install oxmysql (Required)”If you don’t have oxmysql installed, download it from: Download oxmysql
- Place oxmysql into your resources folder
- Add to server.cfg - Ensure it starts before Night Shifts MDT:
ensure oxmysqlStep 3: Test Database Connection
Section titled “Step 3: Test Database Connection”Start your server and check the console for oxmysql connection messages. You should see:
[script:oxmysql] Database server connection established!Step 4: Postal codes (optional — auto-detect)
Section titled “Step 4: Postal codes (optional — auto-detect)”Night Shifts MDT does not require a specific postal resource name. It auto-detects which postal / map data is available on your server and uses it for player and world lookups (dispatch, addresses, etc.).
How it works
- HUD-first (player position) — If a supported HUD exposes postal for the local player, that is preferred:
rhud(get_postal), thenSimpleHUD/ModernHUD(getPostal), in that order. - World coordinates — For map pins and coordinates, the MDT tries
rhudworld APIs first, then hinted postal resources in order:mnr_postals,nearest-postal. - Multiple formats — The same hints are probed for several backends: JSON lists referenced by the resource
postal_filemanifest metadata, MNR-style Lua data (config + data files), export-based nearest-postal (getNearestPostal,getPostalAtCoords, etc.), and similar. You can ship different postal file packs (or forks of nearest-postal / MNR) as long as the resource exposes one of these patterns; the MDT picks the first working match at runtime. - Dependencies of postal resources — Some MNR builds need
ox_librunning. Install what your chosen postal resource documents.
You typically ensure your postal / map stack before Night Shifts MDT in server.cfg, for example:
ensure ox_libensure nearest-postal# or: ensure mnr_postals# plus any minimap / postal overlay resource you useStep 5: Install Night Shifts MDT
Section titled “Step 5: Install Night Shifts MDT”- Download from CFX Portal Assets
- Extract and transfer using binary FTP mode
- Place the resource folder into your
resourcesdirectory — keep the original folder name (night_shifts_mdt) as shipped; do not rename it. - Add to server.cfg:
ensure night_shifts_mdt- Verify startup — Check console for oxmysql and
night_shifts_mdtstarting without errors
Configuration Setup
Section titled “Configuration Setup”Required Tools
Section titled “Required Tools”Configuration Files
Section titled “Configuration Files”Paths below use night_shifts_mdt as the resource folder name—use the same name you deploy and ensure in server.cfg (some installs rename the folder; paths are always relative to that folder).
| Path | Purpose |
|---|---|
night_shifts_mdt/config/config.lua |
Main config — tablet prop/animations, ERS link (Enable_ERS), framework fine account, hotkeys, civilian emergency call, Show ID, initial super-admins, and other core toggles. |
night_shifts_mdt/config/config_anpr.lua |
ANPR — static cameras, patrol HUD scan settings, officer watchlist expiry, patrol-registry-only mode, and NpcRegistryScopedToModel (NPC auto-flags scoped to plate + vehicle model) |
night_shifts_mdt/config/config_npc_pool.lua |
ERS NPC pool — fictive NPC identities and vehicle-record probabilities for Emergency Response Simulator / PNC integration |
night_shifts_mdt/config/translations/<locale>.lua |
Languages — one file per locale (e.g. en.lua, de.lua, fr.lua, …) |
Optional files some servers customize:
| Path | Purpose |
|---|---|
night_shifts_mdt/client/c_functions.lua |
Client helpers (e.g. postal auto-detect, shared utilities) |
night_shifts_mdt/server/s_functions.lua |
Server helpers, Discord webhook implementation, and the optional Custom Banking Bridge preset |
Configuration Process
Section titled “Configuration Process”- Open VS Code and navigate to the config files
- Read thoroughly - each line has explanatory comments
- Configure in order - work from top to bottom
- Watch for notes - important warnings are clearly marked
- Test frequently - use F8 console and server console for error checking