[Help] 0.3e cuffing +REP [zcmd]
#10

I wasn't thinking when I posted the thread about adding the commands into it, but anyways..

I tried the suggestions on both posts, I couldn't seem to get it working.

/cuff command:
pawn Код:
CMD:cuff(playerid, params[]) {

    new
        string[128],
        playerName[2][MAX_PLAYER_NAME],
        target,
        Float:Pos[3];

    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 1) return SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");

    else if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/cuff [playerid]");

    else if(target == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't cuff yourself.");

    else {
        if(IsPlayerInRangeOfPlayer(playerid, target, 3.0)) {
            if(playerVariables[target][pFreezeType] == 5 || playerVariables[target][pFreezeType] == 1 || (GetPlayerSpecialAction(target) == SPECIAL_ACTION_HANDSUP && playerVariables[target][pFreezeType] == 0) || playerVariables[target][pFreezeType] == 4) { // CAN NEVAR BE EXPLOITED!1 Means admin-frozen people can't be exploited out with cuffs.

                GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
                GetPlayerName(target, playerName[1], MAX_PLAYER_NAME);

                TogglePlayerControllable(target, 0);
                playerVariables[target][pFreezeTime] = 900;
                playerVariables[target][pFreezeType] = 2;
                GameTextForPlayer(target,"~n~~r~Handcuffed!",4000,4);

                GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);

                format(string, sizeof(string), "* %s has handcuffed %s.", playerName[0], playerName[1]);
                nearByMessage(playerid, COLOR_PURPLE, string);
                format(string, sizeof(string),"You have handcuffed %s.", playerName[1]);
                SendClientMessage(playerid, COLOR_NICESKY, string);

                PlayerPlaySoundEx(1145, Pos[0], Pos[1], Pos[2]);
                ApplyAnimation(target, "PED", "cower", 1, 1, 0, 0, 0, 0, 1);
            }
            else SendClientMessage(playerid, COLOR_GREY, "That person must first be subdued, or have their hands up.");
        }
        else SendClientMessage(playerid, COLOR_GREY, "You're too far away.");
    }
    return 1;
}
/uncuff command:
pawn Код:
CMD:uncuff(playerid, params[]) {
    new
        string[128],
        playerName[2][MAX_PLAYER_NAME],
        target;

    if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/uncuff [playerid]");

    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 1) {
        SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
    }

    else if(target == playerid) SendClientMessage(playerid, COLOR_GREY, "You can't uncuff yourself.");

    else {
        if(IsPlayerInRangeOfPlayer(playerid, target, 4.0)) {
            if(playerVariables[target][pFreezeType] == 2) {

                GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
                GetPlayerName(target, playerName[1], MAX_PLAYER_NAME);

                playerVariables[target][pFreezeTime] = 0;
                playerVariables[target][pFreezeType] = 0;

                TogglePlayerControllable(target, 1);
                PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
                ClearAnimations(target);
                ApplyAnimation(target, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
                GameTextForPlayer(target,"~n~~g~Uncuffed!",4000,4);

                format(string, sizeof(string), "* %s has uncuffed %s.", playerName[0], playerName[1]);
                nearByMessage(playerid, COLOR_PURPLE, string);
                format(string, sizeof(string),"You have uncuffed %s.", playerName[1]);
                SendClientMessage(playerid, COLOR_NICESKY, string);
                PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);

                if(playerVariables[target][pDrag] != -1) {
                    format(string, sizeof(string), "You have stopped dragging %s.", playerName[1]);
                    SendClientMessage(playerid, COLOR_WHITE, string);

                    playerVariables[target][pDrag] = -1;

                    format(string, sizeof(string), "* %s has stopped dragging %s, releasing their grip.", playerName[0], playerName[1]);

                    return nearByMessage(playerid, COLOR_PURPLE, string);
                }
            }
            else SendClientMessage(playerid, COLOR_GREY, "That person is not cuffed.");
        }
    }
    return 1;
}
Any help appreciated!
Reply


Messages In This Thread
[Help] 0.3e cuffing +REP [zcmd] - by Redex - 10.05.2012, 21:54
Re: [Help] 0.3e cuffing +REP [zcmd] - by N0FeaR - 10.05.2012, 22:17
Re: [Help] 0.3e cuffing +REP [zcmd] - by Redex - 10.05.2012, 22:35
Re: [Help] 0.3e cuffing +REP [zcmd] - by N0FeaR - 10.05.2012, 22:37
Re: [Help] 0.3e cuffing +REP [zcmd] - by IceCube! - 10.05.2012, 22:49
Re: [Help] 0.3e cuffing +REP [zcmd] - by Redex - 11.05.2012, 00:45
Re: [Help] 0.3e cuffing +REP [zcmd] - by [D]Stanley - 11.05.2012, 01:02
Re: [Help] 0.3e cuffing +REP [zcmd] - by Kindred - 11.05.2012, 01:06
Re: [Help] 0.3e cuffing +REP [zcmd] - by Issam - 11.05.2012, 01:08
Re: [Help] 0.3e cuffing +REP [zcmd] - by Redex - 11.05.2012, 01:19

Forum Jump:


Users browsing this thread: 1 Guest(s)