Display text in console rev 0.007

Results 1 to 7 of 7
  1. #1
    Member Mapster is offline
    MemberRank
    Apr 2008 Join Date
    86Posts

    Display text in console rev 0.007

    Here is something that i got going after a while. Nothing great and it does make it so people have very little privacy in-game but basically what it does is when someone types text in-game which doesn't contain an exclamation mark at the beginning or isn't in whispers.

    Open players.cpp.
    Go to the bottom of the below code:

    Code:
    void Players::chatHandler(Player* player, unsigned char* packet){
    Add the below code above the last curly bracket

    Code:
    printf (player->getName(), chat);
        printf (" says: ");
        printf (chat, chat);
        printf ("\n");
    So it looks something like this:

    Code:
    else{
                    Server::disableScrollingHeader();
                    printf ("GM_%s has changed the Header.\n", player->getName());
                }
            }
            return;
        }
        PlayersPacket::showChat(player, Maps::info[player->getMap()].Players, chat);
        Players::Log(player->getName(), chat);
        printf (player->getName(), chat);
        printf (" says: ");
        printf (chat, chat);
        printf ("\n");
    
    }


  2. #2
    Account Upgraded | Title Enabled! renegod is offline
    MemberRank
    Aug 2005 Join Date
    SingaporeLocation
    630Posts

    Re: [Release] Display text in console rev 0.007

    Nice :) gonna try it out xD

  3. #3
    Apprentice yq314 is offline
    MemberRank
    Apr 2008 Join Date
    14Posts

    Re: [Release] Display text in console rev 0.007

    printf ("%s says: %s\n", player->getName(), chat);

  4. #4
    Member Mapster is offline
    MemberRank
    Apr 2008 Join Date
    86Posts

    Re: [Release] Display text in console rev 0.007

    Yeah or that if you want to be simple :P

  5. #5
    Enthusiast Cam1596 is offline
    MemberRank
    Apr 2008 Join Date
    42Posts

    Re: [Release] Display text in console rev 0.007

    Works for rev 008 because I've been using it for awhile now. I'd rather it log the words & save them to a log file instead of just print them in the console though...

  6. #6
    Account Upgraded | Title Enabled! Initialise is offline
    MemberRank
    Apr 2008 Join Date
    238Posts

    Re: [Release] Display text in console rev 0.007

    I'd rather do both xD

  7. #7
    Account Upgraded | Title Enabled! renegod is offline
    MemberRank
    Aug 2005 Join Date
    SingaporeLocation
    630Posts

    Re: [Release] Display text in console rev 0.007

    Quote Originally Posted by Initialise View Post
    I'd rather do both xD
    Wouldn't you get 2 messages at a time? lolx



Advertisement