Jump to content

[idea] Message Box When A Character Logs In


Recommended Posts

Posted

Index: CharacterHandler.cpp

===================================================================

--- CharacterHandler.cpp (revision 6254)

+++ CharacterHandler.cpp (working copy)

@@ -466,6 +467,19 @@

                data.put(0, linecount);

                SendPacket( &data );
+    bool PlayerLogonAnnounce = sConfig.GetBoolDefault("Player.Logon.Announce", true);
+                if (PlayerLogonAnnounce)
+                {
+    Player *player = GetPlayer();
+    const char* args;
+    args = player->GetName();
+    std::string PlayerLoginMessage= " Welcome Login Server]");
+    std::string str ="|cffff0000";
+                str += args;
+    str += PlayerLoginMessage;
+    str += "|r";
+                sWorld.SendWorldText(str.c_str(), NULL);
+                }
                DEBUG_LOG( "WORLD: Sent motd (SMSG_MOTD)" );
        }

This will get " playername Welcome Login Server " when login in server! enjoy~~

Posted

uhm... will sWorld.SendWorldText send a text like the motd or a textbox? I even don't think it's possible, but it is possible to send a message box, as like as a frame or something else? Or I need an addon?

Posted

if there is no such function in the game client, you of course need an addon which catches the server message and handles it (in your situation displays it in a box).

cheers

×
×
  • 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