🔐Jail Integration
If u need integration for your mdt, please open ticket on our discord server :)
ps-mdt
Find this line in
cl_mugshot.lua
TriggerServerEvent("police:server:JailPlayer", targetSourceId, sentence)
Replace this line with this code
TriggerServerEvent("p_policejob:JailPlayer", {
player = targetSourceId,
jail = sentence,
fine = 0,
reason = ''
})
drx_mdt
Find this code in your mdt
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
Replace function with this code
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
lb-tablet
Add this as new file in lb-tablet jail folder or edit template.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 = time,
fine = 0,
reason = reason
})
return true
end
---@param identifier string
---@return boolean success
function UnjailPlayer(identifier)
local source = GetSourceFromIdentifier(identifier)
exports['p_policejob']:UnJailPlayer(nil, source)
return true
end
---@param identifier string
---@return integer remainingTime seconds
function GetRemainingPrisonSentence(identifier)
local source = GetSourceFromIdentifier(identifier)
return exports['p_policejob']:getPlayerJudgment(source) or 0
end
Last updated