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

Title when entering a faction claim

Discussion in 'Help' started by Kayllon, Jun 8, 2021.

  1. Kayllon

    Kayllon Silverfish

    Messages:
    24
    How do I get a title to appear when a player enters a faction claim? I'm using FactionsPro and tried it in several ways and I couldn't :(
     
  2. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    1. On player move
    2. Check if player's in a faction territory
    3. If the player is in a faction territory, send title and assign the player to an array to prevent spam
    4. If the player leaves the faction territory, unassign the player from the array

    Just a simple idea! :D
     
    Kayllon, Primus and Axon like this.
  3. Primus

    Primus Zombie Pigman

    Messages:
    749
    Keep the chunk coordinates attached to their session, on move (or timer) check if the current standing chunk is the same as before, and if not - perform a territory check and send the title. It's not something that will be saved/loaded into session, so it can live inside the memory. I have no clue how that plugin works, but the basic idea is here.

    https://github.com/BlockHorizons/Fa...ns/FactionsPE/engine/MainEngine.php#L116-L131

    That's how I track player movements in my plugin, instead of directly sending the title, I'm firing a new event, which sends it, or does not depending on circumstances.
     
    Kayllon, minijaham and Axon 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.