Solved Hide Default Join|Leave Message?

Discussion in 'Development' started by xXNiceAssassinlo YT, Sep 3, 2017.

  1. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    705
    GitHub:
    xXNiceYT
    can I get some help How do you hide Join and leave?
    Can I get code.
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,492
    GitHub:
    jasonwynn10
    Please show proof of a previous attempt
     
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    705
    GitHub:
    xXNiceYT
    Wat you mean?
     
  4. XdmingXD

    XdmingXD Baby Zombie

    Messages:
    159
    GitHub:
    xdmingxd
    Send you code that you have tried
    maybe there is/are only some careless misstake(s)
     
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    705
    GitHub:
    xXNiceYT
    public function onJoin(PlayerJoinEvent $event){
    $player = $event->getPlayer();
    $name = $player->getName();
    $this->getServer()->broadcastMessage(C::GREEN."");
    $this->getServer()->broadcastTip(C::GREEN."§b$name Joined.");

    It working but idk how to hide default Join message
     
  6. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    705
    GitHub:
    xXNiceYT
    Oh thank I found it

    I forgot to add
    $event->setJoinMessage("");
     
    Diduhless and jasonwynn10 like this.
  7. JUZEXMOD

    JUZEXMOD Spider

    Messages:
    10
    GitHub:
    DevolperPHP
    use this

    PHP:
    public function onJoin(PlayerJoinEvent $event){
            
    $player $event->getPlayer();
            
    $event->setJoinMessage(null);
        }

    public function 
    onQuit(PlayerQuitEvent $event){
            
    $player $event->getPlayer();
            
    $event->setQuitMessage(null);
        }
     
  8. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    705
    GitHub:
    xXNiceYT
    Thank but I found It

    $event->setJoinMessage("");
    $event->setQuitMessage("");
     
    JUZEXMOD likes this.
  9. JUZEXMOD

    JUZEXMOD Spider

    Messages:
    10
    GitHub:
    DevolperPHP
    your welcome =)
     
  10. WoollenPanda275

    WoollenPanda275 Creeper

    Messages:
    1
    GitHub:
    badgerrao
    Could someone tell me where i put this? i went
    src > pocketmine > event > player PlayerJoinEvent.php
    is this right?
     
  11. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,492
    GitHub:
    jasonwynn10
    It’s for a plugin. It doesn’t go anywhere in Pocketmine
     
  12. GodWeedZao

    GodWeedZao Zombie

    Messages:
    233
    GitHub:
    godweedzao
    ah, you should use it in your plugin for example in your Main.php of your own plugin, its a php file for pmmp for using :
    PHP:
    use pocketmine\event\player\PlayerJoinEvent;
    //just use it in befor your Main class.
    and its done.
     

Share This Page

  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.