getConfig() and ban a player

Discussion in 'Plugin Development' started by chikenlitle99, Apr 22, 2014.

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

    chikenlitle99

    Hello, My plugin ban players when say a word and saves in the configuration file, no way banned when players are trying to enter send a custom message instead of the normal message, if I explain?, This is what I did but it does not work as I want, my idea is to get the player list and ban them ...

    Code:java
    1. @EventHandler
    2. public void onPlayerJoin(PlayerLoginEvent e){
    3. Player p = e.getPlayer();
    4. if(e.getResult() == PlayerLoginEvent.Result.KICK_BANNED){
    5. String banMessage = ("§4§lBanned!\n\n" + "\n"
    6. + "§5§lBy: " + "§7" + getConfig().getString("Messages_ban.Ban_Prefix").replaceAll("&", "§") + "\n"
    7. + "§5§lReason: " + getConfig().getString("Messages_ban.Ban_reason").replaceAll("&", "§") + "\n"
    8. + "§5§lAppeal: " + getConfig().getString("Messages_ban.Ban_appeals").replaceAll("&", "§"));
    9. e.setKickMessage(banMessage);
    10. }
    11. }


    So keep in the configuration file
    PHP:
    PlayerName3
    Any help?

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

    TheMcScavenger

    Learn english. Don't even understand what you want.
     
  3. Offline

    chikenlitle99

    @TheMcScavenger
    I want to do when a player enters the server and this is in the list of the configuration file to be expelled by sending a custom message
    Now?
     
  4. Offline

    chikenlitle99

    Any help?
     
  5. Offline

    BillyBobJoe168

    What is "this" ?
     
  6. Offline

    chikenlitle99

    @BillyBobJoe168
    What I want is:
    If a player is in the configuration file, the player can't enter to the server, ok?
     
  7. Offline

    chikenlitle99

  8. Offline

    monkeymanboy

    Make a list in the config file and add them to that however you want then check if the list contains that name when they join
     
Thread Status:
Not open for further replies.

Share This Page