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

Looking for the new cuff + uncuff commands for 0.3e +REP if they work! They must be for zcmd.

Quote:
Originally Posted by Redex
Посмотреть сообщение
/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;
}
Reply
#2

Here but is not zcmd but you can trans it to zcmd

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);
                            SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
                            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;
    }
    if(strcmp(cmd, "/uncuff", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pFaction] == 1|| PlayerInfo[playerid][pFaction] == 0)
            {
                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: /uncuff [playerid]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(PlayerCuffed[giveplayerid] == 0)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "That player is not cuffed");
                            return 1;
                        }
                        if(giveplayerid == playerid)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "You can not uncuff yourself");
                            return 1;
                        }
                        if(ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            format(string, sizeof(string), "You have been uncuffed by %s", GetPlayerNameEx(playerid));
                            SendClientMessage(giveplayerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "You have uncuffed %s", GetPlayerNameEx(giveplayerid));
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            PlayerCuffed[giveplayerid] = 0;
                            SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                            RemovePlayerAttachedObject(giveplayerid,0);
                            PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"uncuffs");
                        }
                        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;
Reply
#3

Don't have a clue how to trans it. lol
Reply
#4

Quote:
Originally Posted by Redex
Посмотреть сообщение
Don't have a clue how to trans it. lol
Well, i'm kinda tired right now, but tomorrow i can help you, if you don't find anyone else.
Reply
#5

Frankly if you cant be fucked to put CMD:cuff... where he has used strcmp, you dont even deserve to own a script nor a server. If you cant be botherd to do a simple task no one on these forums should help you, why should they when you cant be fuc,ked to help yourself? Oh and in the future use ****** jack ass
Reply
#6

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Frankly if you cant be fucked to put CMD:cuff... where he has used strcmp, you dont even deserve to own a script nor a server. If you cant be botherd to do a simple task no one on these forums should help you, why should they when you cant be fuc,ked to help yourself? Oh and in the future use ****** jack ass
I've went on ****** and searched for it, a couple results did come up and I have taken a look at them, but all I got from it was errors. I shouldn't need to establish this, but apparently you're too stupid to realize that I am new to scripting. There is a first for everybody, right? I wouldn't be able to convert it, if I was able to I would've done it myself, but I don't know anything about strcmp, I only know little about zcmd. I know for a fact if I just change it to "cmd:cuff" I will just get errors, so you're quite frankly an idiot for not realizing im new to scripting and that I don't know how to do it. You shouldn't just assume I know how to script. So don't bitch at me if you don't know the facts.
Reply
#7

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Frankly if you cant be fucked to put CMD:cuff... where he has used strcmp, you dont even deserve to own a script nor a server. If you cant be botherd to do a simple task no one on these forums should help you, why should they when you cant be fuc,ked to help yourself? Oh and in the future use ****** jack ass
Hey hey, woah calm down buddy, you seem the only one who's pissed, give the guy a break jesus..
Reply
#8

pawn Код:
CMD:cuff(playerid, params[])
{
    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);
                        SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
                        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;
}


CMD:uncuff(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pFaction] == 1|| PlayerInfo[playerid][pFaction] == 0)
        {
            if(CopOnDuty[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not on duty");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                endClientMessage(playerid, COLOR_GRAD2, "USAGE: /uncuff [playerid]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(PlayerCuffed[giveplayerid] == 0)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "That player is not cuffed");
                        return 1;
                    }
                    if(giveplayerid == playerid)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You can not uncuff yourself");
                        return 1;
                    }
                    if(ProxDetectorS(8.0, playerid, giveplayerid))
                    {
                        format(string, sizeof(string), "You have been uncuffed by %s", GetPlayerNameEx(playerid));
                        SendClientMessage(giveplayerid, COLOR_WHITE, string);
                        format(string, sizeof(string), "You have uncuffed %s", GetPlayerNameEx(giveplayerid));
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        PlayerCuffed[giveplayerid] = 0;
                        SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                        RemovePlayerAttachedObject(giveplayerid,0);
                        PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"uncuffs");
                    }
                    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;
}
Felt like converting it for you. Not that hard, but like you said, you're a beginner.

@IceCube!: Like he said, he's a beginner. Don't expect everyone to know how to script. Quite frankly, when I began scripting, I had absolutely NO idea what strcmp was, ZCMD was, mysql, I didn't know any of these. If you were to use common sense before posting, the world would be a better place.


Have fun, hope I helped,
Kindred.

PS: If the script doesn't work, it's because NoFeaR didn't do it correctly, or frankly because none of the things are defined in your script ((For example, the CopOnDuty thing. You never showed any code, so you will have to define this yourself, unless he decides to show some code for it))

PS2: I think something may have been indented wrongly, I had to re-indent everything because I hated the non-indented script NoFeaR provided. Simply re-indent it if it says loose indention.
Reply
#9

If you have it already on zCmd.
just add this on cmd '/cuff'.
pawn Код:
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
                            SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
                            PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"cuffs");
pawn Код:
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                            RemovePlayerAttachedObject(giveplayerid,0);
                            PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"uncuffs");
EDIT: Oh someone already converted it for you.
================================================== =========


Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Frankly if you cant be fucked to put CMD:cuff... where he has used strcmp, you dont even deserve to own a script nor a server. If you cant be botherd to do a simple task no one on these forums should help you, why should they when you cant be fuc,ked to help yourself? Oh and in the future use ****** jack ass
What you did here? I don't see the point of you pфsting here, why even bothering? you didn't help with nothing, but talking much and blablabling and just raising the amount of posts on this thread, look at me i'm Mr.Smartass, best scripter, ey pal get down from there, like you knew what a filterscript is when you first started...
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)