[How to] Make people walk when they are handcuffed

Hello! I have been researching about how to make people move when they are handcuffed. And here is my results.

In esx_policejob/client/main.lua
you will need to find this

      TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0)
      SetEnableHandcuffs(playerPed, true)
      SetPedCanPlayGestureAnims(playerPed, false)
      FreezeEntityPosition(playerPed,  true)

then you will change
FreezeEntityPosition(playerPed, true)
to
FreezeEntityPosition(playerPed, false)

this will make that people can move while cuffed.

It will looks like this until the end

  TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0)
      SetEnableHandcuffs(playerPed, true)
      SetPedCanPlayGestureAnims(playerPed, false)
      FreezeEntityPosition(playerPed,  false)

And if you want to disable buttons to people while handcuffed when you need to change

-- Handcuff
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(10)
		if IsHandcuffed then
			DisableControlAction(0, 142, true) -- MeleeAttackAlternate
			DisableControlAction(0, 30,  true) -- MoveLeftRight
			DisableControlAction(0, 31,  true) -- MoveUpDown
			DisableControlAction(0, 24,  true) -- Shoot 
			DisableControlAction(0, 92,  true) -- Shoot in car
			DisableControlAction(0, 75,  true) -- Leave Vehicle
		end
	end
end)

Buttons

- Buttons
local Keys = {
  ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}

18 Likes

I wouldn’t consider this a modding tutorial… it’s basically a change in a single line of code…

1 Like

What is up with everyone storing a keys table… its so ugly and unuseful

3 Likes

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

6 Likes

Lol… literraly only flags. It’s real funny that you try to defend that lol.

My cuff script I released ages ago has had this. All I did was change a god damn animation flag so.

:man_shrugging: good work buddy.

Also I never said ANYTHING about your bullshit tutorial. Just dont understand why people make their code look like shit by pasting a keys table in every single ESX client script. But fuck what the hell do I know about code you are probably better than me right? So its whatever boss.

2 Likes

The menu doesnt open when i replace this:
TaskPlayAnim(playerPed, ‘mp_arresting’, ‘idle’, 8.0, -8, -1, 49, 0, 0, 0, 0)
SetEnableHandcuffs(playerPed, true)
SetPedCanPlayGestureAnims(playerPed, false)
FreezeEntityPosition(playerPed, false)```

2 Likes

Can you send a picture on those rows

1 Like

https://gyazo.com/50bd4fd1e0c247fa4536560ed399518b

2 Likes

My bad! Remove Those “```”

1 Like

Don’t work… 20charrrr

1 Like

Dont care if i revive a dead post, Just because you can code dosent mean you’re “big boss” and that you can hate on people who our learning like who the f do you think you our bro… People like you make me wanna punch you through my dam screen, You are literally a bully.

5 Likes
  1. I never said anything about my knowledge to him at first. I just pointed out the fact that the keys table could be removed because it was unuseful and I didnt understand the reasoning of people pasting them all over their code.

  2. Do you really think the way he responded to me was right but you are bitching at me how I responded after he told me to shutup… really.

Usually its ok to revive dead posts but you literally just revived to run your mouth and start a dramatic fight on a dead topic. Maybe instead of seeking attention you should have just dmed me instead. :man_shrugging:

You aren’t gonna punch anyone and before you go around and call me a bully. I have helped A LOT of people around here. If this guy would have asked me why I say that about the keys table I would have would have explained it but he wanted to act like I was attacking him and tell me to shutup. I also still learn new things about code myself daily and a lot of times its from other people. I dont instantly tell them to shutup and tell them they are attacking me from norifying me about something in my code that is unneeded When you find out this code help you hmu.

2 Likes

You contradict yourself so much… call Xander a bully… but say you’d punch him through a “dam” screen :joy: seriously you are brain dead.

3 Likes

I would like to also point out that I have known about me being an ass but on other topics not this one. The moderators let me know a couple months ago and I have been fixing the issue. But this is one I believe I was an asshole beyond reasoning so… I really dont know what else to tell you other than stop reviving old topics to talk about stuff you dont even know how they ended. What if I dmed this guy and apologized and you started all this up for literally nothing…

1 Like

Got a good point just stating what ive seen through the comments most of the comments ive seen by you are extremely harsh. Ill just mind my own business, i appreciate you actually accepting it tho.

1 Like

I am not one of those people who are blind to their own comments. When I make comments I know 100% what I am saying but I wouldn’t have said harsh things to this guy if he wouldnt have told me to shutup. If you are seeing harsh comments from me usually its because I am irritated by some of lazy community members or someone saying something really dumb.

Like me having to repeat answers over and over again in my own topics will result in a harsh comment or someone making a really dumb statement that is obviously wrong and they are just being an ass and ignoring it usually will result in me being harsh or like this guy where I just said I dont understand why people use the keys because its ugly and bam… just tells me to shutup.

4 Likes

Doesn’t work any idea why?

2 Likes

Same here, Would be nice to fix it

1 Like

I would like to revive this post because im looking for a way to be able to hard cuff someone “they cant move” and soft cuff them “allow them to walk while cuffed”

2 Likes

yeeeeeeet

1 Like