[Help] Cuff command
#1

Ok , so i made this command . But i have a problem . If you tipe /cuff you cuff yourself , and i want to cuff a player that is in that radius . How to fix that ?

Command :
pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /cuff [playerid]");
        }
        giveplayerid = strval(tmp);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
        {
            if(PlayerToPoint(7.5, giveplayerid, x , y, z))
            {
                if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2 && IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 104)
                {
                    format(string, sizeof(string), "Officer %s has cuffed (suspect) %s", PlayerName[playerid], PlayerName[giveplayerid]);
                    SendClientMessageToAll(COLOR_BLUE, string);
                    TogglePlayerControllable(giveplayerid, false);
                    return 1;
                }

                else
                {
                    SendClientMessage(playerid, COLOR_RED, "You could not cuff an officer that follows the law to.");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "That playerid is not close (enough) to you!");
            }

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops team.");
        }
        return 1;
    }
Reply


Messages In This Thread
[Help] Cuff command - by [Aka]Dragonu - 01.12.2010, 19:13
Re: [Help] Cuff command - by Jochemd - 01.12.2010, 19:17
Re: [Help] Cuff command - by [Aka]Dragonu - 01.12.2010, 19:18
Re: [Help] Cuff command - by Jochemd - 01.12.2010, 19:35
Re: [Help] Cuff command - by [Aka]Dragonu - 01.12.2010, 19:39
Re: [Help] Cuff command - by 6d - 01.12.2010, 19:53
Re: [Help] Cuff command - by Mokerr - 01.12.2010, 19:54
Re: [Help] Cuff command - by [Aka]Dragonu - 02.12.2010, 05:43
Re: [Help] Cuff command - by Mokerr - 02.12.2010, 09:21
Re: [Help] Cuff command - by SkizzoTrick - 02.12.2010, 11:08

Forum Jump:


Users browsing this thread: 1 Guest(s)