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

Add titles to factions plugins

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

  1. Defications2po

    Defications2po Witch

    Messages:
    51
    Alright so I did do my custom version of FactionsPro but now I Wana make it that when an intruder passes by another factions claim it sends a title saying Dangerous then under that it says it's factions name so how the fuck am I supposed to do that?
     
  2. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    $p->addTitle("Message","FadeIn","Fadeout");
    NOTE THIS ONLY WORKS WITH THE API3/NETWORK BRANCH OF POCKETMINE
    And please refrain from cussing on the forums
     
    jasonwynn10 likes this.
  3. Defications2po

    Defications2po Witch

    Messages:
    51
    So where exactly do I add that? FactionCommands.php?
     
  4. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    What function are you using to send that type of command? like where it says dangerous, are you using $p->sendMessage?
     
  5. Defications2po

    Defications2po Witch

    Messages:
    51
    Where exactly do you put that
     
  6. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    Where the sendMessage function is
     
  7. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    You'll have to add a PlayerMoveEvent handler and add the title when a player passes through a claim. You can see how MyPlot does it for reference.
     
    jasonwynn10 and Awzaw like this.
  8. Defications2po

    Defications2po Witch

    Messages:
    51
    so you did not answer my question so in witch file do i put it in like in the factions command factions listener factions plot?
     
  9. DaPigGuy

    DaPigGuy Slime

    Messages:
    86
    GitHub:
    DaPigGuy
    As @corytortoise said, you have to add a PlayerMoveEvent handler, which you should put in the event listener.
     
    jasonwynn10 and EdwardHamHam like this.
  10. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    You edited the plugin. We can't know.
     
  11. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Player::addTitle() has 5 parameters, not 3. In order, they are: Title(string), Subtitle(string), FadeIn(int), Duration(int), and FadeOut(int). (source)
     
  12. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    also only the 1st is required
     
  13. KingResos

    KingResos Spider Jockey

    Messages:
    37
    GitHub:
    kingresos
    Yes indeed ;)
     
    Zayd likes 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.