📚
Dusa all scripts documentation
  • Home
  • General Questions
    • Escrow System
    • Error parsing script ... <\1>
    • Failed to verify protected resource
    • You lack the required entitlement
    • If nothing fixed your problems
  • Need Help?
  • Scripts
    • Police Job
      • Installation
      • Configuration
      • Client
        • Exports
        • Events
      • Server
        • Callbacks
      • Common Issues
    • Evidence
      • Installation
      • Configuration
      • Client
        • Events
      • How to add custom weapon compatibility?
      • Common Issues
    • Hud
      • Installation
      • Configuration
      • Client
        • Events
        • Exports
      • Server
        • Events
    • Vehicle Keys
      • Installation
      • How to give keys to player? (e.g on dealerships)
      • Client
        • Exports
        • Events
      • Server
        • Exports
        • Events
    • Billing
      • Installation
      • Configuration & Exports (ESX)
      • Configuration & Exports (QB)
    • Police MDT
      • Installation
      • Configuration & Exports (ESX/QBCore)
    • Dispatch
      • Installation
      • On other resources, how can I integrate dispatch?
      • How to send custom dispatch?
      • Client
        • Exports
        • Events
        • Handlers
      • Server
        • Exports
    • Multicharacter + Spawn Selector
      • Installation
      • Configuration & Exports (ESX)
      • Configuration & Exports (QB)
Powered by GitBook
On this page
  • Integrations - Compatibilities
  • API
  • Common Errors
  1. Scripts
  2. Police MDT

Configuration & Exports (ESX/QBCore)

PreviousInstallationNextDispatch

Last updated 8 months ago

Integrations - Compatibilities

To ensure that our script operates harmoniously with other scripts, you will need to adjust the following settings.

Dispatch

To ensure the dispatch tab functions correctly, you need to make a small change to your dispatch script within your code.

1-) ps-dispatch

If you are a ps-dispatch user, you need to make a small change to your dispatch system:

  1. Find ps-dispatch on your resources folder

  2. Go to path ps-dispatch/client/main.lua

  3. Find event named:

    ps-dispatch:client:notify
  4. Replace the whole code with code block at the below, or just add this code to right place:

    exports['dusa_mdt']:SendDispatch(data, source)
RegisterNetEvent('ps-dispatch:client:notify', function(data, source)
    if data.alertTime == nil then data.alertTime = Config.AlertTime end
    local timer = data.alertTime * 1000
    
    if alertsDisabled then return end
    if not isJobValid(data.jobs) then return end
    if not IsOnDuty() then return end

    timerCheck = true

    SendNUIMessage({
        action = 'newCall',
        data = {
            data = data,
            timer = timer,
        }
    })

    addBlip(data, Config.Blips[data.codeName] or data)

    RespondToDispatch:disable(false)
    OpenDispatchMenu:disable(true)

    local startTime = GetGameTimer()
    while timerCheck do
        Wait(1000)

        local currentTime = GetGameTimer()
        local elapsed = currentTime - startTime

        if elapsed >= timer then
            break
        end
    end

    exports['dusa_mdt']:SendDispatch(data, source)
    timerCheck = false
    OpenDispatchMenu:disable(false)
    RespondToDispatch:disable(true)
end)

It should look like this at the end.

After completing these steps, our system will operate seamlessly with ps-dispatch

2-) rcore_dispatch

If you are a rcore_dispatch user, you need to make a small change to your dispatch system:

integrations will be added here

Billing

...

Jail

...

Community Service

...

API

The details for operations in this category have not been provided extensively, as anyone with basic knowledge can perform the necessary actions. Therefore, it is recommended to reserve this part more for your developers. Developers can refer to the provided snippets and integrate them into your scripts for extended functionality.

client

Insert Dispatches to MDT

To insert your dispatches for MDT to manage them, use this function at your dispatch script

But before that, make sure you integrated your dispatch to modules/dispatch/scripts/custom.lua

If there is a file named your dispatch script, that means your dispatch is already integrated by us.

Export

exports['dusa_mdt']:SendDispatch(data)

Parameters

Name
Data Type
Description

data

table

Table of data related to the reported incident


Common Errors

Common Error Codes and Solutions

If you're encountering issues with the MDT system, it may be a simple fix. Review the error codes below to identify and resolve your specific issue:

// server.cfg
ensure es_extended / qb-core ( depends on your framework )
ensure ox_lib
ensure dusa_mdt
  • Error 101 : Throws many errors when script started at first start of server

    • Error report screenshots may look like ;

      • Solution: Check your server.cfg start order. The order should be like this

      // server.cfg
      ensure es_extended / qb-core ( depends on your framework )
      ensure ox_lib
      ensure dusa_mdt
  • Error 202: New dispatchs are not listed in my mdt

    • Solution: Follow integration step depends on your dispatch system.

  • Error 303: .

    • Solution:

  • Error 404: .

    • Solution:

at server cmd
at f8 console

Remember to always check the latest documentation for any updates or changes to error codes and solutions.