You're checking if the player is muted?
"if (player.punishment.isMuted()) {"
|
Solved.
You're checking if the player is muted?
"if (player.punishment.isMuted()) {"
What is your issue current? That you can still log in even though you have ban time?
Cause if it is about ban time, you'll need to make it send a return code about being banned.
It does print in the file that the user is banned. If the values are -1, then player is not banned.
The below is in my player file.
Also, the code is there. The isBanned method is as follows.Code:"ban-start": 1523060337679, "ban-duration": 86400000,
Code:public boolean isBanned() { return banStart > 0 && System.currentTimeMillis() - banStart < banDuration; }
Also, I tried to see if it would let me talk if I put it in ChatMessagePacketListener class, and it doesn't. So it works for sure.
Code:if (player.punishment.isBanned()) { player.send(new SendMessage("You are currently banned and can not talk!")); return; }
[/QUOTE]Code:if (player.punishment.isBanned()) { player.send(new SendMessage("You are currently banned and can not talk!")); return; }
If the player is banned how can they talk, change it back to if (player.punishment.isMuted()) {
Code:} else if(parts[0].equals("ban")) { String player2 = command.substring(parts[0].length() + 1); Player plr = World.getPlayerByName(player2); if(!PlayerSaving.playerExists(player2) && plr == null) { player.getPacketSender().sendMessage("Player "+player2+" is not online."); return; } if(PlayerPunishment.banned(player2)) { player.getPacketSender().sendMessage("Player "+player2+" already has an active ban."); if(plr != null) { plr.logout(); } return; } PlayerPunishment.ban(player2); player.getPacketSender().sendMessage("Player "+player2+" was successfully banned. Command logs written."); if(plr != null) { plr.logout(); }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |