Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case "!p":
- if (Connections[GetConnIdx(MSO.UCID)].OutPits == 1 && Connections[GetConnIdx(MSO.UCID)].OfficerEnabled == true)
- {
- if (Connections[GetConnIdx(MSO.UCID)].Chaseing == false)
- {
- #region initialize variables
- int CopDistance = 100;
- bool Found = false;
- bool trocalado = false;
- byte esquerdaT = 57;
- byte direitaT = 57;
- byte idclick = 5;
- #endregion
- insim.Send(new IS_BFN { Inst = 0, ClickID = 5, ClickMax = 31, UCID = MSO.UCID, ReqI = 0 });
- Array.Clear(Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir, 0, Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir.Length);
- Array.Clear(Connections[GetConnIdx(MSO.UCID)].UsuarioaLiberar, 0, Connections[GetConnIdx(MSO.UCID)].UsuarioaLiberar.Length);
- Array.Clear(Connections[GetConnIdx(MSO.UCID)].UsuarioaMultar, 0, Connections[GetConnIdx(MSO.UCID)].UsuarioaMultar.Length);
- 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 });
- 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 });
- 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 });
- 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 });
- 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 });
- 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 });
- 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 });
- int index = -1;
- foreach (clsConnection C in Connections)
- {
- //insim.Send("/msg Usr:" + C.Username + " Enb:" + C.OfficerEnabled + " Out:" + C.OutPits + " Dist:" + Dist);
- if (C.Username.ToLower() != Connections[GetConnIdx(MSO.UCID)].Username.ToLower() && C.OutPits == 1 && C.OfficerEnabled == false)
- {
- 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);
- if (Dist <= CopDistance)
- {
- Found = true;
- //PAINEL JOGADOR PROXIMO
- #region Painel Jogador Proximo
- index++;
- // Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir.Add(C.UniqueID);
- if (trocalado == false)
- {
- #region ESQUERDA
- 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 });
- Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir[index] = C.UniqueID;
- esquerdaT += 10;
- trocalado = true;
- #endregion
- }
- else
- {
- #region DIREITA
- 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 });
- Connections[GetConnIdx(MSO.UCID)].UsuarioaPerseguir[index] = C.UniqueID;
- direitaT += 10;
- trocalado = false;
- #endregion
- }
- idclick++;
- }
- #endregion
- }
- }
- //SE NAO TIVER NENHUM JOGADOR PROXIMO
- #region ProxUser = nothing
- if (Found == false)
- {
- insim.Send(new IS_MTC { Sound = MessageSound.SND_ERROR, Msg = "^1› ^7Nenhum jogador perto!", UCID = MSO.UCID, ReqI = 0 });
- }
- #endregion
- }
- else
- {
- insim.Send(new IS_MTC { Sound = MessageSound.SND_MESSAGE, Msg = "^1› ^7Você ja está em uma perseguição!", UCID = MSO.UCID, ReqI = 0 });
- }
- }
- // Se não estiver ativo como COP
- #region OfficerEnabled = false
- else
- {
- insim.Send(new IS_MTC { Sound = MessageSound.SND_MESSAGE, Msg = "^1› ^7Você precisa ser um ^6policial ativo ^7para isso!", UCID = MSO.UCID, ReqI = 0 });
- }
- #endregion
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement