Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

unable to cuff whitelisted and off-duty cops #39

Closed
JakeRyan1 opened this issue Jun 7, 2017 · 2 comments
Closed

unable to cuff whitelisted and off-duty cops #39

JakeRyan1 opened this issue Jun 7, 2017 · 2 comments
Labels

Comments

@JakeRyan1
Copy link

JakeRyan1 commented Jun 7, 2017

In RP, if you have to cuff a policeman, he shouldn't stay a cop. like a whitelisted cop that is playing as a civilian can be cuffed. Because of right now we cannot cuff another whitelisted policeman.

@t-valette t-valette changed the title In RP, if you have to cuff a policeman, he shouldn't stay a cop. add a config for allow cuffing or not cops Jun 8, 2017
@t-valette t-valette changed the title add a config for allow cuffing or not cops add a config for allow cuffing or not others cops Jun 8, 2017
@t-valette t-valette changed the title add a config for allow cuffing or not others cops unable to cuff whitelisted and off-duty cops Jun 17, 2017
@t-valette t-valette added bug and removed enhancement labels Jun 17, 2017
@Valderg
Copy link

Valderg commented Jun 24, 2017

This is quite simple, i have done it myself on my servers. Remove the check for IsCop in the getArrested function and add the other requests to the IsCop request in citizen.createthread of your client.lua

This is my current police:getArrested
I removed IsCop and left it as (config.useCopWhitelist == true)

RegisterNetEvent('police:getArrested')
AddEventHandler('police:getArrested', function()
	if((config.useCopWhitelist == true) or config.useCopWhitelist == false) then
		handCuffed = not handCuffed
		if(handCuffed) then
			TriggerEvent("police:notify",  "CHAR_ANDREAS", 1, txt[config.lang]["title_notification"], false, txt[config.lang]["now_cuffed"])
			isHandCuffed = true -- jail addon
		else
			TriggerEvent("police:notify",  "CHAR_ANDREAS", 1, txt[config.lang]["title_notification"], false, txt[config.lang]["now_uncuffed"])
			isHandCuffed = false -- jail addon
			drag = false
		end
	end
end)

if (isInService == false) then
	if (handCuffed == true) then
	     RequestAnimDict('mp_arresting')

	 while not HasAnimDictLoaded('mp_arresting') do
		Citizen.Wait(0)
	  end

		 local myPed = PlayerPedId(-1)
		 local animation = 'idle'
		 local flags = 16

		 TaskPlayAnim(myPed, 'mp_arresting', animation, 8.0, -8, -1, flags, 0, 0, 0, 0)
end
			
	--Piece of code from Drag command (by Frazzle, Valk, Michael_Sanelli, NYKILLA1127 : https://forum.fivem.net/t/release-drag-command/22174)
	if drag then
		local ped = GetPlayerPed(GetPlayerFromServerId(officerDrag))
		local myped = GetPlayerPed(-1)
		AttachEntityToEntity(myped, ped, 4103, 11816, 0.68, 0.00, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true)
	else
		DetachEntity(GetPlayerPed(-1), true, false)		
end
end

@t-valette
Copy link
Collaborator

fix in 1.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants