Anti devo avec les messages de couple '!' (#41)
* Anti devo avec les messages de couple '!' * Added warning message & replaced spaces with tabs If you attempt to send a message starting with an exclamation mark and you're not in love, you will receive a warning message telling you that your message has not been sent because you're not in love. Co-authored-by: leomelki
This commit is contained in:
parent
b66cf7ec17
commit
9b1ac1c838
1 changed files with 6 additions and 3 deletions
|
@ -255,9 +255,12 @@ public class RCupidon extends Role{
|
|||
public void onChat(AsyncPlayerChatEvent e) {
|
||||
LGPlayer player = LGPlayer.thePlayer(e.getPlayer());
|
||||
if(player.getGame() == getGame()) {
|
||||
if(e.getMessage().startsWith("!") && player.getCache().has("inlove")) {
|
||||
player.sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1));
|
||||
player.getCache().<LGPlayer>get("inlove").sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1));
|
||||
if(e.getMessage().startsWith("!")) {
|
||||
if(player.getCache().has("inlove")){
|
||||
player.sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1));
|
||||
player.getCache().<LGPlayer>get("inlove").sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1));
|
||||
}else
|
||||
player.sendMessage("§4Erreur : §cVous n'êtes pas en couple !");
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue