Handcuffs
#1

Hey i did edit the cuff script. but now i have a problem..
I saw in a video if you are cuffed that you can walk away and stuff.
How do i fix that in my script ??

Please help me
Reply
#2

on the command freeze the player.
Reply
#3

I dunno if this will work best to try!
pawn Код:
if(pFrozen[playerid] && (keys & KEY_JUMP || keys & KEY_FIRE || updown != 0 || leftright != 0)) return 0;
Reply
#4

pawn Код:
CMD:cuff(playerid, params[])
{
    if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2))
    {
        if(GetPVarInt(playerid, "Injured") == 1)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
            return 1;
        }

        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if (ProxDetectorS(8.0, playerid, giveplayerid))
            {
                if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
                if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
                    {
                    format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid));
                    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
                    TogglePlayerControllable(giveplayerid, 0);
                    ClearAnimations(giveplayerid);
                    SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
                    SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,               -81.700035, 0.891999, 1.000000, 1.168000);
                    PlayerCuffed[giveplayerid] = 2;
                    SetPVarInt(giveplayerid, "PlayerCuffed", 2);
                    SetPVarInt(giveplayerid, "IsFrozen", 0);
                    //Frozen[giveplayerid] = 0;
                    PlayerCuffedTime[giveplayerid] = 300;
                }
                else
                {
                    SendClientMessageEx(playerid, COLOR_GREY, "That player isn't restrained!");
                    return 1;
                }
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
                return 1;
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
            return 1;
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
    }
    return 1;
}
CMD:uncuff(playerid, params[])
{
    if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pMember] == 8 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2))
    {
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /uncuff [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if (ProxDetectorS(8.0, playerid, giveplayerid))
            {
                if(PlayerInfo[giveplayerid][pJailed] >= 1)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE, "You can't uncuff a jailed player.");
                    return 1;
                }
                if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You can't uncuff yourself."); return 1; }
                if(PlayerCuffed[giveplayerid]>1)
                {
                    DeletePVar(giveplayerid, "IsFrozen");
                    format(string, sizeof(string), "* You have been uncuffed by %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* You uncuffed %s.", GetPlayerNameEx(giveplayerid));
                    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* %s has uncuffed %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
                    SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
                    TogglePlayerControllable(giveplayerid, 1);
                    ClearAnimations(giveplayerid);
                    PlayerCuffed[giveplayerid] = 0;
                    PlayerCuffedTime[playerid] = 0;
                    DeletePVar(giveplayerid, "PlayerCuffed");
                }
                else
                {
                    SendClientMessageEx(playerid, COLOR_GREY, "That player isn't cuffed.");
                    return 1;
                }
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
                return 1;
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
            return 1;
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
    }
    return 1;
}
Little Help ??
Maybe you find other things that needs to change in this commands
Reply
#5

pawn Код:
if(pFrozen[playerid] && (keys & KEY_JUMP || keys & KEY_FIRE || updown != 0 || leftright != 0)) return 0;
EDIT : Just set pFrozen to 1 when you freeze them, and 0 when unfrozen.
Reply
#6

No now the command is freezing and cuffing the player all you need
Edit: TogglePlayerControlable 0=freezed 1=unfreezed
Reply
#7

And if you uncuff the player you still see the cuffs
what is that ?
Reply
#8

Maybe a bug?

Or your script can we see??
Reply
#9

I use this same code for the cuff system but when i compile get this error undefined symbol "SPECIAL_ACTION_CUFFED"
Reply
#10

Quote:
Originally Posted by Just rp
Посмотреть сообщение
And if you uncuff the player you still see the cuffs
what is that ?
Destroy the cuff object.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)