onQuit Event Not Working Please Help!

Discussion in 'Plugin Development' started by lucaspeedstack, Feb 23, 2014.

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

    lucaspeedstack

    FIXED SORRY!

    Why wont this work? I registered the events but it still wont work! It should remove a player from an ArrayList, but it doesn't...
    Code:java
    1. @EventHandler
    2. public void onQuit(PlayerQuitEvent e) {
    3. Player p = e.getPlayer();
    4.  
    5. if(one.contains(p)){
    6. one.remove(p);
    7. }
    8. if(two.contains(p)){
    9. two.remove(p);
    10. }
    11. if(three.contains(p)){
    12. three.remove(p);
    13. }
    14. if(four.contains(p)){
    15. four.remove(p);
    16. }
    17. if(five.contains(p)){
    18. five.remove(p);
    19. }
    20. if(six.contains(p)){
    21. six.remove(p);
    22. }
    23. if(seven.contains(p)){
    24. seven.remove(p);
    25. }
    26. if(eight.contains(p)){
    27. eight.remove(p);
    28. }

    wont work :(
     
  2. Offline

    alex123099

  3. Offline

    lucaspeedstack

    FIXED SORRY!
     
  4. Offline

    NinjaWAffles

    This doesn't give us much to work with. Is there an error? If so, please provide the stack-trace. Can you post your main class and your listener class? Have you tried debugging the array list to make sure that the user is, in fact, in the array list?
     
  5. Offline

    d0mov0i

    try using playerNames instead of Player objects on your hashmaps or whatever that is.
     
  6. Offline

    iPoke111

Thread Status:
Not open for further replies.

Share This Page