# MDT Compatibility

***

{% hint style="info" %}

## Compatibility Key

<mark style="color:$success;">**Built-In (cd\_dispatch3d)**</mark>

* Fully integrated into cd\_dispatch3d and auto-detected, no modifications or configuration needed.

<mark style="color:$success;">**Built-In (creator)**</mark>

* Fully integrated by the resource creator, no modifications required.

<mark style="color:$success;">**Built-In (cd\_bridge)**</mark>

* Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource.

<mark style="color:$info;">**Minor Changes Required**</mark>

* Small, simple edits such as adding or copying a single line of code.

<mark style="color:$warning;">**Moderate Changes Required**</mark>

* Involves replacing existing logic or functions with the versions provided by Codesign.

<mark style="color:red;">**Major Changes Required**</mark>

* Extensive modifications across multiple files or large code sections.
  {% endhint %}

***

## Supported MDT Compatibility

Supported MDT resources can display alerts from Dispatch3D.

| Script Name                                          | Compatibility Type                                                 | Notes                        |
| ---------------------------------------------------- | ------------------------------------------------------------------ | ---------------------------- |
| [p\_mdt](https://pscripts-store.com/product/6632004) | <mark style="color:$success;">**Built-In (creator)**</mark>        |                              |
| [plt\_mdt](https://pluto-dev.com/package/7297357)    | <mark style="color:$success;">**Built-In (cd\_dispatch3d)**</mark> |                              |
| [ps-mdt](https://github.com/Project-Sloth/ps-mdt)    | <mark style="color:$warning;">**Moderate Changes Required**</mark> | [#ps-mdt](#ps-mdt "mention") |
| [tk\_mdt](https://tkscripts.com/)                    | <mark style="color:$success;">**Built-In (creator)**</mark>        |                              |

***

## MDT Compatibility Guides

Step-by-step guides for making supported MDT resources display alerts from our dispatch system.

{% hint style="info" %}

#### ℹ️ Notice

The **exact line** where these changes are made may differ after updates, but the **code itself remains the same**.
{% endhint %}

### ps-mdt

{% stepper %}
{% step %}
View the code on GitHub: [ps-mdt/server/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/server/main.lua#L125)

REPLACE the code exactly as seen in the screenshot below.

{% code title="ps-mdt/server/main.lua — line 125" %}

```lua
local dispatchResources = {
    { name = 'ps-dispatch', export = 'GetDispatchCalls' },
    { name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
    { name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
    if GetResourceState(res.name) == 'started' then
        return exports[res.name][res.export]()
    end
end
```

{% endcode %}

<div data-with-frame="true"><figure><img src="/files/80dCzYvIywgnvJD2NcDK" alt="" width="563"><figcaption><p>Before and After</p></figcaption></figure></div>
{% endstep %}

{% step %}
View the code on GitHub: [ps-mdt/server/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/server/main.lua#L256)

REPLACE the code exactly as seen in the screenshot below.

{% code title="ps-mdt/server/main.lua — line 256" %}

```lua
local dispatchResources = {
	{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
	{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
	{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
	if GetResourceState(res.name) == 'started' then
		calls = exports[res.name][res.export]()
		break
	end
end
```

{% endcode %}

<div data-with-frame="true"><figure><img src="/files/YVufEIWrmlz1G93GeF2n" alt="" width="563"><figcaption><p>Before and After</p></figcaption></figure></div>
{% endstep %}

{% step %}
View the code on GitHub: [ps-mdt/server/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/server/main.lua#L321)

REPLACE the code exactly as seen in the screenshot below.

{% code title="ps-mdt/server/main.lua — line 321" %}

```lua
local dispatchResources = {
	{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
	{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
	{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
	if GetResourceState(res.name) == 'started' then
		cb(exports[res.name][res.export]())
		break
	end
end
```

{% endcode %}

<div data-with-frame="true"><figure><img src="/files/7BTHco4atnYY1P1cvZH5" alt="" width="563"><figcaption><p>Before and After</p></figcaption></figure></div>
{% endstep %}

{% step %}
View the code on GitHub: [ps-mdt/client/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/client/main.lua#L17)

REPLACE the code exactly as seen in the screenshot below.

{% code title="ps-mdt/client/main.lua — line " %}

```lua
CreateThread(function()
    local dispatchResources = {
		{ name = 'ps-dispatch' },
		{ name = 'cd_dispatch3d' },
		{ name = 'cd_dispatch' },
	}
	for _, res in ipairs(dispatchResources) do
		if GetResourceState(res.name) == 'started' then
			TriggerServerEvent("ps-mdt:dispatchStatus", true)
			break
		end
	end
end)
```

{% endcode %}

<div data-with-frame="true"><figure><img src="/files/ygYlakVdBuBTuGe5LCyY" alt="" width="563"><figcaption><p>Before and After</p></figcaption></figure></div>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codesign.pro/paid-scripts/dispatch3d/mdt-compatibility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
