ESX_Policejob Not Disabling Controls

Alright, So I know I saw it somewhere on the forums here and somewhere I had it previously working on a older version I had of my script but I had to replace it as I broke something LOL as we all end up doing at some point so I rolled it back and had a version that doesnt disable the controls I believe I have it done correctly

-- Handcuff
Citizen.CreateThread(function()
  while true do
    Wait(0)
    if IsHandcuffed then
      DisableControlAction(0, 142, true) -- MeleeAttackAlternate 170
      DisableControlAction(0, 30,  true) -- MoveLeftRight
      DisableControlAction(0, 31,  true) -- MoveUpDown
      DisableControlAction(0, 170, true)
      DisableControlAction(0, 167, true)
      DisableControlAction(0, 5, true)
      DisableControlAction(0, 6, true)
      DisableControlAction(0, 45, true)
      DisableControlAction(0, 142, true)
      DisableControlAction(0, 141, true)
      DisableControlAction(0, 140, true)
      DisableControlAction(0, 263, true)
      DisableControlAction(0, 264, true)
    end
  end
end)

But they can still enter cars and throw punched and also go into a fighting stance which I do not want I thought I covered everything but again they can still do these things

This is correct right?
:thinking::thinking::thinking::thinking::thinking:

Did you find a solution?

Remove that and type this:

DisableAllControlActions(0)

Hi there, here is the code you need this is from the esx_policejob that i use.
that should work.

– Handcuff
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = PlayerPedId()

	if isHandcuffed then
		DisableControlAction(0, 1, true) -- Disable pan
		DisableControlAction(0, 2, true) -- Disable tilt
		DisableControlAction(0, 24, true) -- Attack
		DisableControlAction(0, 257, true) -- Attack 2
		DisableControlAction(0, 25, true) -- Aim
		DisableControlAction(0, 263, true) -- Melee Attack 1
		DisableControlAction(0, 32, true) -- W
		DisableControlAction(0, 34, true) -- A
		DisableControlAction(0, 31, true) -- S
		DisableControlAction(0, 30, true) -- D

		DisableControlAction(0, 45, true) -- Reload
		DisableControlAction(0, 22, true) -- Jump
		DisableControlAction(0, 44, true) -- Cover
		DisableControlAction(0, 37, true) -- Select Weapon
		DisableControlAction(0, 23, true) -- Also 'enter'?

		DisableControlAction(0, 288,  true) -- Disable phone
		DisableControlAction(0, 289, true) -- Inventory
		DisableControlAction(0, 170, true) -- Animations
		DisableControlAction(0, 167, true) -- Job

		DisableControlAction(0, 0, true) -- Disable changing view
		DisableControlAction(0, 26, true) -- Disable looking behind
		DisableControlAction(0, 73, true) -- Disable clearing animation
		DisableControlAction(2, 199, true) -- Disable pause screen

		DisableControlAction(0, 59, true) -- Disable steering in vehicle
		DisableControlAction(0, 71, true) -- Disable driving forward in vehicle
		DisableControlAction(0, 72, true) -- Disable reversing in vehicle

		DisableControlAction(2, 36, true) -- Disable going stealth

		DisableControlAction(0, 47, true)  -- Disable weapon
		DisableControlAction(0, 264, true) -- Disable melee
		DisableControlAction(0, 257, true) -- Disable melee
		DisableControlAction(0, 140, true) -- Disable melee
		DisableControlAction(0, 141, true) -- Disable melee
		DisableControlAction(0, 142, true) -- Disable melee
		DisableControlAction(0, 143, true) -- Disable melee
		DisableControlAction(0, 75, true)  -- Disable exit vehicle
		DisableControlAction(27, 75, true) -- Disable exit vehicle

		if IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) ~= 1 then
			ESX.Streaming.RequestAnimDict('mp_arresting', function()
				TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0.0, false, false, false)
			end)
		end
	else
		Citizen.Wait(500)
	end
end

end)

try this.

1 Like