Comments on Profile Post by 1Achmed1

  1. DevRosemberg
    DevRosemberg
    Check if the player has a permission before doing it :P
    May 2, 2014
  2. 1Achmed1
    1Achmed1
    can you give me an example, I'm not sure how to get who fired in the event.
    May 2, 2014
  3. DevRosemberg
    DevRosemberg
    Do a check like event.getProjectile().getSource() instanceof Player and then do Player player = (Player) event.getProjectile().getSource(); and then if (player.hasPermission("blah") { //Do your stuff here }
    May 2, 2014
  4. 1Achmed1
    1Achmed1
    Player player = (Player) event.getEntity().getShooter();
    if(Player.hasPermission("dathoe.smite")) { hitBlock.getWorld().strikeLightning(hitBlock.getLocation());
    }

    Don't work
    May 2, 2014
  5. DevRosemberg
    DevRosemberg
    What error does it show?
    May 2, 2014
  6. 1Achmed1
    1Achmed1
    it cannot make a static reference to a non-static method hasPermission()
    May 2, 2014
  7. DevRosemberg
    DevRosemberg
    send me the whole class on a pastie.
    May 2, 2014
  8. 1Achmed1
  9. 1Achmed1
    1Achmed1
    got anything?
    May 2, 2014
  10. DevRosemberg
    DevRosemberg
    You misspelled player, its not Player.hasPermission, its player.hasPermission as defined in the variable.
    May 2, 2014
  11. 1Achmed1
    1Achmed1
    Oh, sry I forgot to change that when I made the variable. Thx :)
    May 2, 2014