Advertisement
Deathmax

Untitled

Sep 16th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1.         public static bool allowpacket = false;
  2.         public static System.Collections.Generic.List<int> invisclient = new System.Collections.Generic.List<int>();
  3.         void NetHooks_SendData(SendDataEventArgs e)
  4.         {
  5.             if (e.MsgID == PacketTypes.PlayerUpdate)
  6.             {
  7.                 if (invisclient.Contains(e.number) && !allowpacket)
  8.                     e.Handled = true;
  9.                 if (allowpacket)
  10.                     allowpacket = false;
  11.             }
  12.             if (invisclient.Contains(e.ignoreClient)) //Terraria's code usually ignores the client which it receives a packet from
  13.                 e.Handled = true;
  14.         }
  15.  
  16.         void command(CommandArgs args)
  17.         {
  18.             args.Player.TPlayer.position = new PointF(0f, 0f);
  19.             allowpacket = true;
  20.             TSPlayer.All.SendData(PacketTypes.PlayerUpdate, "", args.Player.Index);
  21.             invisclient.Add(args.Player.Index);
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement