Advertisement
Guest User

Untitled

a guest
Jan 4th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. package craftedevil.plugin;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.player.PlayerJoinEvent;
  9. import org.bukkit.event.player.PlayerQuitEvent;
  10.  
  11. public class onPlayerLoginEvent
  12. implements Listener {
  13.  
  14. @EventHandler
  15. public void OnPlayerLoginEvent(PlayerJoinEvent e)
  16. {
  17. Player player = e.getPlayer();
  18. if (player.hasPermission("sg.login.normal")) {
  19. e.setJoinMessage(ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "[" + ChatColor.YELLOW + "plugin" + ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "] " + ChatColor.WHITE + "" + player.getDisplayName() + ChatColor.GRAY + " joined the game");
  20. Bukkit.getServer().broadcastMessage(ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "[" + ChatColor.YELLOW + "plugin" + ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "] " + ChatColor.GRAY + "There are now " + ChatColor.DARK_GRAY + "[" + ChatColor.GREEN + "" + (Bukkit.getServer().getOnlinePlayers().length) + ChatColor.DARK_GRAY + "]" + ChatColor.GRAY + " players waiting to play.");
  21. }
  22. }
  23. @EventHandler
  24. public void OnPlayerQuitEvent(PlayerQuitEvent e)
  25. {
  26. Player player = e.getPlayer();
  27. if (player.hasPermission("sg.login.normal")) {
  28. e.setQuitMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[" + ChatColor.YELLOW + "plugin" + ChatColor.GREEN + "" + ChatColor.BOLD + "] " + ChatColor.WHITE + "" + player.getDisplayName() + ChatColor.GRAY + "left the game!");
  29. Bukkit.getServer().broadcastMessage(ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "[" + ChatColor.YELLOW + "plugin" + ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "] " + ChatColor.GRAY + "There are now " + ChatColor.DARK_GRAY + "[" + ChatColor.GREEN + "" + (Bukkit.getServer().getOnlinePlayers().length) + ChatColor.DARK_GRAY + "]" + ChatColor.GRAY + " players waiting to play.");
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement