MobHunting

MobHunting

114k Downloads

Drop money from player - Bug

sqweelow opened this issue · 26 comments

commented

Hello!
I have a small problem there.
When player killed by another player its working fine and he drops Bag of Gold. But when killed player's have no money (balance=0) its still drops gold from him, but i setted rob_from_victim = true. Any suggestions?! Thanks!

commented

I think it is a bug i will look into this as soon as possible

commented

Okey! Thank you very much!

commented

I’m using Spigot 1.12.2 by the way... And essentials eco.

commented

Please provide me with debug information. Enable debug "/mh debug" and kill a player with 0 in balance and let me see the output from the console.

commented

There is no any errors i think...
[10:13:33 INFO]: [MobHunting][Debug] Gamix died - Killstreak ended
[10:13:33 INFO]: [MobHunting][Debug] Gamix was killed by a DonMugad
[10:13:33 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[10:13:33 INFO]: [MobHunting][Debug] DonMugad killed a PvpPlayer (Minecraft)@(world:-1832,76,-709)
[10:13:33 INFO]: [MobHunting][Debug] Basic Prize=100 for killing a PvpPlayer
[10:13:33 INFO]: [MobHunting][Debug] Grinding detection is disabled in config.yml
[10:13:33 INFO]: [MobHunting][Debug] DonMugad has no Rank Multiplier
[10:13:33 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[10:13:33 INFO]: [MobHunting][Debug] This was a PVP kill (killed=Gamix), number of bounties=0
[10:13:33 INFO]: [MobHunting][Debug] There is no Bounty on Gamix
[10:13:33 INFO]: [MobHunting][Debug] [AchievementBlocked] Achievements is disabled in world:world
[10:13:33 INFO]: [MobHunting][Debug] [AchievementBlocked] Achievements is disabled in world:world
[10:13:33 INFO]: [MobHunting][Debug] RecordKill: DonMugad killed a PvpPlayer (Minecraft) Cash=100
[10:13:33 INFO]: [MobHunting][Debug] Description to be send:<!> Вы убили игрока Gamix
[10:13:33 INFO]: [MobHunting][Debug] PVP kill reward is '100'
[10:13:33 INFO]: [MobHunting][Debug] Gamix lost 100
[10:13:33 INFO]: [MobHunting][Debug] 100 was dropped on the ground as item SKULL (# of rewards=2)
[10:13:33 INFO]: [MobHunting][Debug] The command did not run because random number (0.05265741846702232) was bigger than chance (0.0)
[10:13:33 INFO]: [MobHunting][Debug] Did not drop a head: random(0.855356779668332)>chance(0.3)
[10:13:33 INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================
[10:13:33 INFO]: Gamix died

commented

Its saying that’s Gamix lost 100, but his balance was 0 xd

commented

No but you have set the reward to be 100

[10:13:33 INFO]: [MobHunting][Debug] Basic Prize=100 for killing a PvpPlayer

commented

But I setted rob_from_victim to true? It should take money from killed player balance!?

I think it’s working like that:
If killed player have money he drops 100 after his death
If his balance >100 it’s doesn’t drop money

commented

Yes!?

commented

No, the 100 you have set, is exactly like when you kill a mob. Its the same.

Set it to 0 and rob from victim will work. You will get x% of the balance when you kill another player

commented

Is it possible to drop exactly a number (like 100) not a %?

commented

So, what I need to change in my config :/

commented

Yes.

commented

My config:
pvp_allowed: true
rob_from_victim: true
money:
amount: '100'
chance: 1.0

But i found this one:
-# The kill prize can be a number to steal x dollars from the killed player,
-# or it can be a cut in percent of his balance. Rob from victiom is about where the money comes from. -# If FALSE the money comes from from the server, if TRUE the money comes from the dead player.
-# If you dont want the player to get any money for PVP kills, you MUST set pvp_kill_prize: 0
Should i paste this pvp_kill_prize: 0 to config?

commented

If you want 10%

You should set

pvp_kill_prize: 10%

commented

As far as i remember :-)

commented

Thank you a lot! But I want 100$ not a percent! And there is no string called pvp_kill_prize :(

commented

-# ########################################################################
-# Pvp rewards
-# ########################################################################
-# Pvp configuration. Set pvp_allowed = true if you want give the players a reward when they kill eachother.
-# You can alsp run a console command when this happens to give the player a reward or punish him.
-# You can you the following variables {player},{world},{killed_player}.
-# An example could be to give the player permission to fly
-# for 1 hour or use give command to the player items.
-# You can also specify the message send to the player.
-# You can run many console commands on each line, each command
-# must be separated by |

pvp:
  player:

    # Set pvpAllowed=false to disable rewards on killing other players.
    pvp_allowed: true

    # Set rob_from_victim=true to steal from the victim or 
    # rob_from_victim=false to get the reward money from the server.
    rob_from_victim: true

    # Write the message to the killer, describing the reward / console commands
    message: §7§l<§c§l!§7§l> §7Вы убили игрока §4§l{killed_player}

    # The kill prize can be a number to steal x dollars from the killed player,
    # or it can be a cut in percent of his balance. Rob from victiom is about where the money comes from.
    # If FALSE the money comes from from the server, if TRUE the money comes from the dead player.
    # If you dont want the player to get any money for PVP kills, you MUST set pvp_kill_prize: 0
    money:
      amount: '100'
      chance: 1.0

    # One or more console commands to be run when a player kills another player.
    commands:
    - chance: '0.0'
      cmd: ''

    # Drop a head of the killed player
    head:
      drophead: true

      # The Head price if you want playerheads to have a value like the bag of gold.
      value: ''
      chance: 0.3
      message: §7§l<§c§l!§7§l> §7И вам выпала его голова.

commented

What should i change there? To let dead players drop 100$ if they have this amount and nothing if they dont :/

commented

This is not how the plugins works. Sorry.

commented

Like I said this plugin is awesome, thank you for a nice job and support, but its looks not right, when player that doesn’t have this amount of money can drop it!

commented

can You explain me please then?
I don’t understand what I’m doing wrong there

commented

Its 10:50 pm in Denmark, I think you are going to sleep, so thank you and have a great night!

commented

Correct, i will see if i can explain better in the morning :-)

commented

Hmh :/

commented

Sorry I have been very busy at work.

Please check if this build works better for you.

https://fractal.lindegaard.one:8181/job/MobHunting/710/

The PVP reward cant be bigger than the killed players balance, if rob_from_victim is enabled.

If the player has 68 gold, and you have written 100 gold in config.yml, then the reward will only be 68.

Let me know the result. So I can close the ticket.