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
  1. And another thing... You could just make Rank a property and calculate it off the points.
     
  2. I suppose I could. I might do something to make my work a bit cleaner.
     
  3. Code cleanness will come by time lol :p
    You dont want to see the stuff I did back in December 2015
     
  4. DylanSMR updated Humanity System with a new update entry:

    1.0.5

     
  5. Great plugin man. Any chance we can have the option to toggle on/off the text above the head?
     
  6. DylanSMR updated Humanity System with a new update entry:

    1.0.6

     
  7. 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!
     
  8. 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 
     
  9. 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)
     
  10. I noticed a failure in your new API functions :p
    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 :p
     
  11. 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;
            }
     
  12. Yea. Pretty much.
     
  13. Any other suggestions? Will the original version of that code effect the plugin itself before I update it?
     
  14. Well, you could makenHumanityData.Rank a property now, which does basicly the same as CalculateRank. Also instead of having it as an int you could use an enum.

    enum Humanity
    {
    Bandit = -1,
    Civilist = 0,
    Hero = 1
    }
     
  15. Doesn't seem to be counting kills etc.
     
  16. 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.
     
  17. [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)
     
  18. 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.
     
  19. DylanSMR updated Humanity System with a new update entry:

    1.0.8


    [DOUBLEPOST=1468979884][/DOUBLEPOST]
    Sorry about that. Just updated. I guess I made it so the attacker was also the victim. :p