Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Teleport to User
- if (Connections[GetConnIdx(BTC.UCID)].UserTeleport != "")
- {
- bool found = false;
- foreach (clsConnection teleport in Connections)
- {
- if (teleport.Username.ToLower() == Connections[GetConnIdx(BTC.UCID)].UserTeleport.ToLower() && teleport.OutPits == 1)
- {
- found = true;
- teleport.ResRspH = Convert.ToByte((((teleport.PosHeading) / 256) + 128) % 256);
- teleport.ResRspZ = Convert.ToByte((((teleport.PosZ)) / 65536));
- double towheading = (Math.PI / 180) * ((teleport.PosHeading / 182) - 90);
- teleport.ResRspX = Convert.ToInt16((((teleport.PosX)) / 4096) + 100 * Math.Cos(towheading));
- teleport.ResRspY = Convert.ToInt16((((teleport.PosY)) / 4096) + 100 * Math.Sin(towheading));
- 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 } });
- 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 });
- AdminLogToDB(Connections[GetConnIdx(BTC.UCID)].Username, Connections[GetConnIdx(BTC.UCID)].Username + " teleportou-se para " + teleport.Username, 3);
- }
- }
- if (!found)
- {
- insim.Send(new IS_MTC { Sound = MessageSound.SND_ERROR, Msg = "^1› ^7Username para teleportar inválido!", UCID = BTC.UCID, ReqI = 0 });
- }
- #region Clear
- Connections[GetConnIdx(BTC.UCID)].UserTeleport = "";
- Connections[GetConnIdx(BTC.UCID)].User1Teleport = "";
- Connections[GetConnIdx(BTC.UCID)].User2Teleport = "";
- Connections[GetConnIdx(BTC.UCID)].XTeleport = 0;
- Connections[GetConnIdx(BTC.UCID)].YTeleport = 0;
- Connections[GetConnIdx(BTC.UCID)].ZTeleport = 0;
- 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
- 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
- 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
- #endregion
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement