> For the complete documentation index, see [llms.txt](https://piotreq-scripts.gitbook.io/piotreq-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-job/jail-integration.md).

# 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>ps-mdt 3.0.0</summary>

1. Go to `ps-mdt/server/backend`
2. Replace `sentencing.lua` with file below

{% file src="/files/8Q98USzKo3uYAhR0IleT" %}

</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>

***

<details>

<summary>lb-tablet</summary>

Add this as new file in lb-tablet jail folder or edit template.lua

```lua
if Config.JailScript ~= "p_policejob" then
    return
end

---@param identifier string
---@param time integer The jail time in seconds
---@param reason string
---@param officerSource number
---@return boolean success
function JailPlayer(identifier, time, reason, officerSource)
    local minutes = math.floor(time / 60)
    local source = GetSourceFromIdentifier(identifier)
    exports['p_policejob']:JailPlayer(officerSource, {
        player = source,
        jail = minutes,
        fine = 0,
        reason = reason
    })
    return true
end

---@param identifier string
---@return boolean success
function UnjailPlayer(identifier)
    return false
end

---@param identifier string
---@return integer remainingTime seconds
function GetRemainingPrisonSentence(identifier)
    local source = GetSourceFromIdentifier(identifier)

    return exports['p_policejob']:getPlayerJudgment(source) or 0
end

```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/police-job/jail-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
