Hi, Thank you for your time in advance.
I'm attempting to use this script to enable players to "break cuffs" when arrested by police. I am unable to figure out how I can trigger the minigame to the player being cuffed and not the player cuffing. <--- (Hope that makes sense)
Here is how I have set the function at the moment...
RegisterNetEvent('police:client:MinigameCuffPlayer', function()
if not IsPedRagdoll(PlayerPedId()) then
local player, distance = QBCore.Functions.GetClosestPlayer()
if player ~= -1 and distance < 1.5 then
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
if result then
local playerId = GetPlayerServerId(player)
if not IsPedInAnyVehicle(GetPlayerPed(player)) and not IsPedInAnyVehicle(PlayerPedId()) then
local seconds = math.random(4,6)
local circles = 1
local success = exports['qb-lock']:StartLockPickCircle(circles, seconds, success)
if success then
TriggerClientEvent('QBCore:Notify', playerId.PlayerData.source, "You broke cuffs!")
else
TriggerServerEvent("police:server:CuffPlayer", playerId, false)
HandCuffAnimation()
TriggerClientEvent('QBCore:Notify', playerId.PlayerData.source, "You have been cuffed!")
end
else
QBCore.Functions.Notify("You can\'t cuff someone in a vehicle", "error")
end
else
QBCore.Functions.Notify("You don\'t have handcuffs on you", "error")
end
end, "handcuffs")
else
QBCore.Functions.Notify("No one nearby!", "error")
end
else
Wait(2000)
end
end)
Shot in the dark and I have no idea how to contact you NathanERP, but any help would be greatly appreciated!