Guest User

Untitled

a guest
Nov 16th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.47 KB | None | 0 0
  1. public Action:Event_PRIVMSG(const String:hostmask[], args)
  2. {
  3. GetGame();
  4.  
  5. decl String:channel[64];
  6. IRC_GetEventArg(1, channel, sizeof(channel));
  7. if (IRC_ChannelHasFlag(channel, "relay"))
  8. {
  9. decl String:nick[IRC_NICK_MAXLEN], String:text[IRC_MAXLEN];
  10. IRC_GetNickFromHostMask(hostmask, nick, sizeof(nick));
  11. IRC_GetEventArg(2, text, sizeof(text));
  12. if (!strncmp(text, "\x01ACTION ", 8) && text[strlen(text)-1] == '\x01')
  13. {
  14. text[strlen(text)-1] = '\x00';
  15. //IRC_Strip2(text, sizeof(text)); // Strip IRC Color Codes
  16.  
  17. if(game == AG2)
  18. {
  19. ReplaceString(text, IRC_MAXLEN, "\x0300", "^8", false);
  20. ReplaceString(text, IRC_MAXLEN, "\x0301", "^a", false);
  21. ReplaceString(text, IRC_MAXLEN, "\x0302", "^b", false);
  22. ReplaceString(text, IRC_MAXLEN, "\x0303", "^c", false);
  23. ReplaceString(text, IRC_MAXLEN, "\x0304", "^1", false);
  24. ReplaceString(text, IRC_MAXLEN, "\x0305", "^e", false);
  25. ReplaceString(text, IRC_MAXLEN, "\x0306", "^6", false);
  26. ReplaceString(text, IRC_MAXLEN, "\x0307", "^9", false);
  27. ReplaceString(text, IRC_MAXLEN, "\x0308", "^3", false);
  28. ReplaceString(text, IRC_MAXLEN, "\x0309", "^2", false);
  29. ReplaceString(text, IRC_MAXLEN, "\x0310", "^g", false);
  30. ReplaceString(text, IRC_MAXLEN, "\x0311", "^5", false);
  31. ReplaceString(text, IRC_MAXLEN, "\x0312", "^4", false);
  32. ReplaceString(text, IRC_MAXLEN, "\x0313", "^6", false);
  33. ReplaceString(text, IRC_MAXLEN, "\x0314", "^f", false);
  34. ReplaceString(text, IRC_MAXLEN, "\x0315", "^7", false);
  35. ReplaceString(text, IRC_MAXLEN, "\x0f", "^0", false);
  36. }
  37. else if(game == TF2)
  38. {
  39. // TODO: Convert to TF2 Color Codes.
  40. }
  41. else
  42. {
  43. ReplaceString(text, IRC_MAXLEN, "\x0300", "", false);
  44. ReplaceString(text, IRC_MAXLEN, "\x0301", "", false);
  45. ReplaceString(text, IRC_MAXLEN, "\x0302", "", false);
  46. ReplaceString(text, IRC_MAXLEN, "\x0303", "", false);
  47. ReplaceString(text, IRC_MAXLEN, "\x0304", "", false);
  48. ReplaceString(text, IRC_MAXLEN, "\x0305", "", false);
  49. ReplaceString(text, IRC_MAXLEN, "\x0306", "", false);
  50. ReplaceString(text, IRC_MAXLEN, "\x0307", "", false);
  51. ReplaceString(text, IRC_MAXLEN, "\x0308", "", false);
  52. ReplaceString(text, IRC_MAXLEN, "\x0309", "", false);
  53. ReplaceString(text, IRC_MAXLEN, "\x0310", "", false);
  54. ReplaceString(text, IRC_MAXLEN, "\x0311", "", false);
  55. ReplaceString(text, IRC_MAXLEN, "\x0312", "", false);
  56. ReplaceString(text, IRC_MAXLEN, "\x0313", "", false);
  57. ReplaceString(text, IRC_MAXLEN, "\x0314", "", false);
  58. ReplaceString(text, IRC_MAXLEN, "\x0315", "", false);
  59. ReplaceString(text, IRC_MAXLEN, "\x0f", "", false);
  60. }
  61.  
  62. ReplaceString(text, IRC_MAXLEN, "\x1F", "", false);
  63. ReplaceString(text, IRC_MAXLEN, "\x16", "", false);
  64. ReplaceString(text, IRC_MAXLEN, "\x02", "", false);
  65.  
  66. IRC_StripGame(text, sizeof(text)); // Strip Game color codes
  67. PrintToChatAll("\x01[\x04IRC\x01] * %s %s", nick, text[7]);
  68. }
  69. else
  70. {
  71. //IRC_Strip(text, sizeof(text)); // Strip IRC Color Codes
  72.  
  73. if(game == AG2)
  74. {
  75. ReplaceString(text, IRC_MAXLEN, "\x0300", "^8", false);
  76. ReplaceString(text, IRC_MAXLEN, "\x0301", "^a", false);
  77. ReplaceString(text, IRC_MAXLEN, "\x0302", "^b", false);
  78. ReplaceString(text, IRC_MAXLEN, "\x0303", "^c", false);
  79. ReplaceString(text, IRC_MAXLEN, "\x0304", "^1", false);
  80. ReplaceString(text, IRC_MAXLEN, "\x0305", "^e", false);
  81. ReplaceString(text, IRC_MAXLEN, "\x0306", "^6", false);
  82. ReplaceString(text, IRC_MAXLEN, "\x0307", "^9", false);
  83. ReplaceString(text, IRC_MAXLEN, "\x0308", "^3", false);
  84. ReplaceString(text, IRC_MAXLEN, "\x0309", "^2", false);
  85. ReplaceString(text, IRC_MAXLEN, "\x0310", "^g", false);
  86. ReplaceString(text, IRC_MAXLEN, "\x0311", "^5", false);
  87. ReplaceString(text, IRC_MAXLEN, "\x0312", "^4", false);
  88. ReplaceString(text, IRC_MAXLEN, "\x0313", "^6", false);
  89. ReplaceString(text, IRC_MAXLEN, "\x0314", "^f", false);
  90. ReplaceString(text, IRC_MAXLEN, "\x0315", "^7", false);
  91. ReplaceString(text, IRC_MAXLEN, "\x0f", "^0", false);
  92. }
  93. else if(game == TF2)
  94. {
  95. // TODO: Convert to TF2 Color Codes.
  96. }
  97. else
  98. {
  99. ReplaceString(text, IRC_MAXLEN, "\x0300", "", false);
  100. ReplaceString(text, IRC_MAXLEN, "\x0301", "", false);
  101. ReplaceString(text, IRC_MAXLEN, "\x0302", "", false);
  102. ReplaceString(text, IRC_MAXLEN, "\x0303", "", false);
  103. ReplaceString(text, IRC_MAXLEN, "\x0304", "", false);
  104. ReplaceString(text, IRC_MAXLEN, "\x0305", "", false);
  105. ReplaceString(text, IRC_MAXLEN, "\x0306", "", false);
  106. ReplaceString(text, IRC_MAXLEN, "\x0307", "", false);
  107. ReplaceString(text, IRC_MAXLEN, "\x0308", "", false);
  108. ReplaceString(text, IRC_MAXLEN, "\x0309", "", false);
  109. ReplaceString(text, IRC_MAXLEN, "\x0310", "", false);
  110. ReplaceString(text, IRC_MAXLEN, "\x0311", "", false);
  111. ReplaceString(text, IRC_MAXLEN, "\x0312", "", false);
  112. ReplaceString(text, IRC_MAXLEN, "\x0313", "", false);
  113. ReplaceString(text, IRC_MAXLEN, "\x0314", "", false);
  114. ReplaceString(text, IRC_MAXLEN, "\x0315", "", false);
  115. ReplaceString(text, IRC_MAXLEN, "\x0f", "", false);
  116. }
  117.  
  118. ReplaceString(text, IRC_MAXLEN, "\x1F", "", false);
  119. ReplaceString(text, IRC_MAXLEN, "\x16", "", false);
  120. ReplaceString(text, IRC_MAXLEN, "\x02", "", false);
  121.  
  122. IRC_StripGame(text, sizeof(text)); // Strip Game color codes
  123. PrintToChatAll("\x01[\x04IRC\x01] %s : %s", nick, text);
  124. }
  125. }
  126. }
Add Comment
Please, Sign In to add comment