Welcome to AC Web.
Results 1 to 3 of 3
  1. #1

    [C++] Prevent message sent


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hello AC-Web.

    I currently have a script containing the OnChat method within a PlayerScript.
    I tried to change the message to be empty and so forth, but that does nothing, except saying the character is saying something nonintellectual.
    How do I prevent the message for being sent?

    For example, a condition is true, don't send the 'say' message.
    Last edited by Heitx; 08-25-2019 at 12:58 PM. Reason: Mistake

  2. #2
    In lua, to prevent a message from sending, 'return false;' is used. Check it out.

  3. #3

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by n1ghth2wk View Post
    In lua, to prevent a message from sending, 'return false;' is used. Check it out.
    Thanks for the direction! It seems that it is not possible unless I want do core changes. TrinityCore does not support denying the message to be sent from the scripting library.

    For other developers looking into this:
    ScriptMgr has the functions to run all the OnChat events.
    ChatHandler invokes these functions. Search "sScriptMgr->OnPlayerChat" to find them.

    You will need to change the return type of all OnChat functions (and probably more) to make it work.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •