1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Your chat name is different

Discussion in 'Requests' started by MC ATECH, May 7, 2017.

  1. MC ATECH

    MC ATECH Baby Zombie

    Messages:
    117
    GitHub:
    mcpeatech
    Hello!
    I was just wondering if it's possible in mcpe to have his plugin made.
    Basically this plugin could work with purechat. When a player types someone else's name into chat it will appear in a different colour text to that player (to get there attention) and maybe make a sound when there name is sent into the chat window. It's a nice feature to have if, for example you hide your chat the little sound would notify you that your name had been entered!
    That's all.. sorry if it's not possible.
    - MC ATECH
     
    jasonwynn10 likes this.
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    look at the plugin mention by falk
    just regexr the text i suppose but regexing the whole centense may cause not so great lag issues so regex it in a thread!
    late notify better then no notify

    for like a bold on your name, you may need to broadcast it to everyone other then the one begin mention and highlight the name then sent it to the mentioned one
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Oh, like a notification.
    But I don't think it's possible to get the colour of the word before the player's name.
    Players[
    "Jimmy",
    "Timmy"
    ]
    Message: "Hey jimmy, long time no see!"
    There is no way (alright, there might be some way but it's probably hard) to get the colour of the word before Jimmy (i.e "Hey"), so I guess "it will appear in a different colour text to that player" won't be possible. (For the sake of the argument, even if you assume that PureChat's API makes it possible to detect the message format, this will still be a problem for players customizing their chat with TextFormat::ESCAPE codes; "§eHi jimmy §a;D").

    Do NOT:
    PHP:
    /** @var Server $server */
    /** @var string $message */
    $message implode(" "$message);
    foreach(
    $message as &$word){
        if((
    $player $server->getPlayerExact($word)) !== null){
            
    $word $player->getName();
        }
    }
    You are creating two loops. Server::getPlayerExact() calls for a loop. R.I.P TPS for servers having many players.
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Here it is:
    [​IMG]
    Not tested.
    I'm not familiar with sounds, and I don't want to do the boring work of converting strings to sound classes, so it's hardcoded as PopSound(pitch=0).
     
    jasonwynn10, MC ATECH and Muqsit like this.
  5. MC ATECH

    MC ATECH Baby Zombie

    Messages:
    117
    GitHub:
    mcpeatech
    Thanks so much
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.