WIXXZI

[Diff] Kick/Mute/Ban announcer script

Apr 27th, 2013
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.67 KB | None | 0 0
  1. src/server/scripts/Commands/cs_ban.cpp  |  12 ++++++------
  2. src/server/scripts/Commands/cs_misc.cpp |  26 +++++++++++++-------------
  3. 2 files changed, 19 insertions(+), 19 deletions(-)
  4.  
  5. diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
  6. index 1c0ffd4..1c152dd 100644
  7. --- a/src/server/scripts/Commands/cs_ban.cpp
  8. +++ b/src/server/scripts/Commands/cs_ban.cpp
  9. @@ -221,15 +221,15 @@ class ban_commandscript : public CommandScript
  10.           else if (mode == BAN_IP)
  11.                         announce = "The IP '";
  12.                     else
  13. -                    announce = "Account '";
  14. +                    announce = "Account ";
  15.                       announce += nameOrIP.c_str();
  16. -                    announce += "' was banned for ";
  17. +                    announce += " was banned for ";
  18.                       announce += durationStr;
  19. -                    announce += " by the character '";
  20. -                    announce += m_session->GetPlayerName();
  21. -                    announce += "'. The reason is: ";
  22. +                    announce += " by the character ";
  23. +                    announce +=  handler->GetSession()->GetPlayerName();
  24. +                    announce += ". The reason is: ";
  25.                       announce += reasonStr;
  26. -          HandleAnnounceCommand(announce.c_str());
  27. +                    sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
  28.         }
  29.  
  30.         return true;
  31. diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
  32. index 2082db1..76f208f 100644
  33. --- a/src/server/scripts/Commands/cs_misc.cpp
  34. +++ b/src/server/scripts/Commands/cs_misc.cpp
  35. @@ -932,12 +932,12 @@ class misc_commandscript : public CommandScript
  36.  
  37.         if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
  38.         {
  39. -          announce = "The character '";
  40. +          announce = "The character ";
  41.             announce += playerName.c_str();
  42. -          announce += "' was kicked by the character '";
  43. -          announce += m_session->GetPlayerName();
  44. -          announce += "'.";
  45. -          HandleAnnounceCommand(announce.c_str());
  46. +          announce += " was kicked by the character ";
  47. +          announce += handler->GetSession()->GetPlayerName();
  48. +          announce += ".";
  49. +          sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
  50.         }
  51.  
  52.         return true;
  53. @@ -1794,8 +1794,8 @@ class misc_commandscript : public CommandScript
  54.  
  55.         if(!muteReason)
  56.         {
  57. -            PSendSysMessage("You must enter a reason of mute");
  58. -            SetSentErrorMessage(true);
  59. +            handler->PSendSysMessage("You must enter a reason of mute");
  60. +            handler->SetSentErrorMessage(true);
  61.             return false;
  62.         }
  63.  
  64. @@ -1843,15 +1843,15 @@ class misc_commandscript : public CommandScript
  65.  
  66.         if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD))
  67.         {
  68. -            announce = "The character '";
  69. +            announce = "The character ";
  70.             announce += nameLink.c_str();
  71. -            announce += "' was muted for ";
  72. +            announce += " was muted for ";
  73.             announce += notSpeakTime;
  74. -            announce += " minutes by the character '";
  75. -            announce += m_session->GetPlayerName();
  76. -            announce += "'. The reason is: ";
  77. +            announce += " minutes by the character ";
  78. +            announce += handler->GetSession()->GetPlayerName();
  79. +            announce += ". The reason is: ";
  80.             announce += muteReasonStr.c_str();
  81. -            HandleAnnounceCommand(announce.c_str());
  82. +            sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
  83.         }
  84.  
  85.         return true;
Add Comment
Please, Sign In to add comment