Solved Adding Permissions

Discussion in 'Plugin Development' started by PeterXonwiiXx, Oct 30, 2015.

Thread Status:
Not open for further replies.
  1. im making a Dubble Jump thingie and i now want to add perms to it but doesnt really work great....

    here is the code http://pastebin.com/XJHuLt11
     
  2. @PeterXonwiiXx
    Looking at your code, it seems that you haven't even tried anything yet.
     
  3. Offline

    N0neoFtheLess

    Code:
    if(player.hasPermission("test.node"){
    //methods
    } else {
      player.sendmessage("You have no permission!")
    }
     
    Zombie_Striker likes this.
  4. @N0neoFtheLess where do i have to put that between?

    @Assist yes i did but it gave me the biggest error so i removed it...xD
     
  5. Offline

    Binner_Done

    @PeterXonwiiXx So, let me show you an example:
    Code:
    if(player.hasPermission("BinnerIs.Awesome"){
    doSomething().letSay.FlyModeEnable
    else{
    player.sendMessage("Awe, seems like you can't fly!")
    
    This is basically what @N0neoFtheLess said but I put the method in
     
  6. @Binner_Done i get it,imma try now,thanks anyways

    @Assist i tried some thing but nothing works,can you tell me or paste the perm in my pastebin? because doesnt work if i do it :-(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2015
  7. @PeterXonwiiXx
    Can you show your current code (with the permission in the code), so we can see what's wrong?
     
  8. @Assist thats the problem,the permission and nothing is gonna work if i add it,just nothing,it will ignore the fuction of it..my code is on top
     
  9. @PeterXonwiiXx
    Like I said in my first post, your code here does not have a permission check. I want to see what you've tried so I can try to explain why it doesn't work.
     
  10. @PeterXonwiiXx
    And what is the problem? What are you trying to achieve (or prevent)? You want to cancel the event if the player does not have the permission and/or their gamemode is creative?
     
  11. @Assist if the player has creative it will cancel(That works) BUT i also want it cancelled if the player does NOT have permission..and if the player DO have perms then it will just do the fuction.... the event/fuction i made is a dubble jump..... Time and Message are Changeable in the config and that already works ...hope this will explain what it does
     
  12. Offline

    DeJay007

    Is the permission registered in the plugin.yml?
    Code:
    permissions:
        test.test:
            description: Test.
            default: op
    
     
  13. @Assist this works but not 100% i cancel the dubblejump but i now gives the player the ablity to fly.... :/

    nvm,i just fixed the problem,i disabled allowfly to another part of this function and it works 100% now,Thanks that you took the time to help me,,,SOLVED

    @DeJay007 no it isnt but it works fine,maybe i will add it but i never register perms in plugin.yml ;p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2015
Thread Status:
Not open for further replies.

Share This Page