/cuff command for admins
#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


Messages In This Thread
/cuff command for admins - by kbalor - 27.08.2012, 14:03
Re: /cuff command for admins - by Luke_James - 27.08.2012, 14:18
Re: /cuff command for admins - by DeadLy™ - 27.08.2012, 14:20
Re: /cuff command for admins - by kbalor - 27.08.2012, 14:21
Re: /cuff command for admins - by kbalor - 27.08.2012, 14:29
Re: /cuff command for admins - by DeadLy™ - 27.08.2012, 14:33

Forum Jump:


Users browsing this thread: 3 Guest(s)