# Adjustments / Config

<figure><img src="https://2677940280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5JfMOsKkrFR0ZXmr49m1%2Fuploads%2FKYJTvRRr0bPhDGvc3Xfk%2Fadjust.png?alt=media&#x26;token=a7688330-7ef0-4df1-89a0-775873d32174" alt=""><figcaption></figcaption></figure>

### FRAMEWORK

```lua
Config.Framework = 'autodetect' -- esx, newqb, oldqb or autodetect
```

Autodetect finds your framework, you can set it manually if you want \[esx-newqb-oldqb]

### SQL

```lua
Config.SQL = 'oxmysql' -- oxmysql, ghmattimysql, mysql-async | Don't forget to set it in fxmanifest !
```

Write the sql script you are using here

If you are using mysql-async in fxmanifest, do not forget to delete oxmysql or put it in the comment line.

```lua
server_scripts {
    '@mysql-async/lib/MySQL.lua', --⚠️PLEASE READ⚠️; Uncomment this line if you use 'mysql-async'.⚠️
    --'@oxmysql/lib/MySQL.lua', --⚠️PLEASE READ⚠️; Uncomment this line if you use 'oxmysql'.⚠️
    'server/function.lua',
    'server/main.lua'
}

```

### COMMAND / ITEM / CAMS

### <mark style="color:orange;">COMMAND</mark>&#x20;

```lua
Config.Command = true -- Enabled opening mdt with command
Config.CommandName = 'mdt' -- Mdt open command 
```

You can also change the command name or close the command.

(To disable it, simply write Config.Command = false)

### <mark style="color:orange;">ITEM</mark>&#x20;

```lua
Config.Item = true -- if this option set to true the you can use mdt as item
Config.ItemName = 'mdt' -- item name
```

You can change it or turn it off in the same way&#x20;

(To disable it, simply write Config.Item = false)

{% tabs %}
{% tab title="QBCore" %}

```lua
['mdt'] 				 = {['name'] = 'mdt', 			    ['label'] = 'Police Tablet', 		['weight'] = 1500, 		['type'] = 'item', 		['image'] = 'mdt.png', 		['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'A police tablet'},
```

{% endtab %}

{% tab title="ESX" %}

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
	('mdt', 'Police Tablet', 1, 0, 1);
```

{% endtab %}
{% endtabs %}

### <mark style="color:orange;">CAMS</mark>

```lua
Config.CamCloseKey = 177 -- DELETE | https://docs.fivem.net/docs/game-references/controls/
```

You can change the key here.&#x20;

```lua
[1] = {
        img = "./assets/cams/cam_1.png", -- photo to appear in mdt
        position = vector4(381.73, 322.91, 105.86, 44.79), -- location
        name = "Downtown Vinewood 24/7 Market", -- name to appear in mdt
        enable = true -- to turn off the camera
},
```

#### Disable / Temp Disable / Enable Cam

**Disable / Temp Disable**

{% tabs %}
{% tab title="Client Side" %}
TriggerEvent('mgnPoliceMdt:disableCam',1) -- 1 = This is the camera index
{% endtab %}

{% tab title="Server Side" %}
TriggerClientEvent('mgn-mdt:disableCam',-1,1) -- 1 = This is the camera index
{% endtab %}
{% endtabs %}

If you want to disable a camera from another script

{% tabs %}
{% tab title="Client Side" %}
TriggerEvent('mgnPoliceMdt:tempDisableCam',50,1) -- 50 = 50 second , 1 = CamId
{% endtab %}

{% tab title="Server Side" %}
TriggerClientEvent('mgn-mdt:tempDisableCam',-1,50,1) -- 50 = 50 second , 1 = CamId
{% endtab %}
{% endtabs %}

#### ENABLE

{% tabs %}
{% tab title="Client Side" %}
TriggerEvent('mgnPoliceMdt:enableCam',1) --  1 = CamId
{% endtab %}

{% tab title="Server Side" %}
TriggerClientEvent('mgn-mdt:enableCam',-1,1) --  1 = CamId
{% endtab %}
{% endtabs %}

### <mark style="color:orange;">Discord Logs & Photos & Profile Picture</mark>

&#x20;<mark style="color:orange;">Logs & Photos</mark>

1 - ) Create a discord webhook

2 - ) Open server/discordlog.lua

3 - ) Paste your webhook in the photos and other discord logs section

&#x20;<mark style="color:orange;">Profile Picture</mark>

1 - ) Create a bottoken&#x20;

```lua
https://www.youtube.com/watch?v=-m-Z7Wav-fM
```

2 - ) Open server/discordlog.lua

3 - ) Paste your bottoken in the bottoken section

### <mark style="color:orange;">Access Menu</mark>

```lua
Config.AccessMenu = { -- applies to grades above the number 
    ['DASHBOARD'] = nil,
    ['PROFILES'] = nil,
    ['INCIDENTS'] = nil,
    ['CREATE_INCIDENTS'] = nil, 
    ['WARRANTS'] = nil,
    ['CREATE_WARRANT'] = nil,
    ['VEHICLES'] = nil,
    ['CAMS'] = nil,
    ['CALLS'] = nil,
    ['EVIDENCE'] = nil,
    ['CREATE_EVIDENCE'] = nil,
    ['CHARGES'] = nil,
    ['CREATE_CHARGES'] = nil,
    ['HOUSES'] = nil,
    ['LIVEMAP'] = nil, 
    ['SETTINGS'] = nil,
}
```

You can specify according to the grade of the menu, i.e. according to the job grade

```lua
['CREATE_WARRANT'] = 4,
```

### <mark style="color:orange;">Config.MenuOpen and Config.MenuClose</mark>

When mdt opens, you can close your hud or another script from here

```lua
Config.MenuOpen = function() -- This Executed when the menu is opened (useful to hide hud or any other elements on the screen)
    -- TriggerEvent('codem-blackhudv2:SetForceHide', true, true)
    -- TriggerEvent('codem-venicehud:SetForceHide', true)
end

Config.MenuClose = function() -- This Executed when the menu is closed (useful to show hud again or any other elements on the screen)
    -- TriggerEvent('codem-blackhudv2:SetForceHide', false, false)
    -- TriggerEvent('codem-venicehud:SetForceHide', false)
end
```

### <mark style="color:orange;">Chat BlackList Words</mark>

```lua
Config.ChatBlacklistedWords = { -- This prevents police type chat blacklisted words
    'faggot',
    'bitch',
    'b1tch',
    --'fu4k',
}
```

Here you can define words not to be used in the chat.

### <mark style="color:orange;">Notification</mark>

```lua
Config.ClientNotification = function(message, type, length) -- You can change notification event here
    if Config.Framework == "esx" then
        TriggerEvent("esx:showNotification", message) -- here
    else
        TriggerEvent('QBCore:Notify', message, type, length) -- here
    end
end

Config.ServerNotification = function(source, message, type, length) -- You can change notification event here
    if Config.Framework == "esx" then
        TriggerClientEvent("esx:showNotification",source, message) -- here
    else
        TriggerClientEvent('QBCore:Notify', source, message, type, length) -- here
    end
end
```

You can place your own notify system here

### <mark style="color:orange;">Add Call</mark>

```lua
exports["mgnPoliceMDT"]:AddCall(coords,street,text,type)
```

Here you need to send a coordinate, the notification you send from another client side code falls into the calls section in mdt

Available Type:&#x20;

```lua
houserobbery
shootfire
fight
```

Text : You can leave it blank or write the text that will appear in the calls section.

### <mark style="color:orange;">Invoices & Community Service & Jail</mark>

Adjustable in server/editabe.lua

![](https://2677940280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5JfMOsKkrFR0ZXmr49m1%2Fuploads%2FL64lUSxTZLNacRcvdz4G%2Fimage.png?alt=media\&token=677632ae-3dcd-48ea-90aa-a69914eaa637)

![](https://2677940280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5JfMOsKkrFR0ZXmr49m1%2Fuploads%2FMU8FDsDVw9Vjy3fMfajr%2Fimage.png?alt=media\&token=d8527ae1-7478-4e73-9f03-af2922fe274d)

![](https://2677940280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5JfMOsKkrFR0ZXmr49m1%2Fuploads%2FzrelLCDX4Y0kufx377vZ%2Fimage.png?alt=media\&token=ef8f0331-93af-4bbb-8429-67652a8e554b)

Supported Scripts For Now&#x20;

**Invoices :**&#x20;

```lua
Default ESX & QB
Okok billing
```

**Jail :**

```lua
esx_jail
esx-qalle-jail
qb-prison
```

**Community Service :**

```
JD_CommunityService
```

Can be added in the future according to requests


---

# 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://mgn.gitbook.io/mgn-store-documentations/scripts/mdt/adjustments-config.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.
