PLayer only able to do a command once per life help!

Discussion in 'Plugin Development' started by jelly_beng, Jun 5, 2013.

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

    jelly_beng

    Hello All!, Once again thanks for reading my post! So, Today I am almost done with my private plugin which is a kit pvp plugin (Basic I know but I am returning to java after a 3 month break). I do not want to delay the users because I am not sure how long they are all going to be alive for so I want to find a method (If possible) to make sure a player can only type a command once per life. Any feedback is appreciated! Thanks for your time! P.S. Sorry for no code this time! I don't even know what to start this with!
     
  2. Offline

    TheUpdater

    you want em to be able to do a command when live 1 time if die thay can do it agine?
     
  3. Offline

    Alvarez96

    HashMap<Player, Boolean> canCmd = new HashMap<Player, Boolean>();

    onCommand(){
    if(canCmd.get(player)){
    doWhateverYouWant();
    canCmd.put(player, false);
    }
    }


    If you want to further this to tracking the players when they leave and come back, the use of a text doc would be needed.

    Sorry if something doesn't work. Im currently in school and don't have the ability to test anything out.
     
  4. Offline

    jelly_beng

    Yeah, Is this possible or not?

    Ah, Ok I will add it in now! Thanks for messaging me during the school time!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  5. Offline

    Alvarez96

    No problem. Hopefully you know where to add all the different components I threw together above. If not I can explain.
     
  6. Offline

    jelly_beng

    Yeah, I added them in to where I think is the right place but no commands would work. I am planning on doing this for when I have more time as I need to revise for a test :/ Thanks for your help. If its ok I could pm you if I need help?
     
    Alvarez96 likes this.
  7. Offline

    Alvarez96


    Sure feel free to pm me if you need any help
     
Thread Status:
Not open for further replies.

Share This Page