Installation

Welcome to the Redutzu-MDT installation guide. Here, you will learn how to fully install our asset to ensure a smooth and trouble-free setup for your FiveM server. By carefully following each step in this guide, you will achieve a clean and efficient installation.

If you encounter any issues during the installation, please do not hesitate to reach out for assistance. Open a ticket in our Discord server, and our dedicated support team will be ready to help you resolve any problems. We're committed to ensuring that your setup process is as smooth and trouble-free as possible, so feel free to contact us with any questions or concerns you may have.


Download the asset

After purchasing the script from our store at Redutzu's Scripts Store, head over to Keymaster. Here, you will find the assets you have acquired. Download the scripts named "Redutzu MDT" and "Redutzu MDT (Prop)" to your environment.

The script will not work if the asset is not purchased and present on your Keymaster account. Additionally, please be aware that if you transfer these assets, you will not be able to receive them back, and the script will cease to function.


Download the dependencies

To make sure the MDT works as it should, there are a few scripts you must download. These extra scripts are key for the MDT system to run well and fit into your FiveM server. Be sure to get all the needed dependencies listed in the documentation to ensure a smooth and fully working setup.

Dependency
Link

For optimal performance and smooth operation of the script, we highly recommend having one of the latest recommended artifacts installed.


Start the resources

To get Redutzu-MDT running smoothly on your FiveM server, it's important to start the scripts in the right order. This ensures everything loads correctly, avoiding problems and making sure the MDT system works well.

# The first hing you want to start is your database wrapper
ensure oxmysql / mysql-async

# Then start your core
ensure es_extended / qb-core / qbx_core

# Before you start the MDT, make sure to start screenshot-basic
ensure screenshot-basic

# Make sure you start the prop before
ensure redutzu-mdt-prop
ensure redutzu-mdt

Make sure the license for your server matches the account where you bought the script. Using different licenses will cause errors, making the script to not work.


Insert the SQL

This step is crucial, so pay close attention. Inserting the SQL is a vital part of setting up the MDT on your server. Be sure to follow each step carefully and with full attention to detail. This ensures that the database is properly configured and ready to support the functionality of the MDT system without any issues.

There are different SQL files available for each framework, so make sure to choose the one that suits your server.

ALWAYS insert the Default one

You must insert this code, no matter which framework you're using. This is the main SQL required for the script to function properly.

DROP TABLE IF EXISTS `mdt_incidents`;
DROP TABLE IF EXISTS `mdt_evidences`;
DROP TABLE IF EXISTS `mdt_warrants`;
DROP TABLE IF EXISTS `mdt_bolos`;
DROP TABLE IF EXISTS `mdt_gallery`;
DROP TABLE IF EXISTS `mdt_weapons`;
DROP TABLE IF EXISTS `mdt_charges`;
DROP TABLE IF EXISTS `mdt_tags`;
DROP TABLE IF EXISTS `mdt_activity`;
DROP TABLE IF EXISTS `mdt_announcements`;
DROP TABLE IF EXISTS `mdt_codes`;


CREATE TABLE IF NOT EXISTS `mdt_incidents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` TEXT DEFAULT NULL,
  `players` TEXT DEFAULT NULL,
  `victims` TEXT DEFAULT NULL,
  `cops` TEXT DEFAULT NULL,
  `vehicles` TEXT DEFAULT NULL,
  `evidences` TEXT DEFAULT NULL,
  `charges` TEXT DEFAULT NULL,
  `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_evidences` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` TEXT DEFAULT NULL,
  `players` TEXT DEFAULT NULL,
  `cops` TEXT DEFAULT NULL,
  `vehicles` TEXT DEFAULT NULL,
  `weapons` TEXT DEFAULT NULL,
  `images` TEXT DEFAULT NULL,
  `archive` TEXT DEFAULT NULL,
  `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_warrants` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `reason` TEXT NOT NULL,
  `players` TEXT NOT NULL DEFAULT '[]',
  `house` TEXT DEFAULT NULL,
  `tag` varchar(64) DEFAULT NULL,
  `date` varchar(64) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_bolos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` TEXT DEFAULT NULL,
  `player` varchar(255) DEFAULT NULL,
  `vehicle` varchar(255) DEFAULT NULL,
  `tag` varchar(64) DEFAULT NULL,
  `date` varchar(64) NOT NULL,
  `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_gallery` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `identifier` VARCHAR(64) NOT NULL,
    `type` VARCHAR(10) NOT NULL,
    `value` TEXT NOT NULL,
    `description` TEXT DEFAULT NULL,
    PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_weapons` (
    `label` VARCHAR(64) NOT NULL,
    `name` VARCHAR(64) NOT NULL,
    `serial` VARCHAR(20) NOT NULL,
    `identifier` VARCHAR(64) DEFAULT NULL,
    `notes` TEXT DEFAULT NULL,
    PRIMARY KEY (`serial`)
) CHARACTER SET utf8mb4;

CREATE TABLE IF NOT EXISTS `mdt_charges` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `description` TEXT NOT NULL DEFAULT '',
    `jail` int(11) DEFAULT 0,
    `fine` FLOAT DEFAULT 0,
    `tag` VARCHAR(64) DEFAULT NULL,
    `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
    PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_tags` (
    `identifier` VARCHAR(64) NOT NULL,
    `type` VARCHAR(64) NOT NULL,
    `name` VARCHAR(255) NOT NULL,
    `description` TEXT DEFAULT NULL,
    `color` VARCHAR(64) NOT NULL,
    PRIMARY KEY (`identifier`)
) CHARACTER SET utf8mb4;

CREATE TABLE IF NOT EXISTS `mdt_activity` (
    `identifier` VARCHAR(64) NOT NULL,
    `amount` FLOAT NOT NULL,
    `clockIn` VARCHAR(128) NOT NULL,
    `clockOut` TIMESTAMP NOT NULL DEFAULT current_timestamp()
) CHARACTER SET utf8mb4;

CREATE TABLE IF NOT EXISTS `mdt_announcements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` VARCHAR(255) NOT NULL,
  `content` TEXT NOT NULL,
  `author` varchar(255) NOT NULL,
  `pinned` BOOLEAN DEFAULT FALSE,
  `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

CREATE TABLE IF NOT EXISTS `mdt_codes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` TEXT DEFAULT NULL,
  `code` varchar(32) NOT NULL UNIQUE,
  `createdAt` TIMESTAMP NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) CHARACTER SET utf8mb4 AUTO_INCREMENT=0;

-- Delete triggers (for avoiding attached unexisting records)

DELIMITER //
  CREATE TRIGGER delete_evidence AFTER DELETE ON mdt_evidences FOR EACH ROW BEGIN
      UPDATE mdt_incidents SET
        evidences = JSON_REMOVE(mdt_incidents.evidences, JSON_UNQUOTE(
          JSON_SEARCH(mdt_incidents.evidences, 'one', OLD.id)
        ))
      WHERE
        JSON_CONTAINS(mdt_incidents.evidences, OLD.id);
  END;
// DELIMITER ;

Start your server

You can now start your server and enjoy the script. Additionally, you can configure the script further to match your preferences. For more information, refer to the configuration section.

Last updated