1 post in this topic

Одеть ,снять наручники.

Спойлер

else if(strcmp(cmd, "/cuff", true) == 0)
    {
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 21)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "::: Ведите: /cuff [id]");
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(IsACop(giveplayerid)) return    SendClientMessage(playerid, COLOR_GREY, "Вы не можете надеть наручники на законника !");
                        if(PlayerCuffed[giveplayerid] > 0) return    SendClientMessage(playerid, COLOR_GREY, "игрок уже в наручниках!");
                        if (ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Вы не можете надеть наручники на самого себя!"); return 1; }
                            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 21 || IsAArm(playerid))
                            {
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, sizeof(string), "На вас надел(а) наручники %s.", sendername);
                                SendClientMessage(giveplayerid, 0x6495EDFF, string);
                                format(string, sizeof(string), "Вы надели наручники на %s.", giveplayer);
                                SendClientMessage(playerid, 0x6495EDFF, string);
                                format(string, sizeof(string), "%s надел(а) на %s наручники.", sendername ,giveplayer);
                                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);
                                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                TogglePlayerControllable(giveplayerid, 0);
                                PlayerCuffed[giveplayerid] = 2;
                                PlayerCuffedTime[giveplayerid] = 3600;
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_GREY, "Вы не законник!!!");
                                return 1;
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "Рядом с вами никого нет !");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "Игрок оффлайн!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Вы не сотрудник правохранительных органов !");
            }
        return 1;
    } 
else if(strcmp(cmd, "/uncuff", true) == 0)
    {
            if(PlayerInfo[playerid][pMember] == 2 || IsACop(playerid)||IsAArm(playerid) )
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))return SendClientMessage(playerid, COLOR_WHITE, "::: Введите: /uncuff [id]");
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if (ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Вы не можете надеть наручники на самого себя!"); return 1; }
                            if(PlayerCuffed[giveplayerid])
                            {
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, sizeof(string), "С вас снял наручники %s.", sendername);
                                SendClientMessage(giveplayerid, 0x6495EDFF, string);
                                format(string, sizeof(string), "Вы сняли наручники с %s.", giveplayer);
                                SendClientMessage(playerid, 0x6495EDFF, string);
                                SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                                RemovePlayerAttachedObject(giveplayerid,0);
                                TogglePlayerControllable(giveplayerid, 1);
                                PlayerCuffed[giveplayerid] = 0;
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_GREY, "Игрок не в наручнеках !");
                                return 1;
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "Рядом никого нет !");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "{DB7093} [Ошибка]: {D3D3D3} Игрок не найден!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Вы не агент ФБР!");
            }
        return 1;
    }

 

 

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

Loading...
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Roman_Zimin
      By Roman_Zimin
      Здравствуйте, подскажите или направьте на тему, мне нужна такая функция чтобы при нажатии на тексдрав вызывалась нажатие кнопки например Q. Можно ли как то реализовать?