Solved How would you ban a player with a custom message

Discussion in 'Plugin Development' started by nrs23, Oct 9, 2013.

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

    nrs23

    you've got your bog standard
    Code:java
    1. player.setBanned(true);


    But how would you go about banning them AND replacing the you've been banned by server with something like "you've been banned for using a hacked client <playername> you ban will NOT expire"

    im sorry if this is a noobish question but then again thats what i am :D
     
  2. Offline

    MrSparkzz

    nrs23
    When you do the player.setBanned(true); it won't kick the player from the server.
    You need to kick them like this
    Code:java
    1.  
    2. player.kickPlayer("Ban Message");
    3.  
     
  3. Offline

    nrs23

    sweet thanks
     
  4. Offline

    Steffion

    Save the reason somewere and when they join kick thema's with the reason.
     
  5. Offline

    JPG2000

    nrs23 I would save a config with the banned players and a message, and every time someone logs in it checks to see if there in the file. If so, kick them with the message.
     
Thread Status:
Not open for further replies.

Share This Page