SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 10/06/2012, 02:04 AM   #1
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,234
Reputation: 1004
Default cuffs.inc - Easily cuff players with object offsets for ALL skins! (Updated for 0.3.7)

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 Code:
#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 (http://forum.sa-mp.com/showthread.php?t=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.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!

Last edited by MP2; 02/06/2015 at 05:51 PM.
MP2 is offline   Reply With Quote
Old 10/06/2012, 02:05 AM   #2
Rg-Gaming.Info
Huge Clucker
 
Rg-Gaming.Info's Avatar
 
Join Date: Jan 2012
Location: Europe
Posts: 223
Reputation: 10
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Nice work.
Rg-Gaming.Info is offline   Reply With Quote
Old 10/06/2012, 02:21 AM   #3
Lorkm
Little Clucker
 
Join Date: Aug 2010
Posts: 28
Reputation: 2
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

nice, thanks dude
Lorkm is offline   Reply With Quote
Old 10/06/2012, 02:24 AM   #4
thefatshizms
High-roller
 
thefatshizms's Avatar
 
Join Date: Dec 2011
Location: England
Posts: 1,746
Reputation: 259
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Nice work
__________________
SFCNR ******* | SFCNR Forum
thefatshizms is offline   Reply With Quote
Old 10/06/2012, 03:57 AM   #5
paulor
High-roller
 
Join Date: Nov 2011
Location: Brasil
Posts: 3,116
Reputation: 222
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Thanks for the work!
__________________
Meus Projetos - contato@paulorwd.com.br
[IMG]https://sites.******.com/site/facesbypaulo/MetropoleGames.png[/IMG]
paulor is offline   Reply With Quote
Old 10/06/2012, 04:24 AM   #6
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,337
Reputation: 138
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Amazing script
__________________
nope[IMG]http://*******/1r0SOkH_[/IMG]
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Old 10/06/2012, 04:28 AM   #7
admantis
High-roller
 
Join Date: Sep 2009
Posts: 2,525
Reputation: 449
Default Respuesta: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

I'll keep the saving code, it's clever so it might be handy for me in the future
admantis is offline   Reply With Quote
Old 10/06/2012, 04:33 AM   #8
Littlehelper
Gangsta
 
Littlehelper's Avatar
 
Join Date: Nov 2011
Location: 420
Posts: 946
Reputation: 178
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Niice!
Now there's gonna be another admin command.
/cuff [playerid]
Littlehelper is offline   Reply With Quote
Old 10/06/2012, 08:42 AM   #9
zgintasz
Huge Clucker
 
Join Date: Oct 2011
Posts: 367
Reputation: 11
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Thanks, it's useful !
zgintasz is offline   Reply With Quote
Old 10/06/2012, 09:12 AM   #10
Dodo9655
Big Clucker
 
Dodo9655's Avatar
 
Join Date: Sep 2008
Location: Romania
Posts: 150
Reputation: 29
Default Re: Cuffs - Easy cuffed players. Cuff offsets for ALL skins!

Good job
Dodo9655 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] fban.inc -> Easily ban players for certain amount of time fiki574 Includes 16 26/07/2015 02:01 PM
Rotating offsets from center of object SimonItaly Scripting Help 5 01/08/2014 03:03 PM
EditAttachedObject Camera/Cuff Offsets admiralspeedy Scripting Help 1 11/07/2014 12:34 AM
Should cuffed players be able to cuff around? Georgi166 Everything and Nothing 9 16/05/2012 05:40 AM


All times are GMT. The time now is 04:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.