Police Presence
qb-policejob
local canRemove = true
RegisterNetEvent('police:client:GetCuffed', function(playerId, isSoftcuff)
local ped = PlayerPedId()
if not isHandcuffed then
isHandcuffed = true
TriggerServerEvent('police:server:SetHandcuffStatus', true)
ClearPedTasksImmediately(ped)
if GetSelectedPedWeapon(ped) ~= `WEAPON_UNARMED` then
SetCurrentPedWeapon(ped, `WEAPON_UNARMED`, true)
end
if not isSoftcuff then
cuffType = 16
GetCuffedAnimation(playerId)
QBCore.Functions.Notify(Lang:t('info.cuff'), 'primary')
else
cuffType = 49
GetCuffedAnimation(playerId)
QBCore.Functions.Notify(Lang:t('info.cuffed_walk'), 'primary')
end
-- av_gangs code
if canRemove then
canRemove = false
exports['av_gangs']:removeZoneXP(5) -- 5 is the amount of XP to remove
-- add a cooldown to prevent cops from abusing this
CreateThread(function()
Wait(5000) -- 5 seconds should be enough
canRemove = true
end)
end
else
isHandcuffed = false
isEscorted = false
TriggerEvent('hospital:client:isEscorted', isEscorted)
DetachEntity(ped, true, false)
TriggerServerEvent('police:server:SetHandcuffStatus', false)
ClearPedTasksImmediately(ped)
TriggerServerEvent('InteractSound_SV:PlayOnSource', 'Uncuff', 0.2)
QBCore.Functions.Notify(Lang:t('success.uncuffed'), 'success')
end
end)esx_policejob
Last updated