Night Shifts - Mobile Data Terminal for FiveM
A guide to install Night Shifts - Mobile Data Terminal for FiveM
📋 Table of Contents
- 🎯 Overview
- 🛒 Purchase Information
- ⚠️ Important Pre-Installation Notes
- 🔧 System Requirements & Compatibility
- 📦 Installation Process
- ⚙️ Configuration Setup
- 🎮 How It Works
- 🔗 Integration & Compatibility
- 📊 Exports
- 🛠️ Troubleshooting
- 💡 Best Practices
- 🆘 Support
🎯 Overview
EARLY ACCESS - This script is in early access. Help us out and report any bugs you find! We are planning on releasing a BETA version around SUMMER/FALL 2025.
Welcome to Night Shifts - MDT, a customizable MDT system for your community. Whether you’re running a police, fire, or EMS department, Night Shifts provides a range of features to help you manage your operations. Our MDT is configurable to fit the needs of emergency services in any country.
Key Features
- ✅ Customizable MDT System - Adapt to any country’s emergency services
- ✅ Multi-Department Support - Police, Fire, EMS, and Civilian departments
- ✅ Emergency Services Hotline - 999/911/112 emergency call system
- ✅ Police National Computer (PNC) - Person, vehicle, and record searches
- ✅ Civilian Registry - Council/City Hall civilian management
- ✅ Vehicle Registry - DVLA/DMV vehicle management
- ✅ Shift Management - Department, sub-department, and status tracking
- ✅ Unit Overview - Control and dispatch functionality
- ✅ Report System - Create and manage police, fire, and ambulance reports
- ✅ Statistics Tracking - Department performance monitoring
- ✅ ANPR Integration - Automatic Number Plate Recognition
- ✅ Emergency Response Simulator Compatible - Search NPCs and vehicles
- ✅ Discord Integration - Role-based access control
- ✅ Multi-Language Support - International server support
- ✅ Escrow Protection - Secure resource protection
🛒 Purchase Information
Get Night Shifts MDT:
Purchase on Nights Software Store
⚠️ Important Pre-Installation Notes
Critical Installation Order: Always follow this exact sequence to avoid parsing errors in the F8 console:
- Download ZIP Package from CFX Portal
- Unpack in a folder on your local machine
- Set File Transfer Protocol (FTP) type to binary
- Drag files from local machine to server resources folder
- Add to server.cfg (ensure script)
- Boot up the server
Support Policy: Follow this guide step by step. If you’re stuck, ask for support in our Discord and provide the specific step name. Do not skip steps.
Database Requirement: Night Shifts MDT requires a MySQL database and oxmysql resource to function properly.
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
OneSync Compatibility
- ✅ OneSync Legacy: Fully tested and compatible
- ✅ OneSync Infinity: Fully tested and compatible
Framework Compatibility
- ✅ Standalone: Works without any framework and is not made to integrate with QBCore/ESX. This will change in the future.
Dependencies
- ✅ MySQL Database - Required for data storage
- ✅ oxmysql - Required database API
- ✅ Night Discord API - Required for permissions (included)
Note: Night Shifts MDT works seamlessly with all major FiveM frameworks and requires proper database setup.
📦 Installation Process
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"
Localhost Example:
set mysql_connection_string "user=root;password=;host=localhost;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
Manual Installation: The files include a
datatables.sql
file if you prefer to manually install the tables.
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 oxmysql
Documentation: For oxmysql questions, visit oxmysql documentation
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: Install nearest-postal (Optional - Recommended)
This optional resource fits well within the purpose of Night Shifts MDT:
- Download from CFX Forum Release
- Extract and rename ‘nearest-postal-master’ to ‘nearest-postal’
- Add to server.cfg before Night Shifts MDT:
ensure nearest-postal
- Install postal map - Download from CFX Release
- Add map resource to server.cfg:
ensure map
Step 5: Install Night Discord API (Required)
Download our free Discord API: NS Discord API Free
- Install Discord API using this documentation page
- Note role names from Discord API config.lua for later use
- Add to server.cfg before Night Shifts MDT:
ensure night_discordapi
Step 6: Install Night Shifts MDT
- Download from CFX Portal Assets
- Extract and transfer using binary FTP mode
- Place ‘night_shifts’ into your resources folder
- Add to server.cfg:
ensure night_shifts
- Verify startup - Check console for both oxmysql and night_shifts starting without errors
⚙️ Configuration Setup
Required Tools
Visual Studio Code: We strongly recommend downloading VS Code for editing Lua files.
Configuration Files
File | Purpose |
---|---|
night_shifts/config/anpr_config.lua | ANPR configuration settings |
night_shifts/config/config.lua | Main configuration settings |
night_shifts/config/departments_config.lua | Department and role configuration |
night_shifts/config/fictivenames_config.lua | Fictive name configuration |
night_shifts/config/handbooks_config.lua | EMS Handbook configuration |
night_shifts/config/mdt_config.lua | Menu, HUD, statusses & more configuration |
night_shifts/config/translations.lua | Language configuration |
night_shifts/client/c_functions.lua | Client-side functions |
night_shifts/server/s_functions.lua | Server-side functions |
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
Time Investment: Plan adequate time for configuration. Each variable is named descriptively to help you understand its purpose.
🎮 How It Works
Civilian Side
- Emergency Services Hotline - Call 999/911/112 with detailed information
- Council/City Hall - Register and edit civilians with custom profile pictures
- DVLA/DMV - Register and edit vehicles connected to civilians
Emergency Services Side
- Battery & Signal - Charge MDT in vehicles, signal based on ping
- Shift & Status - Department selection, shift toggling, panic button
- Emergency Hotline - Receive calls, view archives, locate with waypoints
- Police National Computer - Person, vehicle, record, and fine searches
- Unit Overview - Control and dispatch functionality
- Operations - Create and manage reports, view guidelines
- Statistics - Department performance monitoring
Server Owner Features
- ANPR Camera Locations - Configurable camera positions
- Fire Station Alarms - Configurable alarm triggers
- Custom Images & Sounds - Configurable NUI elements
- Multi-Language Support - International configuration
- Department Management - Configurable departments, ranks, and roles
🔗 Integration & Compatibility
Framework Support
- Standalone - Works independently without framework dependencies
Emergency Response Simulator Integration
- NPC Search - Search NPCs and their vehicles in the MDT
- Interaction Tracking - Track NPC interactions via Emergency Response Simulator
- Vehicle Registration - Automatic vehicle registration from interactions
Integration Setup: Ensure Emergency Response Simulator is properly configured for NPC interaction tracking.
📊 Exports
Server-Side Exports
-- Get user shift data for server ID
local src = source
local shiftDataResults = exports['night_shifts']:GetUserShiftData(src)
if #shiftDataResults > 0 then
for k, v in pairs(shiftDataResults) do
print("Key: "..k.." | Value: "..v)
end
else
print("No shift data found for server ID "..src)
end
Client-Side Exports
-- Trigger alarm
exports.night_shifts:TriggerAlarm(isEmergency, isPoliceRequired, isAmbulanceRequired, isFireRequired, isTowRequired, description, coordinates)
-- Create emergency call
exports.night_shifts:CreateEmergencyCall(isEmergency, isPoliceRequired, isAmbulanceRequired, isFireRequired, isTowRequired, description, caller_name, coordinates, contact_details)
-- Get department counts
exports.night_shifts:GetCivilianCount()
exports.night_shifts:GetPoliceCount()
exports.night_shifts:GetAmbulanceCount()
exports.night_shifts:GetFireCount()
exports.night_shifts:GetTowCount()
🛠️ Troubleshooting
Common Issues
Parsing Errors in F8 Console
- Ensure files are transferred in binary mode via FTP
- Follow the installation order: ZIP → Unpack → Binary FTP → Resources → server.cfg
Database Connection Issues
- Verify MySQL connection string is correct
- Check database credentials and accessibility
- Ensure oxmysql is properly installed and started
FiveM ID Not Found
- Log into FiveM app when inside the app
- Close and reopen FiveM app
- Join server as a logged in user
Resource Naming
- Ensure script is named
night_shifts
(do NOT rename)- Check resource folder structure
Configuration Tips
- Start resource before players join - Prevents database errors
- Order index numbers correctly - Use [1], [2], [3] not [1], [3], [4]
- Read commentary in scripts - Logic is explained in comments
- Test with civilian department first - Ensure basic functionality
💡 Best Practices
Configuration Tips
- Role Planning - Set up appropriate Discord roles and permissions
- Department Structure - Plan department, sub-department, and rank hierarchy
- Language Localization - Configure for your country’s emergency services
- Backup Configurations - Keep backups of working configurations
Database Management
- Regular Backups - Backup your database regularly
- Performance Monitoring - Monitor database performance
- Table Maintenance - Periodically optimize database tables
User Experience
- Clear Documentation - Provide users with MDT usage guidelines
- Role Training - Train users on department-specific features
- Emergency Procedures - Establish clear emergency call procedures
🆘 Support
Read through the instructions again if you have not managed to install the resource. Can’t get it to work still? Create a ticket through our dedicated support system in Discord: