Handcuffs - For Jail 
16 comments Introduction
I assume you have played in one of the most famous jail servers - Fws Jail. That server has an awesome script that allows putting handcuffs on enemies; Also there was
HandCuff/Chain System. (9). As requested by my friend, I wrote my own version and decided to put it here.
Features
Handcuffs
Free handcuffs for Counter-Terrorists on spawn (configurable)
Breaking free of handcuffs
Installation
1. Download the file
2. Extract the files into CS2D directory.
3. Change settings if needed.
4. Start your server and enjoy applying handcuffs to your friends and foes.
See it in action!
Known Issues
None at the moment.
License
This content is published under WTFPL 3.0.
I assume you have played in one of the most famous jail servers - Fws Jail. That server has an awesome script that allows putting handcuffs on enemies; Also there was


Features



Installation
1. Download the file
2. Extract the files into CS2D directory.
3. Change settings if needed.
4. Start your server and enjoy applying handcuffs to your friends and foes.
See it in action!
Known Issues
None at the moment.
License
This content is published under WTFPL 3.0.
edited 16×, last 17.08.18 07:12:07 pm

Comments
16 comments



Log in!
You need to log in to be able to write comments!Log in
Yes. I fixed it. I was veri dumb, sorry for the inconvenience. I uploaded the latest version of the script. Hopefully there are no bugs anymore.
edited 1×, last 17.08.18 07:13:48 pm
17.08.18 05:49:27 pm
Ok so I used these script and found a bug in
1) Sometimes the player is not cuffed (script not works)
2) When we uncuff the player the cuff image is still there it doesn't removed
NOTE :- ABOVE OBSERVATIONS ARE TAKEN UNDER BOTS.
I think that you will fix this...BTW nice script
1) Sometimes the player is not cuffed (script not works)
2) When we uncuff the player the cuff image is still there it doesn't removed
NOTE :- ABOVE OBSERVATIONS ARE TAKEN UNDER BOTS.
I think that you will fix this...BTW nice script
Quote:
There's so many bugs, But it doesn't matter for me, Because i already have the original cuffs script, took it from jail's hoster.
You don't need to comment here just saying you don't need it.
There's so many bugs, But it doesn't matter for me, Because i already have the original cuffs script, took it from jail's hoster.
@
zAzz:
Try the updated version.
As for bug one, I tried to make everyone being cuffed switch to knife every second...

Try the updated version.
As for bug one, I tried to make everyone being cuffed switch to knife every second...

@
Talented Doge:
Bug 1: Try using Q to return to your knife once you're cuffed.. or maybe it has no effect on bots.
Bug2: When i killed a cuffed player
Bug3: When i quitted the server
--
I tried cuffing 2 bots and i could only cuff 1, is it a bug or maybe because i have 2 "addhook hit" on my map script?

Bug 1: Try using Q to return to your knife once you're cuffed.. or maybe it has no effect on bots.
Bug2: When i killed a cuffed player
Bug3: When i quitted the server
--
I tried cuffing 2 bots and i could only cuff 1, is it a bug or maybe because i have 2 "addhook hit" on my map script?
edited 1×, last 10.08.18 10:25:40 pm
I've fixed the discovered bug. Thanks for reporting.
@
2Gen: There are now. They have a handcuff script.
@


Funny script. I have not played on Jail servers for years. Previously, there was no special scripts.
@
Talented Doge:
CT leaving:
CT kills handcuffed T
P.S. Nice license
@

CT leaving:
Code:
1
2
3
4
2
3
4
LUA ERROR: sys/lua/autorun/handcuffs.lua:94: bad argument #1 to 'freeimage' (number expected, got nil)
-> [C]: in function 'freeimage'
-> sys/lua/autorun/handcuffs.lua:94: in function <sys/lua/autorun/handcuffs.lua:92>
-> in Lua hook 'leave', params: 1, 4
-> [C]: in function 'freeimage'
-> sys/lua/autorun/handcuffs.lua:94: in function <sys/lua/autorun/handcuffs.lua:92>
-> in Lua hook 'leave', params: 1, 4
CT kills handcuffed T
Code:
1
2
3
2
3
LUA ERROR: sys/lua/autorun/handcuffs.lua:64: table index is nil
-> sys/lua/autorun/handcuffs.lua:64: in function <sys/lua/autorun/handcuffs.lua:59>
-> in Lua hook 'die', params: 2, 1, 1, 603, 153, 0
-> sys/lua/autorun/handcuffs.lua:64: in function <sys/lua/autorun/handcuffs.lua:59>
-> in Lua hook 'die', params: 2, 1, 1, 603, 153, 0
P.S. Nice license
@
Talented Doge: For #2, you forgot to define die hook params or you thought you didn't need all of them but you left the 'v' var anyway. Which is nil.
For #3, I think it's very obvious since you can see the "Server Shutdown" right above the error in his comment. It's because you init the var as nil at the beginning but that doesn't mean the player will necessarily be cuffed, in other words, his table value is going to remain nil and not get an image id. Yet you'll call the freeimage function on it regardless whenever the player leaves.
This is why you always add

For #3, I think it's very obvious since you can see the "Server Shutdown" right above the error in his comment. It's because you init the var as nil at the beginning but that doesn't mean the player will necessarily be cuffed, in other words, his table value is going to remain nil and not get an image id. Yet you'll call the freeimage function on it regardless whenever the player leaves.
This is why you always add
if img ~= nil then
and freeimage(img) img = nil
everywhere when you work with CS2D images. Bug 1: I tried to make selecting other weapons as difficult as possible. Perhaps I should add return 1 for cuffed players...
Bug 2 & Bug 3: When does these occur?
Bug 2 & Bug 3: When does these occur?

Fuck yes! You don't know how much i waited for this, I fucking love you dude, thank you for making this
thank you, thank you, thank you, i'll use it in my jail
EDIT:
I found a bug; Somehow when you cuff a player, in this case i cuffed a bot, he switched to his knife while cuffed and killed me.
EDITx2:
EDIT x3


EDIT:
I found a bug; Somehow when you cuff a player, in this case i cuffed a bot, he switched to his knife while cuffed and killed me.
EDITx2:
Code:
1
2
3
2
3
LUA ERROR: maps/zAzz_Jail v1.9.lua:220: table index is nil
-> maps/zAzz_Jail v1.9.lua:220: in function <maps/zAzz_Jail v1.9.lua:215>
-> in Lua hook 'die', params: 2, 50, 0
-> maps/zAzz_Jail v1.9.lua:220: in function <maps/zAzz_Jail v1.9.lua:215>
-> in Lua hook 'die', params: 2, 50, 0
EDIT x3
Code:
1
2
3
4
5
6
2
3
4
5
6
Server Shutdown
LUA ERROR: maps/zAzz_Jail v1.9.lua:248: bad argument #1 to 'freeimage' (number expected, got nil)
-> [C]: in function 'freeimage'
-> maps/zAzz_Jail v1.9.lua:248: in function <maps/zAzz_Jail v1.9.lua:246>
-> in Lua hook 'leave', params: 1, 4
LUA ERROR: maps/zAzz_Jail v1.9.lua:248: bad argument #1 to 'freeimage' (number expected, got nil)
-> [C]: in function 'freeimage'
-> maps/zAzz_Jail v1.9.lua:248: in function <maps/zAzz_Jail v1.9.lua:246>
-> in Lua hook 'leave', params: 1, 4
edited 5×, last 10.08.18 03:53:00 am



