Java
15/06/2016 01:30:01
#280
if (fName != null){
    // Some code
}else if (fName == null){
    // Some other code
}
JavaScript
14/06/2016 01:30:01
#279
function negative(number) { 
    if (number.match(/^-\d+$/)) {
        return true;
    } else {
        return false;
    }
}
Java
13/06/2016 01:30:01
#278
public MyObject getInstance() {
    return this;
}
JavaScript
12/06/2016 01:30:01
#277
 if ($('#hdnGender').val() == "" || $('#hdnGender').val() == "notdisclosed") {

        $('#cboGender').val('notdisclosed');


    } else if ($('#hdnGender').val() == "Male") {
        $('#cboGender').val('Male');
    } else {

        $('#cboGender').val('Female');
    }
Java
11/06/2016 01:30:01
#276
   public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
      Player player = (Player)sender;
      if(commandLabel.equalsIgnoreCase("shout")) {
         if(args.length == 0) {
            sender.sendMessage(ChatColor.GRAY + "Not enough arguments! Syntax: /shout <message>");
         }

         if(args.length == 1) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0]);
         }

         if(args.length == 2) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1]);
         }

         if(args.length == 3) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2]);
         }

         if(args.length == 4) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3]);
         }

         if(args.length == 5) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4]);
         }

         if(args.length == 6) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5]);
         }

         if(args.length == 7) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6]);
         }

         if(args.length == 8) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7]);
         }

         if(args.length == 9) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8]);
         }

         if(args.length == 10) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9]);
         }

         if(args.length == 11) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10]);
         }

         if(args.length == 12) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10] + " " + args[11]);
         }

         if(args.length == 13) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10] + " " + args[11] + " " + args[12]);
         }

         if(args.length == 14) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10] + " " + args[11] + " " + args[12] + " " + args[13]);
         }

         if(args.length == 15) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10] + " " + args[11] + " " + args[12] + " " + args[13] + " " + args[14]);
         }

         if(args.length == 16) {
            Bukkit.broadcastMessage(ChatColor.RED + player.getName() + ChatColor.RED + " shouts: " + ChatColor.RED + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6] + " " + args[7] + " " + args[8] + " " + args[9] + " " + args[10] + " " + args[11] + " " + args[12] + " " + args[13] + " " + args[14] + " " + args[15]);
         } else if(commandLabel.equalsIgnoreCase("bitzshout")) {
            sender.sendMessage(ChatColor.BLUE + "-========== " + ChatColor.GOLD + " BitzShout " + ChatColor.BLUE + " ==========-");
            sender.sendMessage(ChatColor.GOLD + "/bitzshout" + ChatColor.DARK_AQUA + " - " + ChatColor.BLUE + "Base command for BitzShout");
            sender.sendMessage(ChatColor.GOLD + "/shout " + ChatColor.GRAY + "<message>" + ChatColor.DARK_AQUA + " - " + ChatColor.BLUE + " Shouts a message to the server.");
            sender.sendMessage(ChatColor.BLUE + "-==================================-");
         }
      }

      return false;
   }
En poursuivant votre navigation sur ce site, vous acceptez l’utilisation de Cookies pour réaliser des statistiques anonymes de visites.
[x]
[Y] J'accepte
[N] Non merci
~$ 
_