Solved Grabbing the Faction Role Prefix and the Faction Name

Discussion in 'Plugin Development' started by Astrophylite, Feb 6, 2016.

Thread Status:
Not open for further replies.
  1. Hello everyone,

    I am trying to make a plugin that has tags but it's going to be used on a Factions server and I need to find a way to put the Faction stuffs at the beginning of the format. How do I do this?

    Thanks,
    _zircon_.
     
  2. I've fixed it myself, yet again. ;-;
    Simple code (when you find it out), but I'll post it here anyways:
    Code:java
    1.  
    2. MPlayer mplayer = MPlayer.get(p);
    3. Faction faction = mplayer.getFaction();
    4. String factionRoleprefixName = null;
    5. if(faction.isNone()) {
    6. faction = null;
    7. factionRoleprefixName = "";
    8. } else {
    9. if(mplayer.getRole() == Rel.LEADER) {
    10. factionRoleprefixName = "**" + faction.getName();
    11. } else if(mplayer.getRole() == Rel.OFFICER){
    12. factionRoleprefixName = "*" + faction.getName();
    13. } else if(mplayer.getRole() == Rel.MEMBER) {
    14. factionRoleprefixName = "+" + faction.getName();
    15. } else if(mplayer.getRole() == Rel.RECRUIT) {
    16. factionRoleprefixName = "-" + faction.getName();
    17. }
    18. }
    19.  
     
Thread Status:
Not open for further replies.

Share This Page