And another thing... You could just make Rank a property and calculate it off the points.

Humanity System
A humanity system based off of the DayZ mod
Total Downloads: 1,598 - First Release: Jul 6, 2016 - Last Update: Aug 6, 2016
- 5/5, 6 likes
-
-
You dont want to see the stuff I did back in December 2015 -
DylanSMR updated Humanity System with a new update entry:
1.0.5
-
Great plugin man. Any chance we can have the option to toggle on/off the text above the head?
-
DylanSMR updated Humanity System with a new update entry:
1.0.6
-
Cheers dude! epic. Looking forward to future updates. I think suggested on a few pages back is re positioning of the HUD. Equally spaced just above the top health bar on the right corner would be ideal i think.
Good work! -
Tried to use this plugin. This is the error when I tried to open the GUI.
Code:[Oxide] 19:30 [Error] Failed to call hook 'RenderUI' on plugin 'HumanitySystem v1.0.6' (NullReferenceException: Object reference not set to an instance of an object) [Oxide] 19:30 [Debug] at Oxide.Plugins.HumanitySystem.GetStat (.BasePlayer player, System.String Stat) [0x00000] in <filename unknown>:0 at Oxide.Plugins.HumanitySystem.RenderUI (.BasePlayer player) [0x00000] in <filename unknown>:0 at Oxide.Plugins.HumanitySystem.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod 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 name, System.Object[] args) [0x00000] in <filename unknown>:0
-
Make sure to delete your config file and then reload the plugin.
[DOUBLEPOST=1468972841][/DOUBLEPOST]Just reinstalled the plugin on my end it worked fine. Just reinstall it or reinstall the data/config(delete and reload) -
You are saving the playerData in a var, if it doesn't exist, create it. But after you create it, you do NOT assign it to the variable again. I'd just recommend you to do it like in OnEntityDeath -
So like this instead?
Code:public object GetRank(BasePlayer player) { if (players.Find(player) == null) OnPlayerInit(player); players playerData = players.Find(player); if(playerData.Rank == 0) return "Neutral"; else if(playerData.Rank == 1) return "Hero"; else if(playerData.Rank == 2) return "Bandit"; return null; }
-
-
Any other suggestions? Will the original version of that code effect the plugin itself before I update it?
-
enum Humanity
{
Bandit = -1,
Civilist = 0,
Hero = 1
} -
Doesn't seem to be counting kills etc.
-
The only reason it shouldn't be counting is either that the player is not killing another player or the player used the kill command in console.
-
[07/19/2016 19:59:20] [Oxide] 19:59 [Error] Failed to call hook 'HumanStat' on plugin 'HumanitySystem v1.0.6' (NullReferenceException: Object reference not set to an instance of an object)
[07/19/2016 19:59:38] [Oxide] 19:59 [Error] Failed to call hook 'HumanStat' on plugin 'HumanitySystem v1.0.6' (NullReferenceException: Object reference not set to an instance of an object)
[07/19/2016 20:00:33] [Oxide] 20:00 [Error] Failed to call hook 'RenderUI' on plugin 'HumanitySystem v1.0.6' (NullReferenceException: Object reference not set to an instance of an object)
[07/19/2016 20:01:49] [Oxide] 20:01 [Error] Failed to call hook 'HumanStat' on plugin 'HumanitySystem v1.0.6' (NullReferenceException: Object reference not set to an instance of an object)
[07/19/2016 20:02:50] [Oxide] 20:02 [Error] Failed to call hook 'HumanStat' on plugin 'HumanitySystem v1.0.6' (NullReferenceException: Object reference not set to an instance of an object) -
DylanSMR updated Humanity System with a new update entry:
1.0.7
-
So, just tested it. Player killed me, i lost -50 humanity, received 1 kill and 1 death. Player who killed me had no change or count towards his name.
-
DylanSMR updated Humanity System with a new update entry:
1.0.8
[DOUBLEPOST=1468979884][/DOUBLEPOST]