[Include] cuffs.inc - Easily cuff players with object offsets for ALL skins! (Updated for 0.3.7)
#1

I needed this for my server, so I manually went through all 300+ skins and saved offsets for the cuffs object. It took around 30 minutes and I decided to release it to save other people having to do the same. Not only does it have offsets, it comes with an entire system for cuffing and un-cuffing players, with one function, handling the attached object internally, so you don't have to worry about that. It also prevents players from jumping while cuffed, as demonstrated below:

[ame]http://www.youtube.com/watch?v=8GPaMTDDprI[/ame]

To allow jumping while cuffed, define 'CUFFS_ALLOW_JUMP' before including the include, like so:

pawn Код:
#define CUFFS_ALLOW_JUMP
#include <cuffs>
This is the script I used to save the positions, if you're interested: http://pastebin.com/XPvmKxqT

Then I made a simple include to attach cuffs with a single function - SetPlayerCuffed.

All went well but some of the positions are off. I saved them all as best as I could, but some are a bit off. Some skins (most female ones) are impossible to put the cuffs around, as their arms are literally touching each other with no space in-between. If any skins need seriously re-positioning, let me know.

Set a player cuffed:
SetPlayerCuffed(playerid);
or
SetPlayerCuffed(playerid, true);

It defaults to true if no second parameter is entered.

Set a player un-cuffed:
SetPlayerCuffed(playerid, false);

Check if a player is cuffed:
IsPlayerCuffed(playerid)

DOWNLOAD AND INSTALL
http://pastebin.com/9Ht1jEHP

- Save the above pastebin as cuffs.inc
- Place it in your pawno 'include' folder
- Add the following somewhere under '#include <a_samp>': '#include <cuffs>'
- Download YSI (https://sampforum.blast.hk/showthread.php?tid=570884)
- Put the YSI includes in your pawno 'include' folder

CHANGELOG
1.1 - 17/04/2015
- Re-saved all cuff offsets for all skins
- 0.3.7 fixes some skins' cuff animation, so the offsets needed re-saving

1.0.2 - 11/03/2014
- Players no longer automatically uncuffed on respawn. It should be up to the scripter.
- Various code cleanups (SetPlayerCuffed uses a boolean now).
- PVar is now deleted when no longer needed.
- Changed 'CUFFS_ALLOW_JUMP' defining method. See above.
- Fixed a couple of potentially-serious bugs.

1.0.1 - 16/02/2013:
- Players now automatically uncuffed on respawn

1.0 - 1/01/2013 (not sure of exact date)
- Initial release

If any offsets need altering or you find any bugs or have a suggestion, please let me know in this topic or via PM.
Reply
#2

Nice work.
Reply
#3

nice, thanks dude
Reply
#4

Nice work
Reply
#5

Thanks for the work!
Reply
#6

Amazing script
Reply
#7

I'll keep the saving code, it's clever so it might be handy for me in the future
Reply
#8

Niice!
Now there's gonna be another admin command.
/cuff [playerid]
Reply
#9

Thanks, it's useful !
Reply
#10

Good job
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)