Hooking into pex

Discussion in 'Plugin Development' started by Bush, Oct 8, 2011.

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

    Bush

    If someone can help me hook into pex, please invite me on skype, i want to enable pex in my disabletp plugin thnx
    bush.bosch
     
  2. Offline

    Celeixen

    PEX uses superpermissions doesn't it? Don't you just say
     
  3. Offline

    Bush

    dunno never used it before
     
  4. Offline

    Celeixen

    So what are you trying to do, just test if the player has a permission? if so just use the code above, superperms is apart of bukkit now, so you can call that just with the bukkit api.
     
  5. Offline

    Bush

    no, i wanna hook into permissionEX and use it with my disabletp plugin so that i can set it that admins can disable teleprt for other users
     
  6. Offline

    Celeixen

    just give admins the permission "TP.Candisable"

    It could be used like this
    Code:
    //have your oncommand stuff
    if (player.haspermisson("TP.Candisable"){
    config.setboolean(args[2],false);}
    else
    {player.sendmessage("You cant do that");}
     
  7. Offline

    Bush

    so in my plugin.yml i should just add that then?

    thnx for the input, :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  8. Offline

    Celeixen

    Yea, just register the permission nodes you think your going to use. Try use the code i posted before(i think its right, if i remember your source code correctly).

    just to make sure, are you trying to make it so some players can't tp at all or that admins can set if a player can be tp'ed to or not.
     
  9. Offline

    Bush

    the second one, but you see its allready set up so anyone can use the command, but i want so that just the admins can say for example /tp disable Bush and then no one can teleport to bush but he can still teleport to every1

    @Celeixen i'll use your method now haha
    but how do i had it in the plugin yml

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  10. Offline

    Celeixen

    Yea well use the code i posted. The basic idea is you want to just set the config to false & just get the player name from the Args but remember to check:
    Code:
    if (Bukkit.getPlayerExact(args[2]) == null){
         return;
            }
    You have to get a boolean from args[3]
    Code:
    boolean TorF = true;
    if (args[3].equalsignorecase("false")){
    TorF = false;}
    else{ if(args[3].equalsignorecase("true")){
    TorF = true;}
    else{
    sender.sendmessage("incorrect syntax");
    return;}}
    Then just do the config.setboolean(args[2],TorF);

    Maybe this will help?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  11. Offline

    Bush

  12. Offline

    Celeixen

    Yep, perfect. i like it how you gave real descriptions too lol, i am never really bothered because no-one ever gets to read them.
     
  13. Offline

    Bush

    @Celeixen
    and then in my permmisions.yml i just say
    tp.tpdisable: true
    tp.tpenable: true?
     
  14. Offline

    Celeixen

    yea, i have to go now btw
     
  15. Offline

    Bush

    k, but its not working, it says tp.tpenable: is not valid

    We'll i took the stuff out of the permissions.yml and it still works with op

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  16. Offline

    ArcheCane

    Did you register it in the plugin.yml and java properly?
     
  17. Offline

    Bush

    We'll i took the stuff out of the permissions.yml and it still works with op
    but now the only thing left to do is make custom groups, and i don't know how
     
  18. Offline

    Celeixen

    I can't tell what the problem is unless you give me error logs/screenshots.

    Wow, you have 300+ posts in just over a month, you must be spamming :p
     
  19. Offline

    Bush

    haha no, i started out on a spamming streak, but latly i've been posting much less.
     
Thread Status:
Not open for further replies.

Share This Page