Can someone help me make a map vote system?

Discussion in 'Plugin Development' started by dagen9, May 14, 2017.

Thread Status:
Not open for further replies.
  1. Hello guys, I'm wanting a map voting system but I cant find a tutorial anywhere I did find one but it was useless so if you want to help can you reply to this thread? Thanks.
     
  2. Offline

    MrGeneralQ

    Okay there are some thing's you'll have to keep in your mind. Ofcourse there is not tutorial available for this, there are many tutorials available but not for specific idea's.

    I'll suggest you to do the following:

    1. Start learning Java first (without basic java knowledge there is no way you will get this working)
    2. Start by analyzing what events you'll need, requirements, and how you are going to implement those . If you have trouble with sepperate components that's a difference. We can help you with that, but not a whole plugin idea.
    3. Start by reading the plugin development. There are many questions there and the community will help you on your journey creating your plugin.
    Good luck!
     
  3. Offline

    Zombie_Striker

    @dagen9
    It's really simple to set up this system:
    1. Link each map to a number. If you have a map object, I would recommend using a hashmap, the keys will be the id and the value will be the map object. If you don't, try to find a way to store all the information you need for each map.
    2. Create a boolean. This represents when someone can vote.
    3. Create a HashMap. Keys and values will be Integers. This represents how many votes a map has.
    4. onCommand, if the player sent a vote command, and if the boolean from #2 is true, add +1 to the map they voted for.
    5. When you want to start the map vote, set the boolean to true, clear the votes from #3. Then, using a Delayed Task, Loop through all the votes, pick the one with the highest score, and set the boolean back to false.
     
Thread Status:
Not open for further replies.

Share This Page