List with required points, String system..

Discussion in 'Plugin Development' started by Uniclaw, Nov 1, 2012.

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

    Uniclaw

    Hi!

    in my config i have a list, defined like that:

    system:
    string1: 5
    string2: 10

    etc - and i have a hashmap, wich contains points for each player. if a player has more than 5 points, but lower than 10, he must be assigned to the string "string1" - and here'S the problem: I've make a iterator, wich iterate trough the key set from "system", and check if points in a hashmap is >= than the assigned value to a string. if is it, the player assigned string will be changed - but in my code, every time its change to the highest string...
     
  2. Offline

    pzxc

    Need to see your code.
     
  3. Offline

    Uniclaw

    Okay, here it is:

    Code:
    Set<String> keys = getConfig().getConfigurationSection("System").getKeys(false);
     
    Iterator<String> iter = keys.iterator();
    while(iter.hasNext()){
    String s = iter.next();
    //System.out.println(s.toUpperCase());
    if(getConfig().contains("System." + s) && phr.containsKey(p.getName())){
    if(phr.get(p.getName()) >= getConfig().getInt("System." + s)){
    assigned = colorize(getConfig().getString("System." + s + ".String"));
    }
    }else if(! phr.containsKey(p.getName())){
    assigned = "";
    }
    }
     
  4. Offline

    fireblast709

    can you post your full code and also the config please :3
     
Thread Status:
Not open for further replies.

Share This Page