Making a total map score

Discussion in 'Plugin Development' started by Konkz, Apr 5, 2014.

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

    Konkz

    Hey,

    I have a configuration file like so

    Code:
    Game:
        Map1:
        world: world
        coords:
          x: 1
          y: 2
          z: 3
      Map2:
        world: world
        coords:
          x: 1
          y: 2
          z: 3
    and it goes on, what I want to make is so when someone does /vote Map1 it will then add 1 point against that map name, but if I only had Map1 and Map2 in config and I do /vote Map3 it will return an error.

    Any tips? :)
     
  2. Offline

    Glumpz

    Easy, just check for the command arguments and if they match a configuration variable then add one to a list.
    Code:java
    1. List<String> map1counter = new ArrayList<String>();
    2. List<String> map2counter = new ArrayList<String>();
    3. List<String> map3counter = new ArrayList<String>();

    Then check to see which one has the most amount of indexs available and select that map.
     
Thread Status:
Not open for further replies.

Share This Page