Config: salary: '&c[Salary] &e{salary}' money-given-in-seconds: 120 If i were to give a PEX rank a node salary.50, then users that are that rank would get 50$ Vault money after each 120 seconds. But only if they are on the server. So for example if i give a person salary.1000 (and if the config says money-given-in-seconds: 120) then he gets 1000$ after each 120 seconds. Use /salary to see how much salary you get (doesnt show the time) so based on the config above, /salary would show &c[Salary] &e<Your rank's salary> in chat. Oh and if you make this then one more thing: Everytime users get their salary they will be shown a text in chat "Payday." this can be changed in the config Thanks i hope it gets made. Permissions: salary.<number> Commands: /salary - shows how much you get each 120 seconds
PotatoTears bukkit plugins are different than normal applications. We can not just start a thread on plugin start and loop trough to check time (looping trough would be easy XD). We would need to use some kind of bukkit timer. And i also think we arent allowed to call bukkit/minecraft things in that timer. So in fact this is much harder than you think XD.
Oh and if you make this then one more thing: Everytime users get their salary they will be shown a text in chat "Payday." this can be changed in the config.
PotatoTears https://www.dropbox.com/s/61hzwfd48u4dr2o/SalaryLikeMe.jar Does everything you requested. /salary And the money per 120 seconds. The maxMoney value in the config is used for where to start counting down, if you want somebody to make 100000 each 120 seconds then you need to increase that value. ( big number can give lag though )
timtower Thanks i'll try it out asap. Edit: timtower did you add the perms so each rank gets different salaries? and wheres the 120 sec time i can change?
timtower I want to give for example a salary.50 permission node to someone and a timer in the config so in config like salary-per-seconds: 60 so that means the person gets 50$ each minute. Get it? And if i give someone salary.9999 the player gets 9999$ per minute Is this what u did timtower?
Looping through all values below till the player has the permission: "salary.<money>" Don't have the time option yet
timtower tell me when you added that option, i'll be waiting. And what was the point of maxMoney? i dont really get what it does.
https://www.dropbox.com/s/61hzwfd48u4dr2o/SalaryLikeMe.jar Default to 120 And I go through all of the possible numbers between maxMoney and 0, no other way to check if they have the permission for that
timtower thanks ill try this out timtower I don't seem to be getting any salary... I gave myself the salary.45 permission though im not getting any money or anything in the server timtower and the config keeps resetting itsself, i can't change it...
timtower Okay let me see timtower Nope, the config keeps resetting itsself to default. And it does give me salary, but it gives me $1000!!!! Even though i have the salary.45 permission. I want it to give $45 if i have salary.45 perm and 60$ if i have salary.60 etc And i want the /salary to show if i get 45 or 60 etc It just says 0
https://www.dropbox.com/s/61hzwfd48u4dr2o/SalaryLikeMe.jar And do you have OP? Because that will mess stuff up
timtower can you make it where you can change the amount of salary and how many days. For example for config: Config: salaryamount: days: weeks: hours: Then make the permission node salary.use and it will give that user X amount of money specified in config, every X amount of days just repeating.
pilot3101 1. You aren't the OP 2. That would destroy the feature of having different amounts per rank
timtower ill deop myself lemme see timtower im not op and still /salary shows 0 and the config keeps resetting
Oh yeah, didn't even think of that, but you can easily simplify it. Code: for (PermissionAttachmentInfo perm : somePlayer.getEffectivePermissions()) { if (perm.startsWith("salary.")) { String[] split = perm.getPermission().toString().split("."); int salary = 0; try { salary = Integer.parseInt(split[1]); } catch (NumberFormatException ex) { // not a number, deal with it } // 'salary' would now be the number in "salary.<number>" } } If either one of you want, I can re-do this plugin in a bit.
https://www.dropbox.com/s/61hzwfd48u4dr2o/SalaryLikeMe.jar Removed the maxMoney config thing ( don't need it anymore ) Think that I fixed some stuff with this Assist Thanks for that code
timtower Let me see it. brb timtower /salary now says Internal error occured blabla and spams my console And i'm getting no salary heelp
timtower [18:14:53] [Server thread/INFO]: ME issued server command: /salary [18:14:53] [Server thread/WARN]: dets 11, 2013 6:14:53 PM net.minecraft.server.v1_7_R1.PlayerConnection handleCommand SEVERE: null org.bukkit.command.CommandException: Unhandled exception executing command 'salary' in plugin SalaryLikeMe v0.0.1 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:192) at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServer.java:543) at net.minecraft.server.v1_7_R1.PlayerConnection.handleCommand(PlayerConnection.java:923) at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:803) at net.minecraft.server.v1_7_R1.PacketPlayInChat.a(PacketPlayInChat.java:28) at net.minecraft.server.v1_7_R1.PacketPlayInChat.handle(PacketPlayInChat.java:47) at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146) at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:645) at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:243) at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:535) at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:447) at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at nl.timdebrouwer.salarylikeme.SalaryLikeMe.getMoney(SalaryLikeMe.java:51) at nl.timdebrouwer.salarylikeme.SalaryLikeMe.onCommand(SalaryLikeMe.java:76) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ... 13 more [18:14:55] [Server thread/WARN]: [WorldEdit] No compatible nms block class found. [18:14:55] [Server thread/INFO]: ME lost connection: Disconnected [18:14:55] [Server thread/INFO]: ME left the game.