> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_mdt/api/client.md). Agents can also search and read this documentation through its [MCP server](https://documentation.rcore.cz/~gitbook/mcp).

# Client

Use these only if you want another resource to open the MDT, for example from a tablet item or a vehicle menu.

Both run the same checks as the command: the player must be in a department, on duty on QBCore and QBX, and carry the required item if `CONFIG.RequireItem = true`. If the MDT is already open, it closes.

## 📟 Exports

<details>

<summary>OpenMDT</summary>

Opens the MDT, or closes it if it is already open.

```lua
exports.rcore_mdt:OpenMDT()
```

Example:

```lua
RegisterCommand('tablet', function()
    exports.rcore_mdt:OpenMDT()
end, false)
```

</details>

## 📡 Events

<details>

<summary>rcore_mdt:client:open</summary>

Opens the MDT, or closes it if it is already open. The event name is set in `CONFIG.OpenEvent` in `configs/cl_config.lua`.

From the client:

```lua
TriggerEvent('rcore_mdt:client:open')
```

From the server:

```lua
TriggerClientEvent('rcore_mdt:client:open', playerId)
```

| Name       | Type     | Description                             |
| ---------- | -------- | --------------------------------------- |
| `playerId` | `number` | Server ID of the player to open it for. |

</details>
