Advertisement
Guest User

RenamePlugin

a guest
Oct 20th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using Lib_K_Relay;
  2. using Lib_K_Relay.Interface;
  3. using Lib_K_Relay.Networking;
  4. using Lib_K_Relay.Networking.Packets;
  5. using Lib_K_Relay.Networking.Packets.Client;
  6. using Lib_K_Relay.Utilities;
  7. using System;
  8.  
  9. namespace Rename
  10. {
  11. public class Rename : IPlugin
  12. {
  13.  
  14. public string GetAuthor()
  15. {
  16. return "Meeelol";
  17. }
  18.  
  19. public string GetName()
  20. {
  21. return "Rename";
  22. }
  23.  
  24. public string GetDescription()
  25. {
  26. return "Changes your display name; only shown on your client.";
  27. }
  28.  
  29. public string[] GetCommands()
  30. {
  31. return new string[2]
  32. {
  33. "/rename"
  34. };
  35. }
  36.  
  37. public void Initialize(Proxy proxy)
  38. {
  39. proxy.HookCommand("rename", OnRenameCommand);
  40. }
  41.  
  42. private void OnRenameCommand(Client client, string command, string[] args)
  43.  
  44. //code that makes users display name show as newname when they type /rename newname
  45.  
  46. client.SendToClient((Packet)PluginUtils.CreateOryxNotification("KRelay", "Your name has been changed!));
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement