Minigame - Infected - Killing managing.

Discussion in 'Plugin Development' started by HeyShibby, Mar 20, 2013.

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

    HeyShibby

    Hello Bukkit Development, what i'm trying to do is make a mini game plugin which is almost done but all I need to do now is work on the team/killing system so when a person on the humans team dies they get put onto the infected team and once all players from the human team have been killed by the infected the game ends, and then restarts after a certain amount of time.
    Thanks in advanced and credit will be given!
     
  2. Offline

    MCForger

    That doesnt sound like almost done. Managing that kind of stuff isn't all that easy. Do you have any code to provide that we can help you with?
     
  3. Offline

    HeyShibby

    I thought it would be a pretty easy job to do ;/ I made a permission way of doing it but if the server was to restart it would cause a huge problem, isn't there any sort of way of doing it easier so it doesn't bug out or take up a lot of ram such as hashmaps?
     
  4. Offline

    MCForger

    Again you still have not posted any code. I can not really help or say what I would recommend if there is no code.
     
  5. Offline

    HeyShibby

    I'm starting from fresh because I want it to be able to be efficient and not kill the CPU/RAM on my server, the last way I did it was with groupmanager permissions which was way to buggy and killed the CPU/RAM because there was so many updates happening. So what i'm asking is what's the best way to do it and how abouts would I do it.
     
  6. Offline

    MCForger

    For recording kills and deaths I recommend using HashMaps<String, Integer>. String would be the players name and the integer would be their kills or deaths. So I would recommend making two of these. Then on a PlayerDeathEvent listen and then if it meets your requirements then record it. OnDisable then save all of this to a YAML file then reload it onEnable().
     
  7. Offline

    HeyShibby

    Okay sounds a lot like what I have at this moment so i'm proud(maybe one thing or two a little different but it's working fine), But how would I go about ending the game when all humans are dead or have left the server?
     
  8. Offline

    MCForger

    Well you could make a BukkitRunnable that runs every so often and goes okay getting the arena or world. Then going okay if their is no players in the arena or world then do your end game function.
     
  9. Offline

    HeyShibby

    I want to try and keep it all in one world, so could I possibly do this with hashmaps(onplayerdeath event)?
     
  10. Offline

    MCForger

    Yes you would record the death and the killer who was responsible for that players death. Then do a check on that world if there is any players left in it and if so then do your end game function.
     
  11. Offline

    HeyShibby

    Okay cool i'll mess around with it and see what I can do :)
     
  12. Offline

    skipperguy12

    HeyShibby

    2 arraylists, living and infected.

    Player death event > add e.getEntity() to infected (obviously check to make sure it's a player?) > Done?
    Uhm...
     
  13. Offline

    HeyShibby

    This is what I was working towards the only thing i'm stuck with is how to check if the arraylist is empty?;s
     
  14. Offline

    MCForger

    You just simply so if (list.isEmpty())
     
  15. Offline

    Burnett1

    arrayListName.isEmpty()

    Edit: MCForger Beat me to it.
     
  16. Offline

    HeyShibby

    I can't believe I was that dumb, I couldn't find that anywhere! -.-
     
Thread Status:
Not open for further replies.

Share This Page