Solved Idk what to call this...

Discussion in 'Plugin Development' started by dlange, Apr 22, 2015.

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

    dlange

    I am making a coins plugin that gives you coins per minuted based off perms.

    Code:
        public void payPlayers() {
            for (Player p : Bukkit.getServer().getOnlinePlayers()) {
                if (p.hasPermission("coins.default")) coins = 10;
                if (p.hasPermission("coins.coal")) coins = 20;
                if (p.hasPermission("coins.iron")) coins = 30;
                if (p.hasPermission("coins.emerald")) coins = 50;
                if (p.hasPermission("coins.gold")) coins = 70;
                if (p.hasPermission("coins.diamond")) coins = 100;
                getConfig().set("Players." + p.getUniqueId() + ".Coins", getConfig().getInt("Players." + p.getUniqueId() + ".Coins") + coins);
                p.sendMessage(ChatColor.YELLOW + "You just got " + ChatColor.GOLD + coins + ChatColor.YELLOW + " coins for being online " + ChatColor.GOLD + "10" + ChatColor.YELLOW + " minutes.");
            }
            saveConfig();
        }
     
  2. Offline

    Lolmewn

    Are you looking for a name for your plugin or something?
     
  3. Offline

    dlange

    @Lolmewn yeah lol i didn't really explain it well, but it wasn't giving the players ANY coins. I found out it is because PEX was loading after this (so they have no perms) (this was called in onEnable() and had a timer) but i fixed it by adding a 10 tick delay from when server reloads
    [SOLVED]
     
Thread Status:
Not open for further replies.

Share This Page