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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Nik_Rofid
      By Nik_Rofid
      Здравствуйте, можно ли на сервере копии радмира сделать так, что бы на машину можно было установить конкретный номер например ставится на машу рандом номер а будет х777хх77