Item store

Discussion in 'Plugin Development' started by Connor2weirdness, Feb 7, 2016.

Thread Status:
Not open for further replies.
  1. Hello again... Thanks, and sorry for being a leech >.> asked another question barely 24 hours ago...

    I am trying to make a GUI shop system, where the items are unlocked by the one before it being bought. Obviously, for this I would need to save players' progress/purchases in a file. What would be the best way to check if an item is unlocked?

    For example:
    And then when they buy the steak:
    It's a crude representation of what I want to do, but I hope you get the idea. Thanks.

    Side question to save forum space: Should you store plugin data in a config file?
    E.G - Spawn points, custom names for players.
     
    Last edited: Feb 7, 2016
  2. Offline

    teej107

    @Connor2weirdness Associate each purchase as a integer. The first purchase is 1. Second is 2 and so forth. If a player's purchase count is 15, then they obviously purchased the 15 items before the 16th.
     
  3. I then have the issue of finding that integer when they purchase an item. Is there something like a double value HashMap? Thanks.
     
  4. Offline

    teej107

    @Connor2weirdness You could have a List of the item's somewhere and just store the integer (referring to their purchase count) for the player.
     
Thread Status:
Not open for further replies.

Share This Page