[ECON/MISC] DeathPenalty v1.08 - Take money from players when they die [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Pandemoneus, Jul 11, 2011.

  1. DeathPenalty by Pandemoneus
    Version 1.08

    This plugin makes players lose money when they die. This includes a configurable threshold, amount lost and messages.

    Features:
    • Players lose money when they die
    • Gives money to player killers
    • Configurable via a YML file
    Downloads:
    Requirements:
    • iConomy 5.0 OR BOSEconomy 6.2 (if both installed for whatever reasons, iConomy will be used)
    • Permissions 3.x (optional)
    • WorldGuard 5.2.3 (optional)
    Configuration:

    Launch once to create a configuration file.
    It is then located at /plugins/DeathPenalty/config.yml.

    Options are:
    • Money: [amount] - money to lose on death
    • TargetMinMoney: [amount] - money a player must have at least to lose money at all
    • LosePercentage: [amount] - percentage of the money the player should lose when he dies -- NOTE: this will be used instead of "Money" if not 0.0
    • BalanceCanBeNegative: [true, false] - determines whether the player's money can be negative after subtracting
    • FloorAfterSubtraction: [true, false] - determines whether the player's money should be floored (rounded down) after subtracting (iConomy only)
    • ShowMsgOnDeath: [true, false] - determines whether a message is shown on the player's death
    • NotEnoughMoney: [message] - shows this message when a player dies but didn't have enough money
    • LostMoney: [message] - shows this message when a player dies and when he had enough money -- Use <Money> to make the plugin insert the amount lost, <Currency> to display the currency name and finally <Percentage> if you want to show the percentage defined in 'LosePercentage'
    • GiveMoneyToKiller: [true, false] - determines whether the player who killed the victim should receive the money lost by the victim
    Permission Nodes:

    Commands:
    • deathpenalty (alias: dp) - shows the help
    • deathpenalty reload (alias: dp reload) - reloads the plugin
    • deathpenalty info (alias: dp info) - shows the currently loaded config
    Donations:

    [​IMG]

    Changelog:
    Version 1.08
    • Penalty money is now cut off after the second decimal
    Version 1.07
    • Added PermissionBukkit support
    Version 1.06
    • Added customizable version for the killer message
    • Added new tag <Victim> to display the victim's name
    • Added new tag <Killer> to display the killer's name (only works when you were actually killed by a player, of course)
    Older Versions (open)

    Version 1.054
    • Slight restructuring of code which should also fix a NullPointerException
    Version 1.053
    • Attempt to fix multiple subtractions and loss of money although player did not die (NOTE: as always, needs testing for PvP)
    Version 1.052
    • Killer should really receive money now (NOTE: Test it)
    Version 1.051
    • Added message for the killer that he received money
    Version 1.05
    • Added PVP reward (NOTE: This needs testing, I can't do that on my own)

    Version 1.04
    • Added BOSEconomy support
    • Added Permission 'deathpenalty.losemoney' that makes only certain players lose money on death
    Version 1.03
    Note: Had a big typo in the plugin name. Make sure you reconfigure everything and delete the old plugin!
    • Added WorldGuard support
    • You can now set whether penalties get applied in WorldGuard regions
    Version 1.02
    • Added more tags, <Percentage> and <Currency>
    • Fixed bug causing an exception in replaceTag
    • Added support for more than one occurence of a tag in a string
    Version 1.01
    • Added percentage removal
    Version 1.0
    • Initial release
     
  2. Alright, so the new version is a bit buggy. Gotta see what I can do about it.

    Version 1.053
    • Attempt to fix multiple subtractions and loss of money although not dead
     
  3. Offline

    sephiroth7240

    10:35:33 [SEVERE] Could not pass event ENTITY_DEATH to DeathPenalty
    java.lang.NullPointerException
    at com.pandemoneus.deathPenalty.DPEntityListener.onEntityDeath(DPEntityListener.java:81)
    at org.bukkit.plugin.java.JavaPluginLoader$59.execute(JavaPluginLoader.java:656)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
    at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:141)
    at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:391)
    at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:436)
    at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:179)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:728)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    im having this error sometimes on the server.. any know why?
     
  4. Version 1.054

    • Slight restructuring of code which should also fix a NullPointerException
     
  5. Offline

    Trollkemada

    Could you make msg customizables? So I can translate them.

    Thanks for doing this plugnis. iConmyDeath is not being updated :(
     
  6. Version 1.06

    • Added customizable version for the killer message
    • Added new tag <Victim> to display the victim's name
    • Added new tag <Killer> to display the killer's name (only works when you were actually killed by a player, of course, otherwise it will be blank)
     
  7. Offline

    quickclay

    Seems cool! I'll try it out on our server today. iConomyDeath seems unsupported now.
     
  8. Offline

    kside

    Feature Request:
    Death Tax varies per permissions group.
    Group 1 is taxed 10%
    Group 2 is taxed 50%

    Either implement static groups + permissions or have them configurable in the config file.
    deathpenalty.losemoney.group1
    deathpenatly.losemoney.group2

    or have the groups in the actual config file:
    group1:
    tax: 10
    group2:
    tax: 50

    Also, making the pvp money steal configurable. So 70% of the lost money is stolen by the killer.

    :rolleyes:
     
  9. Offline

    NinjaGrinch

    iConomy 6 support would be awesome!
     
  10. Offline

    Trollkemada

    Thanks you for the plugins, im testing it and seems really well :)

    Would it be possible some negative effects on the people that has negative amount of money? Like walking slower, or something like that?
     
  11. Offline

    Sherryberry

    I was wondering if you could tell me if I'm doing anything wrong. When someone dies, DeathPenalty doesn't even seem to register that anything has happened. I am using PermissionsBukkit, and everyone has the deathpenalty.losemoney node. Here's my config:

     
  12. I did not add support for PermissionsBukkit yet, I will do it soon.
     
  13. iConomy 6? There is no version 6.

    Will be in a future update.

    Not going to add that, you can make a seperate plugin for that.

    Will be patched in a few minutes.

    Version 1.07
    • Added PermissionBukkit support

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

    Sherryberry

    Yay! Thanks so much. :)

    EDIT: My players still don't lose any money though. :( Is my percentage set too low? I was afraid maybe it was seeing o.o1 as "o.o"
     
  15. @Sherryberry What kind of economy are you using?
    You might also want to set the WorldGuard setting to false.
     
  16. Offline

    Sherryberry

    I do use WorldGuard with my starting area, but I have been killing myself out in the middle of nowhere to test. xD Should I still disable it to see if it makes a difference?

    I use iConomy, I check my balance before and after I die, no messages, no nothing. It's so strange. :(
     
  17. Yes, disable it and see whether it makes a difference.
     
  18. Offline

    Sooks

    Could you add it so that you can turn off people losing money from regular dying so they only lose money when they PVP?
     
  19. @Sooks If you do it for the PvP feature only, there are other plugins that are designed for that. This one is for regular dying. D:
     
  20. Offline

    Sooks

    @Pandemoneus Okay, I really enjoy this one. The only other one that I could find close to doing what I wanted was "pvp reward" which lost support and it doesn't work... But if by chance you do add it I would greatly appreciate it. *crosses fingers* haha. Seriously though do you think you could :)
     
  21. Offline

    Trollkemada

    Could it be possible that the msg show when the player respawns instead of when the player die?
    Also, could you add color support for the mensagges?

    Thanks for the plugin :D
     
  22. Offline

    Trollkemada

    Umh, weird, some times it sais I have loosen 30.0000000004 money :S
     
  23. Yep, I saw that while testing, but I didn't find a solution to that yet.

    Or hm, I got something new in mind that might be worth a try.

    Version 1.08

    • Penalty money is now cut off after the second decimal

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

    Austin

    Just updated. Im getting this error when using /slay.

    Code:
    [SEVERE] Could not pass event ENTITY_DEATH to DeathPenalty
    java.lang.StringIndexOutOfBoundsException
            at java.lang.AbstractStringBuilder.delete(Unknown Source)
            at java.lang.StringBuilder.delete(Unknown Source)
            at com.pandemoneus.deathPenalty.DPEntityListener.replaceAllTags(DPEntityListener.java:127)
            at com.pandemoneus.deathPenalty.DPEntityListener.useIConomy(DPEntityListener.java:192)
            at com.pandemoneus.deathPenalty.DPEntityListener.onEntityDeath(DPEntityListener.java:104)
            at org.bukkit.plugin.java.JavaPluginLoader$60.execute(JavaPluginLoader.java:663)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:142)
            at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:42)
            at com.sk89q.worldguard.bukkit.commands.GeneralCommands.slay(GeneralCommands.java:201)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:343)
            at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:256)
            at com.sk89q.worldguard.bukkit.WorldGuardPlugin.onCommand(WorldGuardPlugin.java:181)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:352)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:737)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:701)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:694)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:454)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  25. Shouldn't happen, but I added something that prevents this now. Tell me when there are more strange things happening.

    Download the file again, I didn't add that fix in the changelog.
     
  26. Offline

    Austin

    Now I get this, related to our stats plugin.

    Code:
    [SEVERE] Could not pass event ENTITY_DEATH to Statistician
    java.lang.NullPointerException
            at com.ChaseHQ.Statistician.Listeners.StatisticianEntityListener.onEntityDeath(StatisticianEntityListener.java:27)
            at org.bukkit.plugin.java.JavaPluginLoader$60.execute(JavaPluginLoader.java:663)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:142)
            at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:42)
            at com.sk89q.worldguard.bukkit.commands.GeneralCommands.slay(GeneralCommands.java:201)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:343)
            at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:256)
            at com.sk89q.worldguard.bukkit.WorldGuardPlugin.onCommand(WorldGuardPlugin.java:181)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:352)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:737)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:701)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:694)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:454)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    I am still using worldgaurd's /slay.
     
  27. That's not my plugin, that's Statistician.
     
  28. Offline

    Trollkemada

    Are you gonna somethjink like give 130% or 70% money to the killer? Would be cool ;)
     
  29. Offline

    Austin

    A request I would REALLY like.

    The ability to use percents, minimums, and maximums all at the same time.

    Is this possible? I have a percent set, 12, but the rich players are getting pwned by this, and with no decent banking plugin, im kinda left with no options.
     
  30. Offline

    forceserver

    doesn't this plugin support spout?
     
  31. Offline

    Trollkemada

    It doesn't give money to the killer if he uses a bow and arrows to kill.
     

Share This Page