Jump to content

Conflict with DTags and Medical Items

Pending 1.0.3

Chill Roleplay
  • in Medic

Having some errors with other plugins when medics go on duty aswell as anyplugin that uses OnPlayerDeath is activated when players shoot at downed players activates for example when a player dies on our server you get a dog tag but if you spray a clip at a down player to get a ton of them

Share this comment


Link to comment

00:52 [Error] Failed to call hook 'OnPlayerDeath' on plugin 'MedicalItems v1.0.1' (ArgumentException: An item with the same key has already been added. Key: 76561199023380709)
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <fb001e01371b4adca20013e0ac763896>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <fb001e01371b4adca20013e0ac763896>:0 
  at Oxide.Plugins.MedicalItems.OnPlayerDeath (BasePlayer player, HitInfo info) [0x0008a] in <2aa7b962a47c499c9b5fdc0eca5aaf67>:0 
  at Oxide.Plugins.MedicalItems.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0037f] in <2aa7b962a47c499c9b5fdc0eca5aaf67>: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 

Share this comment


Link to comment

For your first error, this happens because every time a wounded player would normally die, the death gets cancelled by the plugin, but the death hooks are called anyways. Since I cannot prevent hooks from getting called, there is not much I can do on my side. The best solution would be for the developer of MedicalItems to implement check wether an entry in the dictionary already exists before inserting a new one.

The reason for your second issue is pretty much the same, I cannot do much on my side I, but starting with the next version I will provide an API where plugins can check if a player is actually just died or not.

I don't quite understand what you mean by "allowing pvp damage in this situation". If damage to a wounded player would be allowed, they could die before a medic arrives. This would make the entire medic system unnecessary.

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.5k

Customers

Total customers served.

78.6k

Files Sold

Total number of files sold.

1.5m

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.