SA-MP Forums Archive
Cuff 0.3e - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cuff 0.3e (/showthread.php?tid=335988)



Cuff 0.3e - N0FeaR - 20.04.2012

What is the call back for new cuff system, or is there any fs for that?


Re: Cuff 0.3e - fordawinzz - 20.04.2012

there isn't any filterscript. it was added a new object and a new animation: SPECIAL_ACTION_CUFFED.


Re: Cuff 0.3e - N0FeaR - 20.04.2012

Now i got a problem look whats happend when someone get cuffed and the hands not going behind







the cmds
pawn Код:
}
    if(strcmp(cmd, "/cuff", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pFaction] == 3)
            {
                if(CopOnDuty[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You are not on duty");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /cuff [playerid]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(PlayerCuffed[giveplayerid] == 1)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "That player is already cuffed");
                            return 1;
                        }
                        if(giveplayerid == playerid)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "You can not cuff yourself");
                            return 1;
                        }
                        if(ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            format(string, sizeof(string), "You have been cuffed by %s", GetPlayerNameEx(playerid));
                            SendClientMessage(giveplayerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "You have cuffed %s", GetPlayerNameEx(giveplayerid));
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            PlayerCuffed[giveplayerid] = 1;
                            SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
                            TogglePlayerControllable(giveplayerid, 0);
                            PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"cuffs");
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "That player is not in range");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Invalid faction");
            }
        }
        return 1;



Re: Cuff 0.3e - rati555 - 20.04.2012

pawn Код:
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);



Re: Cuff 0.3e - N0FeaR - 20.04.2012

Quote:
Originally Posted by rati555
Посмотреть сообщение
pawn Код:
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
And the code for remove the object and hand on his back when i uncuff?


Re: Cuff 0.3e - HazardGaming - 20.04.2012

RemoveAnimations(playerid);


Re: Cuff 0.3e - rati555 - 20.04.2012

pawn Код:
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
if(IsPlayerAttachedObjectSlotUsed(giveplayerid,0)) RemovePlayerAttachedObject(giveplayerid,0);



Re: Cuff 0.3e - N0FeaR - 20.04.2012

One more thing is there anyway i can script so i falling when i cuffed and try to jump?


Re: Cuff 0.3e - rati555 - 20.04.2012

pawn Код:
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);



Re: Cuff 0.3e - N0FeaR - 20.04.2012

Thank you guys +rep