Freeze

Discussion in 'Spigot Plugin Help' started by zKiller171, Jun 1, 2017.

  1. I've make a Freeze plugin but I've this problem: I would to do when player frozen logout, send a message to all player have that perm "Shark.alert" that message "%player% logout Whilst frozen"

    This is my main.java: https://pastebin.com/WY1Acq6n

    Thanks
     
  2. Whats the problem? Message not sending, etc.
     
  3. Replace:
    Code (Text):
    if (players.hasPermission("Shark.Alert")) {
                    t.sendMessage(prefix + ChatColor.RED +"%player%"+ ChatColor.AQUA +" Logout whilst frozen");
                 }
    With:
    Code (Text):
    for (Player players : Bukkit.getOnlinePlayers())
                    if (players.hasPermission("Shark.Alert")) {
                      players.sendMessage(ChatColor.RED + p.getPlayer().getName() + ChatColor.AQUA + " has logged out whilst frozen!");
                    }
                 }
     
  4. ok I'll try then
     
  5. Doesn't work, the message doesn't show in chat