Deathmax

Untitled

Sep 16th, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 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.                 {
  11.                     allowpacket = false;
  12.                     return;
  13.                 }
  14.             }
  15.             if (invisclient.Contains(e.ignoreClient)) //Terraria's code usually ignores the client which it receives a packet from
  16.                 e.Handled = true;
  17.         }
  18.  
  19.         void command(CommandArgs args)
  20.         {
  21.             args.Player.TPlayer.position = new PointF(0f, 0f);
  22.             allowpacket = true;
  23.             TSPlayer.All.SendData(PacketTypes.PlayerUpdate, "", args.Player.Index);
  24.             invisclient.Add(args.Player.Index);
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment