cogu 2 updated DamageDisplay GUI with a new update entry:
1.6

DamageDisplay GUI
Displays the given damage to a player in a GUI
Total Downloads: 4,951 - First Release: Apr 3, 2016 - Last Update: Apr 16, 2016
- 5/5, 15 likes
-
Hey there, is it possible to add that it will be displayed if you shoot at a human npc?
-
-
Hi, the numbers appear to be broken on the latest version again. It gives inaccurate values.
-
-
cogu 2 updated DamageDisplay GUI with a new update entry:
1.6.1
-
I can't seem to get the attacker name or victim name to display. Maybe I'm doing something wrong. I tried messing with the values in config to no avail.
-
The name of attacker not working
-
Below is my string-like variant, which i use by myself. Should be reworked to make xmin_1 and xmin_2 adjustable also.
It is easy to make, i know) And people will stop reporting bugs with (?)overplacing cui parts
Code:float dtime = DisplayTime; float xmin_1=xmin+0.08f; float xmax_1=xmax+0.08f; float xmin_2=xmin+0.35f; float xmax_2=xmax+0.35f; var elements = new CuiElementContainer(); CuiElement damage = new CuiElement { Name = "DamageDisplay", Parent = "HUD/Overlay", FadeOut = dtime, Components = { new CuiTextComponent { Text = "<color=yellow>Урон:</color> "+dmg, FontSize = 18, Align = TextAnchor.MiddleLeft, //FadeIn = dtime }, new CuiOutlineComponent { Distance = "1.0 1.0", Color = "0.0 0.0 0.0 1.0" }, new CuiRectTransformComponent { AnchorMin = xmin + " " + ymin, AnchorMax = xmax + " " + ymax } } }; elements.Add(damage); CuiElement nameof = new CuiElement { Name = "DamageDisplay", Parent = "HUD/Overlay", FadeOut = dtime, Components = { new CuiTextComponent { Text = "<color=yellow>Игрок:</color> "+name, FontSize = 18, Align = TextAnchor.MiddleLeft, //FadeIn = dtime }, new CuiOutlineComponent { Distance = "1.0 1.0", Color = "0.0 0.0 0.0 1.0" }, new CuiRectTransformComponent { AnchorMin = xmin_1 + " " + ymin, AnchorMax = xmax_1 + " " + ymax } } }; elements.Add(nameof); CuiElement range = new CuiElement { Name = "DamageDisplay", Parent = "HUD/Overlay", FadeOut = dtime, Components = { new CuiTextComponent { Text = "<color=yellow>Дист:</color> "+dst, FontSize = 18, Align = TextAnchor.MiddleLeft, //FadeIn = dtime }, new CuiOutlineComponent { Distance = "1.0 1.0", Color = "0.0 0.0 0.0 1.0" }, new CuiRectTransformComponent { AnchorMin = xmin_2 + " " + ymin, AnchorMax = xmax_2 + " " + ymax } } }; elements.Add(range);
-
Nice!!! but name var return empty
-
Getting this error:
Code:[Oxide] 11:12 [Error] Failed to call hook 'OnEntityTakeDamage' on plugin 'DamageDisplay v1.6.1' (InvalidCastException: Null object can not be converted to a value type.) [Oxide] 11:12 [Debug] at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in <filename unknown>:0 at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00000] in <filename unknown>:0 at Oxide.Core.Configuration.DynamicConfigFile.ConvertValue (System.Object value, System.Type destinationType) [0x00000] in <filename unknown>:0 at Oxide.Core.Configuration.DynamicConfigFile.ConvertValue[Single] (System.Object value) [0x00000] in <filename unknown>:0 at Oxide.Core.Configuration.DynamicConfigFile.Get[Single] (System.String[] path) [0x00000] in <filename unknown>:0 at Oxide.Plugins.DamageDisplay.get_X_MinVictim () [0x00000] in <filename unknown>:0 at Oxide.Plugins.DamageDisplay.OnEntityTakeDamage (.BaseCombatEntity victim, .HitInfo hitInfo) [0x00000] in <filename unknown>:0 at Oxide.Plugins.DamageDisplay.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
-
Code:
(23:04:11) | [Oxide] 23:04 [Info] Unloaded plugin DamageDisplayGUI v1.6.1 by cogu (23:04:26) | [Oxide] 23:04 [Info] DamageDisplay was compiled successfully in 4555ms (23:04:26) | [Oxide] 23:04 [Info] Loaded plugin DamageDisplayGUI v1.6.1 by cogu (23:04:26) | [Oxide] 23:04 [Info] [DamageDisplayGUI] DamageDisplay by cogu is now LIVE!
-
• Are you using the default config?
• Did you try deleting the config then reloading the plugin?
If none of those work, can you show me your config?
Seems like the X_MinVictim on the config might be messed up.
[DOUBLEPOST=1461271727][/DOUBLEPOST] -
through times displays the name of the player
-
• Player names are only shown if in a certain distance, by default the configs are:
DisplayAttackerNameRange = 50;
DisplayVictimNameRange = 50;
If you want to show player name regardless of distance, change the value to -1! -
thank you. But I have exposed 1000. And when the plugin is fully erased and re-set, then only again starting to show. A glitch
-
So I removed everything and re-installed it, now it compiled fine no errors but I don't see the hit points on the screen... (no errors in the log either)
Using all default settings, changed nothing... any ideas? -
Seems to be working fine for me here!
-
When damage for attacker and victim are turned off none of the other functions work
-
[SERVER v1.0.20] Console: DamageDisplay.cs(68,17): warning CS0472: The result of comparing value type `Rust.DamageType' with null is always `false'
DamageDisplay.cs(68,31): warning CS0162: Unreachable code detected
DamageDisplay.cs(22,42): warning CS0414: The private field `Oxide.Plugins.DamageDisplay.DisabledFor' is assigned but its value is never used