Solved Perms plugin

Discussion in 'Spigot Plugin Development' started by Fxve, Apr 23, 2017.

Thread Status:
Not open for further replies.
  1. Well i made a permission plugin, this plugin apply the permissions on "PlayerLoginEvent" but theres a second plugin that also uses "PlayerLoginEvent"

    Code (Text):
        @EventHandler
        public void onLogin(PlayerLoginEvent e) {
            if(e.getPlayer().hasPermission("perms.vip")){
             e.disallow(Result.KICK_OTHER, "You have the perms");
            }
    }
    now the trouble is when they log in the event that get fired first is the second non the permission plugin so.. the permissions don't apply! i use this plugin.yml

    Code (Text):
    main: fxve.perms.Main
    version: 1.0
    name: ranksys
    load: STARTUP

    commands:
        setrank:
            description: Sets a player's rank.
    even if i put the event priority to lowest/high the second event get fired first!!
    help please :/
     
  2. btw sorry for my bad english!
     
  3. Try using PlayerPreLoginEvent
    You're able to get the UUID of the player that way,although I'm not sure if you can get the player class using that event.
    If its hard to get the Player class try to use:
    Code (Text):
    Player p = Bukkit.getPlayer(UUID);
     
  4. i also tried that but it didn't work i think its impossible to get the player on that event. anyways thanks!
     
  5. You can not get their Player object (instance) in a LoginEvent
     
  6. I remember using something like this a while back. I'm sure it worked. Oh well, I tried to help.
     
  7. You could also (this is really messy and not recommended) create a runnable that runs 1-2 ticks after the PlayerPreLoginEvent that gets the player through Bukkit.getPlayer(UUID); and run the stuff.
     
  8. it was a mistake on my permission plugin everything is fixed thanks for the help anyways!!!
     
Thread Status:
Not open for further replies.