HoverInfo plugin Help

Discussion in 'Plugin Development' started by Mc_Lovinnnnn, Jul 24, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    Mc_Lovinnnnn

    Hey, I'm Mc_Lovinnnnn and I wanted to make a plugin where you hover over a name in chat and it shows their ign, balance, faction name, and faction power. I am not that familiar with coding and I was wondering if there is a way to make this possible. Not sure if you need a few API to be able to make it. I wanted to know what API I should use and how the code is supposed to look like. There is a plugin out there that I know of but when ever I try to change the faction to true it goes back to false whenever I restart the server or reload it
     
  2. Offline

    Zombie_Striker

    @Mc_Lovinnnnn
    The only APIs you need are the ones that add factions and balance and one for the hover text.

    This is all you need to do:
    1. Listen to AsyncPlayerChatEvent. Set its priority to Lowest (so it is triggered after any other chat plugins.)
    2. If the player is a part of a faction (using the factions API), get the name of the faction they are a part of.
    3. If the player has a banalance, get the amount.
    4. Using the hover over text, set the player's name so that hover over will display the amount.
    5. Convert the json to text and send it to the player.
     
Thread Status:
Not open for further replies.

Share This Page