Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.52 KB | None | 0 0
  1.  #region Teleport to User
  2.                         if (Connections[GetConnIdx(BTC.UCID)].UserTeleport != "")
  3.                         {
  4.                             bool found = false;
  5.                             foreach (clsConnection teleport in Connections)
  6.                             {
  7.                                 if (teleport.Username.ToLower() == Connections[GetConnIdx(BTC.UCID)].UserTeleport.ToLower() && teleport.OutPits == 1)
  8.                                 {
  9.                                     found = true;
  10.                                     teleport.ResRspH = Convert.ToByte((((teleport.PosHeading) / 256) + 128) % 256);
  11.                                     teleport.ResRspZ = Convert.ToByte((((teleport.PosZ)) / 65536));
  12.                                     double towheading = (Math.PI / 180) * ((teleport.PosHeading / 182) - 90);
  13.                                     teleport.ResRspX = Convert.ToInt16((((teleport.PosX)) / 4096) + 100 * Math.Cos(towheading));
  14.                                     teleport.ResRspY = Convert.ToInt16((((teleport.PosY)) / 4096) + 100 * Math.Sin(towheading));
  15.                                     insim.Send(new IS_JRR { JRRAction = JrrAction.JRR_RESET_NO_REPAIR, PLID = Connections[GetConnIdx(BTC.UCID)].PlayerID, StartPos = { Heading = teleport.ResRspH, X = teleport.ResRspX, Y = teleport.ResRspY, Zbyte = teleport.ResRspZ, Index = 0, Flags = 128 } });
  16.  
  17.                                     insim.Send(new IS_MTC { Sound = MessageSound.SND_MESSAGE, Msg = "^1› ^7Você foi teleportado para ^3" + teleport.Username.ToLower() + "^7!", UCID = BTC.UCID, ReqI = 0 });
  18.                                     AdminLogToDB(Connections[GetConnIdx(BTC.UCID)].Username, Connections[GetConnIdx(BTC.UCID)].Username + " teleportou-se para " + teleport.Username, 3);
  19.                                 }
  20.                             }
  21.                             if (!found)
  22.                             {
  23.                                 insim.Send(new IS_MTC { Sound = MessageSound.SND_ERROR, Msg = "^1› ^7Username para teleportar inválido!", UCID = BTC.UCID, ReqI = 0 });
  24.                             }
  25.                             #region Clear
  26.                             Connections[GetConnIdx(BTC.UCID)].UserTeleport = "";
  27.                             Connections[GetConnIdx(BTC.UCID)].User1Teleport = "";
  28.                             Connections[GetConnIdx(BTC.UCID)].User2Teleport = "";
  29.                             Connections[GetConnIdx(BTC.UCID)].XTeleport = 0;
  30.                             Connections[GetConnIdx(BTC.UCID)].YTeleport = 0;
  31.                             Connections[GetConnIdx(BTC.UCID)].ZTeleport = 0;
  32.                             insim.Send(new IS_BTN { Text = "^7Teleport < Username1 > to<Username2>", Caption = "^7username1 to username2", BStyle = ButtonStyles.ISB_CLICK, H = 5, W = 31, T = 122, L = 114, ClickID = 58, TypeIn = 40, UCID = BTC.UCID, ReqI = 2 }); //TeleportUser1toUser2
  33.                             insim.Send(new IS_BTN { Text = "^7Teleport to User / Teleportar para Usuario", Caption = "^7Username", BStyle = ButtonStyles.ISB_CLICK, H = 5, W = 31, T = 113, L = 114, ClickID = 82, TypeIn = 40, UCID = BTC.UCID, ReqI = 2 }); //TeleportUser
  34.                             insim.Send(new IS_BTN { Text = "^7Teleport to<X> < Y > < Z >", BStyle = ButtonStyles.ISB_CLICK, Caption = "^7X Y Z", H = 5, W = 31, T = 131, L = 114, ClickID = 83, TypeIn = 40, UCID = BTC.UCID, ReqI = 2 }); //TeleportCoordinatesCLICK
  35.                             #endregion
  36.                         }
  37.                         #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement