Solved Hashmaps

Discussion in 'Plugin Development' started by cococow123, Nov 29, 2015.

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

    cococow123

    Hi!

    I am making a voting plugin. When someone votes (clicks vote option sign) I want to add 1 to the option's key in a yml file.

    Let's say the option sign is 'apple'
    Player clicks option sign
    Goes to mvote/votes/{vote id}/{vote id}.yml
    Loads hashmap from file
    Adds 1 to hashmap with the key as the option (apple).
    Saves hashmap (and file)

    Please help!


    Thanks in advance,
    Coco Cow

    (I'm new to hashmaps)
     
  2. Offline

    Zombie_Striker

    @cococow123
    Do tell us, what do you have currently? Did you try anything?
     
  3. Offline

    Scimiguy

  4. Offline

    cococow123

    @Scimiguy the hashmap will be String, String. The key is the option: getLine(3).toString()

    The value will start at 0.When option sign is created it will set to 0.

    When clicking option sign to add vote, Get line 4 and add 1 to the value.

    I just need to know how to load it from the directory and add 1 to option. Then save.
     
  5. Offline

    Mrs. bwfctower

    Chloe-chan likes this.
  6. Offline

    cococow123

    @Mrs. bwfctower thanks! I'll try to use this. Such handy Libs.. 1st - yours.. Now this :)
     
  7. Offline

    mcdorli

    You realize you can just set the thread to Solved without changing the title
     
  8. Offline

    Scimiguy

    @mcdorli
    He can't, Tapatalk app doesn't allow it
     
  9. Offline

    Mrs. bwfctower

    But you can still go on your mobile web browser and request the desktop site.
     
  10. Offline

    Scimiguy

    @Mrs. bwfctower
    lol I wouldn't consider that worth the effort, the website is crap on mobile I've said it many times.
     
Thread Status:
Not open for further replies.

Share This Page