Jump to content

Whats a proper way to send a message to player


Guest tekkeryole

Recommended Posts

Not sure you mean. Do you mean a command or piece of code?

If you mean a command, then you can use .announce.

If you mean a piece of code, then you can look at the command .announce and see that it looks as follows:

// global announce
bool ChatHandler::HandleAnnounceCommand(const char* args)
{
   if(!*args)
       return false;

   sWorld.SendWorldText(LANG_SYSTEMMESSAGE,args);
   return true;
}

Link to comment
Share on other sites

Not sure you mean. Do you mean a command or piece of code?

If you mean a command, then you can use .announce.

If you mean a piece of code, then you can look at the command .announce and see that it looks as follows:

// global announce
bool ChatHandler::HandleAnnounceCommand(const char* args)
{
   if(!*args)
       return false;

   sWorld.SendWorldText(LANG_SYSTEMMESSAGE,args);
   return true;
}

I guess I should have clarified this, but pretty much, I'm used to ascent based emulators - arcemu/aspire/ascent and what they normally use is BroadcastMessage which sends the message to just the player. Well the last few days, i looked everything over and it seems it is SystemMessage - is this right? If I use SendWorldText it announces to the world.

Link to comment
Share on other sites

Ah, I think you want ChatHandler(player).SendSysMessage(LANG_ITEM_SAVE_FAILED);

Yea, i figured i would have to just do that and add in my own custom text defines for those.

pretty much i define what i want - LANG_W_E_I_WANT = #MY_TXT_ID where the rest of those lang defines are.

Link to comment
Share on other sites

Yea, i figured i would have to just do that and add in my own custom text defines for those.

pretty much i define what i want - LANG_W_E_I_WANT = #MY_TXT_ID where the rest of those lang defines are.

Actually, I pretty sure you can just use a string (ChatHandler(player).SendSysMessage("Some text here"); )

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use