Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.69 KB | None | 0 0
  1. case "!p":
  2.                         if (Connections[GetConnIdx(MSO.UCID)].OutPits == 1 && Connections[GetConnIdx(MSO.UCID)].OfficerEnabled == true)
  3.                         {
  4.                             if (Connections[GetConnIdx(MSO.UCID)].Chaseing == false)
  5.                             {
  6.                                 #region initialize variables
  7.                                 int CopDistance = 100;
  8.                                 bool Found = false;
  9.                                 bool trocalado = false;
  10.                                 byte esquerdaT = 57;
  11.                                 byte direitaT = 57;
  12.                                 byte idclick = 5;
  13.                                 #endregion
  14.                                 insim.Send(new IS_BFN { Inst = 0, ClickID = 5, ClickMax = 31, UCID = MSO.UCID, ReqI = 0 });
  15.                                 Array.Clear(Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir, 0, Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir.Length);
  16.                                 Array.Clear(Connections[GetConnIdx(MSO.UCID)].UsuarioaLiberar, 0, Connections[GetConnIdx(MSO.UCID)].UsuarioaLiberar.Length);
  17.                                 Array.Clear(Connections[GetConnIdx(MSO.UCID)].UsuarioaMultar, 0, Connections[GetConnIdx(MSO.UCID)].UsuarioaMultar.Length);
  18.                                 insim.Send(new IS_BTN { Text = "", BStyle = ButtonStyles.ISB_DARK, H = 100, W = 70, T = 45, L = 65, ClickID = 25, UCID = MSO.UCID, ReqI = 2 });
  19.                                 insim.Send(new IS_BTN { Text = "", BStyle = ButtonStyles.ISB_DARK, H = 100, W = 70, T = 45, L = 65, ClickID = 26, UCID = MSO.UCID, ReqI = 2 });
  20.  
  21.                                 insim.Send(new IS_BTN { Text = "^6SELECIONE UM JOGADOR PROXIMO", BStyle = ButtonStyles.ISB_DARK, H = 8, W = 70, T = 47, L = 65, ClickID = 27, UCID = MSO.UCID, ReqI = 2 });
  22.                                 insim.Send(new IS_BTN { Text = "", BStyle = ButtonStyles.ISB_DARK, H = 9, W = 32, T = 145, L = 103, ClickID = 28, UCID = MSO.UCID, ReqI = 2 });
  23.                                 insim.Send(new IS_BTN { Text = "", BStyle = ButtonStyles.ISB_DARK, H = 9, W = 32, T = 145, L = 103, ClickID = 29, UCID = MSO.UCID, ReqI = 2 });
  24.                                 insim.Send(new IS_BTN { Text = "", BStyle = ButtonStyles.ISB_DARK, H = 9, W = 32, T = 145, L = 103, ClickID = 30, UCID = MSO.UCID, ReqI = 2 });
  25.                                 insim.Send(new IS_BTN { Text = "^3Fechar", BStyle = ButtonStyles.ISB_CLICK, H = 9, W = 32, T = 145, L = 103, ClickID = 31, UCID = MSO.UCID, ReqI = 2 });
  26.                                 int index = -1;
  27.                                 foreach (clsConnection C in Connections)
  28.                                 {
  29.                                     //insim.Send("/msg Usr:" + C.Username + " Enb:" + C.OfficerEnabled + " Out:" + C.OutPits + " Dist:" + Dist);
  30.                                     if (C.Username.ToLower() != Connections[GetConnIdx(MSO.UCID)].Username.ToLower() && C.OutPits == 1 && C.OfficerEnabled == false)
  31.                                     {
  32.                                         int Dist = ((int)Math.Sqrt(Math.Pow((Connections[GetConnIdx(MSO.UCID)].PosX / 196608) - (C.PosX / 196608), 2) + Math.Pow((Connections[GetConnIdx(MSO.UCID)].PosY / 196608) - (C.PosY / 196608), 2)) * 3);
  33.  
  34.                                         if (Dist <= CopDistance)
  35.                                         {
  36.                                             Found = true;
  37.                                             //PAINEL JOGADOR PROXIMO
  38.                                             #region Painel Jogador Proximo
  39.                                             index++;
  40.                                             // Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir.Add(C.UniqueID);
  41.  
  42.                                             if (trocalado == false)
  43.                                             {
  44.                                                 #region ESQUERDA
  45.                                                 insim.Send(new IS_BTN { Text = C.PlayerName, BStyle = ButtonStyles.ISB_CLICK | ButtonStyles.ISB_DARK, H = 9, W = 32, T = esquerdaT, L = 67, ClickID = idclick, UCID = MSO.UCID, ReqI = 40 });
  46.                                                 Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir[index] = C.UniqueID;
  47.                                                 esquerdaT += 10;
  48.                                                 trocalado = true;
  49.                                                 #endregion
  50.                                             }
  51.                                             else
  52.                                             {
  53.                                                 #region DIREITA
  54.                                                 insim.Send(new IS_BTN { Text = C.PlayerName, BStyle = ButtonStyles.ISB_CLICK | ButtonStyles.ISB_DARK, H = 9, W = 32, T = direitaT, L = 101, ClickID = idclick, UCID = MSO.UCID, ReqI = 2 });
  55.                                                 Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir[index] = C.UniqueID;
  56.                                                 direitaT += 10;
  57.                                                 trocalado = false;
  58.                                                 #endregion
  59.                                             }
  60.                                             idclick++;
  61.                                         }
  62.                                         #endregion
  63.                                     }
  64.  
  65.                                 }
  66.                                 //SE NAO TIVER NENHUM JOGADOR PROXIMO
  67.                                 #region ProxUser = nothing
  68.                                 if (Found == false)
  69.                                 {
  70.                                     insim.Send(new IS_MTC { Sound = MessageSound.SND_ERROR, Msg = "^1› ^7Nenhum jogador perto!", UCID = MSO.UCID, ReqI = 0 });
  71.                                 }
  72.                                 #endregion
  73.                             }
  74.                             else
  75.                             {
  76.                                 insim.Send(new IS_MTC { Sound = MessageSound.SND_MESSAGE, Msg = "^1› ^7Você ja está em uma perseguição!", UCID = MSO.UCID, ReqI = 0 });
  77.                             }
  78.                         }
  79.                         // Se não estiver ativo como COP
  80.                         #region OfficerEnabled = false
  81.                         else
  82.                         {
  83.                             insim.Send(new IS_MTC { Sound = MessageSound.SND_MESSAGE, Msg = "^1› ^7Você precisa ser um ^6policial ativo ^7para isso!", UCID = MSO.UCID, ReqI = 0 });
  84.                         }
  85.                         #endregion
  86.                         break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement