SA-MP Forums Archive
[FilterScript] 0.3e Cuffed system V2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] 0.3e Cuffed system V2 (/showthread.php?tid=367237)



[UPDATED] 0.3e Cuffed system, with object *V3* - LocMax - 09.08.2012

Well this is V3 of the cuffing system

What's new?
If you try to jump while cuffed, you'll fall down on floor
If you try to sprint while cuffed, you'll fall down on floor
*Added in V3* Added cool sound when you get /cuffed, /uncuffed
*Added in V3* Added text when you cuff, uncuff


How does it work? / Commands?
/cuffed = will cuff you and will add cuff object on your hands
/uncuff = will remove cuffs object and will get your hands normal again


Screenie:


Download

V2
http://pastebin.com/yCCkBYk8
http://www.mediafire.com/?9bx340ta7spi86i

V3
http://pastebin.com/Bdb4m4Tw


Re: 0.3e Cuffed system V2 - [TC]XxJuggaloxX - 09.08.2012

C:\Users\Seb\0.3e Server-Script\gamemodes\fgg.pwn(10966) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED"
C:\Users\Seb\0.3e Server-Script\gamemodes\fgg.pwn(10967) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED"
C:\Users\Seb\0.3e Server-Script\gamemodes\fgg.pwn(24889) : error 017: undefined symbol "SPECIAL_ACTION_CUFFED"


Re: 0.3e Cuffed system V2 - DartakousLien - 09.08.2012

update your includes
in "a_players" you can see this
pawn Code:
#define SPECIAL_ACTION_CUFFED           24
@TOPIC
good work, nice for rp server and a beginner in pawn


Re: 0.3e Cuffed system V2 - Syntax - 09.08.2012

Is there a zCMD + SSCANF version of this?


Re: 0.3e Cuffed system V2 - LocMax - 09.08.2012

I can make ZCMD one?

At the top
Code:
#include <a_samp>
#include <zcmd>
Anywhere
Code:
CMD:cuff(playerid,params[])
{
    SendClientMessage(playerid, 0xFF0000AA, "* You are now cuffed.");
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
	SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
	return 1;
}
CMD:uncuff(playerid,params[])
{
    SendClientMessage(playerid, 0xFF0000AA, "* You are now uncuffed.");
    for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
    if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    return 1;
}
Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
    if(newkeys & KEY_SPRINT && !(oldkeys & KEY_SPRINT) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
	return 1;
}
I think this should work, didn't test though


Re: 0.3e Cuffed system V2 - Gangs_Rocks - 09.08.2012

sscanf version to use this on targets :

pawn Code:
CMD:cuff(playerid,params[])
{
    new targetid, reason;
    if(!sscanf(params, "us[40]", targetid, reason))
    {
        SendClientMessage(targetid, 0xFF0000AA, "* You are now cuffed.");
        SetPlayerSpecialAction(targetid, SPECIAL_ACTION_CUFFED);
        SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
        SendClientMessage(playerid, 0xFF0000, "Target cuffed");
    }
    else return SendClientMessage(playerid, 0xFF0000AA, "[ERROR]Usage: /cuff [ID] [REASON] ");
    return 1;
}
CMD:uncuff(playerid,params[])
{
    new targetid;
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] /uncuff [ID] ");
    for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(targetid, i))
        {
            SendClientMessage(targetid, 0xF0000AA, "UNCUFFED! ");
            SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
            RemovePlayerAttachedObject(playerid, i);
        }
        else return 0;
    }
    return 1;
}

Though it's buggy. Unreal. I'll make a more accurate one if I have more time.

@Loc, Use IsPlayerInRangeOfPoint(targetid, playerX,playerY,playerZ); to make it RP style.

++++ Use a goddamn variable to avoid problems.


Re: 0.3e Cuffed system V2 - LocMax - 09.08.2012

It was actually made to be animation and everyone to use it..


Re: 0.3e Cuffed system V2 - Ben_Gale - 09.08.2012

Ncie for a first