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

$player->addTitle event replacing $p->sendMessage?

Discussion in 'Development' started by KingResos, Apr 21, 2017.

  1. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    So I was looking yesterday through a skywars plugin I am using on my server by SVvile and he uses the $p->sendMessage, heres some of the code
    And I want to replace this count down with titles rather than sending messages and popups could I possibly do it like this?
    If not could someone tell me how I could do this?
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Sure, just replace it :D
     
  3. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    Alright I'll try it as soon as I get home today :p
     
  4. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    His code
    PHP:
    $p->sendMessage("Skywars is started!");
    your code should be
    PHP:
    $p->addTitle("Skywars is started!");
    NOTE: THIS ONLY WORKS ON API3/NETWORK BRANCH OF PM WHICH YOU CAN FIND HERE
    https://github.com/pmmp/PocketMine-MP/tree/api3/network
    And, sendMessage and addTitle aren't events!
     
  5. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    Sorry I'm kind of new to coding so please excuse my lack of knowledge of not knowing the difference between Events and Functions.
    But thank you for the advice man I appreciate it a lot! :p ill definitely start experimenting with these
    But one thing, Couldn't it also work with Tesseract because it has Title Support? if not then ill switch to the API3/Network
     
    Zuruki likes this.
  6. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    And also how could I make the Pocketmine API3/Network to a phar file?
     
  7. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    it does work with tesseract but the function is sendTitle instead of addTitle! keep learning dude! I am also learning, it helps me to learn by explaining :p
     
  8. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    Thanks! Ill keep on learning & ill definitely experiment with the Skywars code when I get home (school ya know haha but thank god its Friday)
    Thanks for the explanation! :p
     
    Zuruki likes this.
  9. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    You can use DevTools
    to convert zip's to phar.
    I think there is a phar download of PocketMine on the Jenkins anyway
     
  10. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    there should ALSO be a phar on poggit
     
    Zuruki and HimbeersaftLP like this.
  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.