[Release] Handcuff and Handsup scripts

This will make the handcuffs and handsup scripts work together EX. Players can’t put their handsup while they are handcuffed.

Keys: X - Cuff the nearest player

TBA

Config
Ped restriction
Player identifier restriction
19 Likes

Amazing, Alot of people have made this script but kept it to themselves and only their servers which pisses me off. Thank you so much.

3 Likes

Hi zach im not stalking

How can i make is use a keybind rather then a command?

3 Likes
if IsControlJustPressed()

hi, @grahamgarn are you willing to edit his script and make it so to press a command as well cuff people nearby that would be awesome :slight_smile:

1 Like

Commands have perms. Doing this you would have to start it client side with a control press. Then send it to the server side for a perm check and then back to the client to complete. Unless you want everyone cuffing everyone.

1 Like

I apologize for the late response as I am on vacation, but adding the ability with a key handler has its good and bad traits. The good trait is that its easier to access than a chat command, but the bad side is a lot of users don’t know how to add perms to those. I am gonna be working on a job system for essentialmode. It will hopefully have whitelisted jobs available, Job pay checks, restricted job commands, etc. There will also be a keybinded restricted cuff function for police. You will also be able to use commands if you please. It just all takes time.

Now if you want to try and change this script into something else have at it but one good way to use a keybinded cuff and to use rays to return the ped in front of you find their PlayerID then run the cuff function on that player. If you do not know what a ray is then I am sorry I can’t really explain here. but I know some scripts on here use it to find vehicles.

I am sorry for rambling on just trying to answer everything at midnight.

1 Like

Will the job system you are working on be for essentialmode 3.+ and couchDB?

@xander1998

@xander1998 help out the ES 3.0 users. Not much available for them yet. There is already a job system for the SQL ES. I don’t use 3.0 but it’s not about me, it’s about the community. Many don’t have access to the older versions and I’m respecting Kane’s wishes by not distributing the SQL version.

1 Like

Will try to make it available for both MySQL and CouchDB but I haven’t decided what I would like to do yet with that. But will more then likely be available for both.

1 Like

197625] Error running system event handling function for resource cuff: citizen:/scripting/lua/scheduler.lua:39: Failed to execute thread: sv_cuff.lua:15: attempt to call a nil value (method ‘Split’)
[ 197625] stack traceback:
[ 197625] sv_cuff.lua:15: in function ‘stringsplit’
[ 197625] sv_cuff.lua:3: in upvalue ‘handler’
[ 197625] citizen:/scripting/lua/scheduler.lua:124: in function citizen:/scripting/lua/scheduler.lua:123
[ 197625] stack traceback:
[ 197625] [C]: in function ‘error’
[ 197625] citizen:/scripting/lua/scheduler.lua:39: in field ‘CreateThreadNow’
[ 197625] citizen:/scripting/lua/scheduler.lua:123: in function citizen:/scripting/lua/scheduler.lua:92

That stringsplit no longer works inside the sv_cuff.lua. If you want it to work again replace the current stringsplit in the server script with this one.

function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end
1 Like

Thanks!

Also, is there any simple way to have it instead of being /cuff id to /cuff and just have it check to see if the player is within a certain vicinity?

It is indeed possible but I am working on a K9 script right now so I wouldn’t do it today.

2 Likes

Wow that sounds awesome!

I get an error trying to cuff someone. Is anyone else getting this error?

I posted a fix above.

Yeah and that is the one I’m having a problem with :confused:

Edit: Nevermind I see what you posted

1 Like

I will probably just take the link doen and put it on my github so I can edit it easier.