arguments help

Discussion in 'Plugin Development' started by shadow5353, Nov 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    shadow5353

    Hello Developers

    I am trying to players do others gravity in my plugin, but i keep get a error.

    Heres my code:
    Code:
    GravityEffect g = new GravityEffect();
                   
                    if(args[0].equalsIgnoreCase("0")){
                        g.Level0(p);
                        if(!p.hasPermission("customgravity.other.0")){
                            m.GetPlayerError(p);
                        }
     
                    if(p.hasPermission("customgravity.other.0")){
                        Player target = Bukkit.getServer().getPlayer(args[1]);
                        if(target == null){
                            MessageManager.getInstance().severe(p, "Could not find " + args[1] + "!");
                        }
                        if(args.length == 1){
                            target.removePotionEffect(PotionEffectType.SPEED);
                            target.removePotionEffect(PotionEffectType.SLOW);
                            target.removePotionEffect(PotionEffectType.JUMP);
                            MessageManager.getInstance().good(target, "Your gravity has been changed!");
                        }
                    }
                        else if (p.hasPermission("customgravity.other.0")) return true;
                        }
     
  2. Offline

    boboman13

    What's the error?
     
Thread Status:
Not open for further replies.

Share This Page