Solved Simple ChatManager for PermissionsEx

Discussion in 'Plugin Development' started by deleted_90940145, Apr 14, 2014.

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

    Zach_1919

    driver-e Look into PEx API and find out how you can access the prefixes and suffixes and whatnot. Use the PlayerChatEvent and then change the message to add the prefix and suffix.
     
  2. Offline

    Go Hard

    driver-e Just hook into PEX. Then get the group of the player. Kinda like this:
    Code:java
    1. @EventHandler
    2. public void onPlayerChat(AsyncPlayerChatEvent e) {
    3. Player p = e.getPlayer();
    4.  
    5. PermissionUser user = PermissionsEx.getUser(p.getName());
    6. String message = e.getMessage();
    7.  
    8. if(user.inGroup("Guest")) {
    9. e.setFormat("[Guest]" + p.getName() + ChatColor.WHITE + ": " + message);
    10. return;
    11. }
    12. }
     
    deleted_90940145 likes this.
  3. Go Hard
    Zach_1919

    Thank you both!

    Go Hard Thank you :D
    Solved.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page