yLR111 Postado Julho 23, 2017 Denunciar Postado Julho 23, 2017 Simplesmente quando o jogador estiver mutado não poder utilizar comando como /tell <jogador>, e tambem megafone
GhostTheWolf Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 É uma dúvida de programação ou de configuração?
GhostTheWolf Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 (editado) Na classe BanManager, tem o método getMute(String name) que retorna Mute ou null (caso não esteja mutado). Seria isso? Exemplo: @EventHandler public void onCommand(PlayerCommandPreprocessEvent event) { String playerName = event.getPlayer().getName(); Mute mute = banmanager.getMute(playerName); if (mute != null) { event.setCancelled(true); } } Editado Julho 25, 2017 por RoinujNosde
Terminall Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 @EventHandler public void Event(PlayerCommandPreprocessEvent e){ Mute mute = MaxBans.instance.getBanManager().getMute(e.getPlayer()); if (mute!=null){ if (e.getMessage().startsWith("/tell ") || e.getMessage().startsWith("/megafone ")){ e.getPlayer().sendMessage("§cVocê está mutado"); e.setCancelled(true); } } } API do maxbans: https://dev.bukkit.org/projects/maxbans/pages/api
yLR111 Postado Julho 25, 2017 Autor Denunciar Postado Julho 25, 2017 Na classe BanManager, tem o método getMute(String name) que retorna Mute ou null (caso não esteja mutado). Seria isso? Exemplo: @EventHandler public void onCommand(PlayerCommandPreprocessEvent event) { String playerName = event.getPlayer().getName(); Mute mute = banmanager.getMute(playerName); if (mute != null) { event.setCancelled(true); } } Olhe está dando erro https://hastebin.com/oyeciqifux.java
yLR111 Postado Julho 25, 2017 Autor Denunciar Postado Julho 25, 2017 @EventHandler public void Event(PlayerCommandPreprocessEvent e){ Mute mute = MaxBans.instance.getBanManager().getMute(e.getPlayer()); if (mute!=null){ if (e.getMessage().startsWith("/tell ") || e.getMessage().startsWith("/megafone ")){ e.getPlayer().sendMessage("§cVocê está mutado"); e.setCancelled(true); } } } API do maxbans: https://dev.bukkit.org/projects/maxbans/pages/api Está dando erro aqui Mute mute = MaxBans.instance.getBanManager().getMute(e.getPlayer());
GhostTheWolf Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 Está dando erro aqui Mute mute = MaxBans.instance.getBanManager().getMute(e.getPlayer()); O carinha esqueceu do getName(). Põe .getName() logo após getPlayer()
yLR111 Postado Julho 25, 2017 Autor Denunciar Postado Julho 25, 2017 O carinha esqueceu do getName(). Põe .getName() logo após getPlayer() Coloquei mais não funcionou o plugin
GhostTheWolf Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 Hmm. Qual erro deu? E qual o código atual?
yLR111 Postado Julho 25, 2017 Autor Denunciar Postado Julho 25, 2017 Hmm. Qual erro deu? E qual o código atual? http://prntscr.com/g0949a
yLR111 Postado Julho 25, 2017 Autor Denunciar Postado Julho 25, 2017 Tire o / antes dos comandos. Ainda não esta funcionando
yLR111 Postado Julho 25, 2017 Autor Denunciar Postado Julho 25, 2017 Ainda não esta funcionando http://prntscr.com/g0996h http://prntscr.com/g0996h Resolvido, tinha esquecido de registrar o evento, e o comando funciona com "/" mesmo, vlw
GhostTheWolf Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 Tira o plugin de chat e tenta usar o comando. Você testou o megafone também?
MrTBR Postado Julho 25, 2017 Denunciar Postado Julho 25, 2017 Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas. Atenciosamente, Gamer's Board
Pergunta
yLR111
Simplesmente quando o jogador estiver mutado não poder utilizar comando como /tell <jogador>, e tambem megafone
16 respostass a esta questão
Posts Recomendados