Project-Sloth / ps-mdt

MDT for QBCore
https://discord.gg/projectsloth
GNU General Public License v3.0
250 stars 282 forks source link

Send to Jail not correctly working #466

Closed jn1001 closed 6 months ago

jn1001 commented 6 months ago

If you send a player to Jail via mdt they get taken to the mugshot area but they dont get taken off their clothes and inventory items.

Regardless if TriggerServerEvent("police:client:JailPlayer", targetSourceId, sentence) or TriggerServerEvent("police:server:JailPlayer", targetSourceId, sentence) is used.

If you send a Player via radialmenu to Jail which uses the TriggerServerEvent("police:client:JailPlayer", targetSourceId, sentence) event then it works how it should.

Any one haveing an idea?

RegisterNUICallback("sendToJail", function(data, cb) QBCore.Functions.TriggerCallback('ps-mdt:server:MugShotWebhook', function(MugShotWebhook) if MugShotWebhook ~= '' then local citizenId, sentence = data.citizenId, data.sentence

        -- Gets the player id from the citizenId
        local p = promise.new()
        QBCore.Functions.TriggerCallback('mdt:server:GetPlayerSourceId', function(result)
            p:resolve(result)
        end, citizenId)

        local targetSourceId = Citizen.Await(p)

        if sentence > 0 then
            if Config.UseCQCMugshot    then
                TriggerServerEvent('cqc-mugshot:server:triggerSuspect', targetSourceId)
            end
            Citizen.Wait(5000)
            -- Uses qb-policejob JailPlayer event
            TriggerServerEvent("police:client:JailPlayer", targetSourceId, sentence)
            --TriggerServerEvent("police:server:JailPlayer", targetSourceId, sentence)
        end
    end
end)

end)

Edit sorry I have no idea how to assign labels here.

LeSiiN commented 6 months ago

So mine is working fine, did u add the webhook? did u remove the line for u not to be kicked?