# Jail Integration

{% hint style="warning" %}
If u need integration for your mdt, please open ticket on our discord server :)
{% endhint %}

<details>

<summary>ps-mdt</summary>

1. Find this line in `cl_mugshot.lua`

```lua
TriggerServerEvent("police:server:JailPlayer", targetSourceId, sentence)
```

2. Replace this line with this code

```lua
TriggerServerEvent("p_policejob:JailPlayer", {
    player = targetSourceId,
    jail = sentence,
    fine = 0,
    reason = ''
})
```

</details>

***

<details>

<summary>drx_mdt</summary>

1. Find this code in your mdt

```lua
jailPlayer = function(source, identifier, jailtime)
  local xTarget = Framework.getPlayerByIdentifier(identifier)
  if xTarget then
    xTarget.Functions.SetMetaData("injail", jailtime)
    TriggerClientEvent("police:client:SendToJail", xTarget.PlayerData.source, jailtime)
    return
  end
end
```

2. Replace function with this code

```lua
jailPlayer = function(source, identifier, jailtime)
    local xTarget = Framework.getPlayerByIdentifier(identifier)
    if xTarget then
        exports['p_policejob']:JailPlayer(source, {
            player = xTarget.source or xTarget.PlayerData?.source,
            jail = jailtime,
            fine = 0,
            reason = ''
        })
    end
end
```

</details>
