Creating Sign Permissions?

Discussion in 'Plugin Development' started by _CynicalSura, Jul 11, 2013.

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

    _CynicalSura

    I'm having trouble with coding permissions for my command signs.

    Code:java
    1. @EventHandler
    2. public void onSignChange(SignChangeEvent v) {
    3.  
    4. if (v.getLine(0).equalsIgnoreCase("[Heal]")) {
    5. v.setLine(0, "§4[Heal]");
    6. v.setLine(1, "§0Click Here To");
    7. v.setLine(2, "Be Healed!");
    8. }


    I would like to add a permission to this so that not just anyone can create the signs :3
    if any one could help that would be great ^_^
     
  2. Offline

    seemethere

    Code:java
    1. @EventHandler
    2. public void onSignChange(SignChangeEvent v) {
    3. if (v.getLine(0).equalsIgnoreCase("[Heal]")) {
    4. ////////////////////////////////////////////////////////////////
    5. if (!v.getPlayer().hasPermission("random.permission.goes.here")) {
    6. v.getPlayer().sendMessage("Noap");
    7. return;
    8. }
    9. ////////////////////////////////////////////////////////////////
    10. v.setLine(0, "§4[Heal]");
    11. v.setLine(1, "§0Click Here To");
    12. v.setLine(2, "Be Healed!");
    13. }
    14. }
     
    _CynicalSura likes this.
  3. Offline

    _CynicalSura


    Thank you ^_^
     
Thread Status:
Not open for further replies.

Share This Page