/cuff command for admins
#1

My mistake. Fixed!


https://sampforum.blast.hk/showthread.php?tid=371873

I didn't seen this post before.
Reply
#2

This is an advanced /cuff command for roleplay servers, you can easily edit it for administrators.

pawn Код:
CMD:cuff(playerid, params[])
{
    if(IsACop(playerid))
    {
        if(OnDuty[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not on Duty!");
            return 1;
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "   Can't use this while being in a car!");
            return 1;
        }
        if(IsPlayerBlocked(playerid))
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "   You can't do that right now!");
            return 1;
        }
        new giveplayerid;
        if(!sscanf(params, "u", giveplayerid))
        {
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "   You can't cuff yourself!");
                    return 1;
                }
                if(ProxDetectorS(8.0, playerid, giveplayerid))
                {
                    if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
                    {
                        new giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME];
                        giveplayer = PlayerNameEx(giveplayerid);
                        sendername = PlayerNameEx(playerid);
                        new string[128];
                        format(string, sizeof(string), "* You were cuffed by %s.", sendername);
                        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* You cuffed %s for %d minutes.", giveplayer, (CUFF_BREAK_TIME));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* %s hand cuffs %s.", sendername ,giveplayer);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
                        SetPlayerSpecialAction(giveplayerid, 0);
                        ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0);
                        TogglePlayerControllable(giveplayerid, 0);
                        PlayerCuffed[giveplayerid] = 2;
                        PlayerCuffedTime[giveplayerid] = 60 * CUFF_BREAK_TIME;
                        if(Mobile[playerid] != -1)
                        {
                            SetPlayerSpecialAction(Mobile[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
                            SendClientMessage(Mobile[playerid],  COLOR_GRAD2, "   The line just went dead....");
                            CellTime[Mobile[playerid]] = 0;
                            CellTime[playerid] = 0;
                            Mobile[Mobile[playerid]] = -1;
                            Mobile[playerid] = -1;
                        }
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "   That player isn't ready to be cuffed!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "   You are too far away!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "   Invalid player!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Cuff [playerid/PartOfName]");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not a cop!");
    }
    return 1;
}
Reply
#3

/cuff for admin! I thought for admins it's /freeze and /cuff is for Police Officers & US Army! o.O o.O
Please fix it, for cops
Reply
#4

Quote:
Originally Posted by Luke_James
Посмотреть сообщение
This is an advanced /cuff command for roleplay servers, you can easily edit it for administrators.

pawn Код:
CMD:cuff(playerid, params[])
{
    if(IsACop(playerid))
    {
        if(OnDuty[playerid] != 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not on Duty!");
            return 1;
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "   Can't use this while being in a car!");
            return 1;
        }
        if(IsPlayerBlocked(playerid))
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "   You can't do that right now!");
            return 1;
        }
        new giveplayerid;
        if(!sscanf(params, "u", giveplayerid))
        {
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "   You can't cuff yourself!");
                    return 1;
                }
                if(ProxDetectorS(8.0, playerid, giveplayerid))
                {
                    if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
                    {
                        new giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME];
                        giveplayer = PlayerNameEx(giveplayerid);
                        sendername = PlayerNameEx(playerid);
                        new string[128];
                        format(string, sizeof(string), "* You were cuffed by %s.", sendername);
                        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* You cuffed %s for %d minutes.", giveplayer, (CUFF_BREAK_TIME));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* %s hand cuffs %s.", sendername ,giveplayer);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
                        SetPlayerSpecialAction(giveplayerid, 0);
                        ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0);
                        TogglePlayerControllable(giveplayerid, 0);
                        PlayerCuffed[giveplayerid] = 2;
                        PlayerCuffedTime[giveplayerid] = 60 * CUFF_BREAK_TIME;
                        if(Mobile[playerid] != -1)
                        {
                            SetPlayerSpecialAction(Mobile[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
                            SendClientMessage(Mobile[playerid],  COLOR_GRAD2, "   The line just went dead....");
                            CellTime[Mobile[playerid]] = 0;
                            CellTime[playerid] = 0;
                            Mobile[Mobile[playerid]] = -1;
                            Mobile[playerid] = -1;
                        }
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "   That player isn't ready to be cuffed!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "   You are too far away!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "   Invalid player!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Cuff [playerid/PartOfName]");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not a cop!");
    }
    return 1;
}
Thanks for this. I could get other stuff that from this! +rep
Reply
#5

Quote:
Originally Posted by talkro
Посмотреть сообщение
/cuff for admin! I thought for admins it's /freeze and /cuff is for Police Officers & US Army! o.O o.O
Please fix it, for cops
I know.. I didn't say I will use it for cops and I have my own Ideas okay? Hope you understand. And /freeze is an old command FOR ME. You'll just look like nailed. Cuff with animation are cool and real.
Reply
#6

Umm, Ok Btw nice/
good job dude!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)