[Request] Cuff Nearest Player


#1

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.


#2

Have you tried this:

[Release] Handcuff and Handsup scripts [FXSERVER]


#3

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


#4

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


#5

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.


#6

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


#7

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.


#8

did that ever work? 2020202020