Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool allowpacket = false;
- public static System.Collections.Generic.List<int> invisclient = new System.Collections.Generic.List<int>();
- void NetHooks_SendData(SendDataEventArgs e)
- {
- if (e.MsgID == PacketTypes.PlayerUpdate)
- {
- if (invisclient.Contains(e.number) && !allowpacket)
- e.Handled = true;
- if (allowpacket)
- allowpacket = false;
- }
- if (invisclient.Contains(e.ignoreClient)) //Terraria's code usually ignores the client which it receives a packet from
- e.Handled = true;
- }
- void command(CommandArgs args)
- {
- args.Player.TPlayer.position = new PointF(0f, 0f);
- allowpacket = true;
- TSPlayer.All.SendData(PacketTypes.PlayerUpdate, "", args.Player.Index);
- invisclient.Add(args.Player.Index);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement