Jump to content

1 Screenshot

  • 48.4k
  • 657
  • 9.72 kB
This area is intended for discussion and questions. Please use the support area for reporting issues or getting help.

Recommended Comments

ΝΞΜΞΣΙΣ

Posted

Hey there! would it be possible to instead of deducting a raw amount, deduct a % of a players total $ or RP instead? It makes it easier to balance out dying as a new player vs a long time veteran.

  • Moderator
Mals

Posted

This was added.

Dr.D.Bug

Posted

It would be nice if we could also subtract some zLevel instead of Economics or Server Rewards 🙂

  • Like 1
  • Moderator
Mals

Posted (edited)

Added Scrap.  It already had ServerReward and Economics.  Also allow a positive amount, which I would suggest caution using.  Just checked Z Levels and it has a death penalty in its configuration.  Best not to duplicate its functionality.

Edited by Mals
  • Like 1
Devrexx

Posted

Failed to call hook 'OnEntityDeath' on plugin 'DeathPenalty v0.1.5' (InvalidCastException: Specified cast is not valid.)
at Oxide.Plugins.DeathPenalty.DockPlayer (BasePlayer bplayer) [0x000a0] in <dbf3e6052c33413093d0a00dddfa41fd>:0
at Oxide.Plugins.DeathPenalty.OnEntityDeath (BaseEntity entity, HitInfo info) [0x0005f] in <dbf3e6052c33413093d0a00dddfa41fd>:0
at Oxide.Plugins.DeathPenalty.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0005b] in <dbf3e6052c33413093d0a00dddfa41fd>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <09575a60985045248bcb43b20faeeb99>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <d5f57e12edfe4fa0b5c5dbdd9b51eff8>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <d5f57e12edfe4fa0b5c5dbdd9b51eff8>:0

Possibly because of F1->Kill or NPC deaths? 

  • Moderator
Mals

Posted

I will look into that, it is a cast, so it is most likely a value issue. I use cast a few times and will review them all.  Can you please shoot me your configuration, so I can test it?

  • Moderator
Mals

Posted

DeathPenalty.cs

WIP, still testing but it clean up the logic and added a try around the part that might fail due to a missing plugin.

 

Devrexx

Posted

3 hours ago, Mals said:

I will look into that, it is a cast, so it is most likely a value issue. I use cast a few times and will review them all.  Can you please shoot me your configuration, so I can test it?

Using the default Config, noticed the Cast error when I was F1 -> Kill'ing, killed by NPC/Animal/Attack chopper. Also using RustRewards, ServerRewards, GatherRewards, etc. so not sure if there is anything conflicting. 

{
  "Penalty Type (amount or percent)": "amount",
  "Penalty Amount": -100.0,
  "Use Economics": false,
  "Use ServerRewards": true,
  "Use Scrap": false
}

 

Devrexx

Posted

14 minutes ago, Mals said:

DeathPenalty.cs 6.74 kB · 1 download

WIP, still testing but it clean up the logic and added a try around the part that might fail due to a missing plugin.

 

No more error from NPC death (bear) or F1->Kill but it did not subtract the RP and gave me the "You are dead poor" message even though I have plenty of RP on this account. 

  • Moderator
Mals

Posted (edited)

Noted.  I suspect in cleaning up the flow of the calculation, I did a misstep. Once my servers are up and running, I will sort it out. Please shoot me your config.

I'm wondering if a plugin is not loading correctly so it is not getting the balance.  I'll check my calls as well.

Edited by Mals
  • Moderator
Mals

Posted

Convert.ToDouble worked better than casting to (double).  Go figure.

  • Like 1
Katsu

Posted

Would it be possible to add a max loss amount? eg max amount loss=1000 so when a player has 50k rp they only loose 1k rather than 5k at a 10% loss rate

 

  • Like 1
  • Moderator
Mals

Posted (edited)

8 hours ago, Katsu said:

Would it be possible to add a max loss amount? eg max amount loss=1000 so when a player has 50k rp they only loose 1k rather than 5k at a 10% loss rate

 

Super easy to add, I have coded it up and I am testing it now... and released.

Edited by Mals
Mado

Posted

Is it possible to penalize players without permissions instead of penalizing them for enabling permissions?

If you want to avoid penalties with timed permissions etc, disabling them individually will still be overridden by group permissions.

IdeaExample: default state (no permissions) ➔ penalties occur
Allow 'deathpenalty.bypass' ➔ no penalty

It's simple and smart when it comes to differentiation.

  • Moderator
Mals

Posted (edited)

Released code that can work either way.

Edited by Mals
  • Love 1
hid333

Posted

My server uses a survival arena. Even death during an event results in a penalty, which makes some players hesitant to participate in the event.

Is it possible to temporarily suspend the event due to zones, etc., or to disable it during the survival arena

Or is it possible to temporarily suspend the event using a command?

hid333

Posted

Can't this be fixed as the penalty is imposed when you are downed, not when you die?
Or I'd like it to be possible to set a cooldown.
Whenever you get hit by a bullet from an NPC while you're down but not dead, a penalty is imposed, so you end up getting penalized multiple times before you die.

  • Moderator
Mals

Posted

I'll check this weekend if there is a hook for downed and if so make it an option. Adding a cool down is not too hard, but will add overhead, so I will make it optional.

Doing a penalty per hit while down is cruel as a NPC that does less damage so take more hits to kill you will cost players more. I'm not keen to do that due to the amount of hook calls, and poor player experience.

Assuming there is a hook, I should be able to do this, this weekend.

  • Like 1
hid333

Posted

Since we used a translation, some of the wording was incorrect so we have rewritten it.
Currently, penalties are imposed when you go down, not when you die, so we would like you to reconsider this if possible.
Also, if you are attacked by an NPC while down, a penalty is imposed for each attack, which results in a large amount of penalty being imposed.
For this reason, we would like to see a penalty imposed when you are completely dead, as mentioned earlier, or a cooldown period.

  • Moderator
Mals

Posted (edited)

It is using the hook: OnEntityDeath

It would be bizarre to trigger on down.  Are you sure you have the correct Death Penalty plugin?  There are two out there.

Edited by Mals
hid333

Posted

3 hours ago, Mals said:

It is using the hook: OnEntityDeath

It would be bizarre to trigger on down.  Are you sure you have the correct Death Penalty plugin?  There are two out there.

If I open the plugin file directly, I will see the following:
[Info("DeathPenalty", "mals", "2.0.3")]

Maybe other plugins are interfering...
However, it would be a shame to have to inflict death penalties on players multiple times in a row, so this could be resolved by adding a cooldown period.
I hope this can be added as an option.

  • Moderator
Mals

Posted

I will get my wife to shoot me to test 😉

  • Moderator
Mals

Posted

Down no money taken, dead money taken. Can you shoot me a list of plugins, it might be an interaction with a plugin?  You can test it yourself on Mal's Plugin Testing PVE.  PVE is off to allow testing.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Like 6

Mals's Collection

User Feedback

1.6m

Downloads

Total number of downloads.

7.7k

Customers

Total customers served.

115.3k

Files Sold

Total number of files sold.

2.3m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.