Getting ranks with vault?

Discussion in 'Plugin Development' started by KingKongC, Feb 3, 2013.

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

    KingKongC

    im trying to make a simple test plugin for my test server to get all the players with certain ranks eg. (Builder,Skull Cracker, Assassin) using vault but when i use the code i have found on the internet that most people are saying to use its just not working can anyone help?
     
  2. Offline

    KeybordPiano459

    There are a bunch of permission checks that you can use with Vault, and you can find them here:
    http://mythcraft.dyndns.org/javadoc/vault/net/milkbowl/vault/permission/Permission.html
     
  3. Offline

    KingKongC

    Thanks, You may have saved me

    Guess not

    This is my code that doesn't want too work
    Code:java
    1. package me.bukkitorg.onlinestaff.kingkongcaliber.copyright;
    2.  
    3.  
    4. import java.util.logging.Logger;
    5. import java.lang.Object;
    6.  
    7. import org.bukkit.Bukkit;
    8. import org.bukkit.ChatColor;
    9. import org.bukkit.command.Command;
    10. import org.bukkit.command.CommandSender;
    11. import org.bukkit.entity.Player;
    12. import org.bukkit.plugin.java.JavaPlugin;
    13.  
    14. import net.milkbowl.vault.chat.Chat;
    15. import net.milkbowl.vault.permission.Permission;
    16.  
    17. public class main extends JavaPlugin {
    18.  
    19. public static Chat chat = null;
    20. public static Permission permission = null;
    21.  
    22. Logger log = Logger.getLogger("Minecraft");
    23. public void onEnable()
    24. {
    25. log.info(ChatColor.GREEN + "Online-Staff has been disabled");
    26. }
    27. public void onDisable()
    28. {
    29. log.info(ChatColor.DARK_RED + "Online-Staff has been disabled");
    30. }
    31. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    32. Player player = (Player) sender;
    33. if(cmd.getName().equalsIgnoreCase("basic")){ // If the player typed /basic then do the following...
    34.  
    35. for (Player p : Bukkit.getOnlinePlayers()){
    36.  
    37. public String getGroup(String name, String world)
    38. {
    39. return this.pexHandler.getUser(name).getGroups(world)[0].getName();
    40. }
    41.  
    42.  
    43. }
    44. return true;
    45. } //If this has happened the function will return true.
    46. // If this hasn't happened the a value of false will be returned.
    47. return false;
    48. }
    49. }
    50.  


    Nobody?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  4. Offline

    RealDope

    What is this.pexHandler?

    Also you defined the method called getGroup inside of onCommand?
     
  5. Offline

    SergeantMajorME

    I'd assume an instance of Pex he grabbed.
     
Thread Status:
Not open for further replies.

Share This Page