[Request] Cuff Nearest Player

I am looking into how I can have a script to cuff the nearest player.
I’ve seen it in CopsFiveM, but I am looking for something standalone, also with using /cuff in text chat.
Any help?
Thanks.

Have you tried this:

[Release] Handcuff and Handsup scripts

Yes. That one does not cuff nearest player when you type in /cuff
Please correct me if I am wrong.

It does not. It’s all commands :smiley:. Sorry lol

1 Like

So, I’m a scripter right… Well I know the ins and outs of code and I know (as far as I know) that is would be very difficult coding. There would have to be many loops checking for each player and many events that would probably takes minutes to process. IDK how DOJ does it but the way that event work on a server right now would mean either a lot of code or a lot of waiting. Sorry for the long and sad answer to your request, but honestly I don’t want to code that much and so doesn’t any other coder here.

Or you could greatly reduce the search area for the closest player.

For example, you could use GET_CLOSEST_PLAYER_TO_ENITY then, check to make sure that the player is within a certain distance. There, you’ve just reduced the search from 32 players to one.

If you want to be able to cuff any ped then you could use GET_CLOSEST_PED

Ok. I’ll try to see what I can do.
If you could help me out it would be appreciated, since I’m very new to lua.
Thanks.

did that ever work? 2020202020

hands up are fine but /cuff ID says its not a valid command
is it because its outdated?