Factions

A Faction system with Leaders, Taxes, Trades, Ranks, Kill Rewards, and MORE!

Total Downloads: 2,712 - First Release: May 20, 2016 - Last Update: Oct 27, 2017

5/5, 24 likes
  1. Absolut updated Factions with a new update entry:

    3.3.9

     
  2. WOW you are the best! Thank you
     
  3. Hi~ Midgard
    I use event manager to start some game.
    Faction member join the game, they Faction temporary is null. this is ok.
    But, when the game is over. some people lost their Faction. Or they still on Faction but they Chat don't have Faction title.
    Even they name in the Faction list, But they still in event manager team.
     
  4. Code:
    [09/16/2016 02:52:19] [Oxide] 02:52 [Debug]   at Oxide.Plugins.Factions.OnEnterZone (System.String zoneID, .BasePlayer player) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Factions.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
    [09/16/2016 02:52:19] [Oxide] 02:52 [Debug]   at Oxide.Plugins.Factions.OnEnterZone (System.String zoneID, .BasePlayer player) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Factions.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
    [09/16/2016 02:52:19] [Oxide] 02:52 [Debug]   at Oxide.Plugins.Factions.OnEnterZone (System.String zoneID, .BasePlayer player) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Factions.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 
     
  5. You are probably missing the new config option. Go into options and enable/disable faction safe zones to fix this. That will automatically create the entry in the config file for that option.
     
  6. OK,Thank YOU~~~
     
  7. Hi~ Midgard
    Can i remove the default Faction? AND Don't display the Faction UI when don't have Faction player.
    I find when a player don't have Faction, the player join the EVENT GAME . Then, the player choice a Default Faction .
    When the EVENT GAME OVER.
    the Player can't out, and the player Faction will damage.
     
  8. And some people don't want join Faction. They want alone.
     
    Last edited by a moderator: Sep 16, 2016
  9. Code:
    20:29:18) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 223ms
    (20:29:18) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 222ms
    (20:29:19) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 235ms
    (20:29:19) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 226ms
    (20:29:21) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 310ms
    (20:29:22) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 216ms
    (20:29:22) | [Oxide] 20:36 [Warning] Calling 'OnEntityTakeDamage' on 'Factions v3.3.9' took average 3764ms
    (20:29:27) | [Oxide] 20:36 [Warning] Calling 'OnDispenserGather' on 'Factions v3.3.9' took 219ms
     
  10. Hi~Midgard
    Faction can't create more.....
     

    Attached Files:

  11. Lol... Ya that is a lot of factions.

    I'll look into adding pages, it will not be soon
     
  12. Okay, I'll wait for you.
     
  13. Absolut updated Factions with a new update entry:

    3.4.0

     
  14. Thank you!!! Midgard~~~
    In fact, I use your plug-in make a new clan system~~ every faction leader like the gui to manage their member. : )
    [DOUBLEPOST=1474348209][/DOUBLEPOST]
    Code:
    void PlayerManager(BasePlayer player)
            {
                CuiHelper.DestroyUi(player, FactionsUIPanel);
                int i = 0;
                var element = UI.CreateElementContainer(FactionsUIPanel, UIColors["dark"], "0.21 0.1", "0.9 0.9", true);
                UI.CreatePanel(ref element, FactionsUIPanel, UIColors["light"], "0.01 0.02", "0.99 0.98", true);
                UI.CreateLabel(ref element, FactionsUIPanel, UIColors["header"], lang.GetMessage("PlayerManagement", this), 100, "0.01 0.01", "0.99 0.99", TextAnchor.MiddleCenter);
                foreach (var entry in factionData.Factions)
                {
                    CreateCMDButton(ref element, FactionsUIPanel, entry.Key, string.Format(lang.GetMessage("AssignPlayer", this), entry.Value.Name), $"UI_CUIFactionInvite {entry.Key} {0}", i); i++;
                    CreateCMDButton(ref element, FactionsUIPanel, entry.Key, string.Format(lang.GetMessage("UnAssignPlayer", this), entry.Value.Name), $"UI_CUIKickPlayerMenu {entry.Key} {0}", i); i++;
                }
                UI.CreateButton(ref element, FactionsUIPanel, UIColors["orange"], $"{lang.GetMessage("Back", this)}", 16, "0.03 0.05", "0.09 0.09", "UI_CUIAdmin");
                CuiHelper.AddUi(player, element);
            }
    This don't have next page :)
     
  15. Code:
    [09/20/2016 22:43:44] [Oxide] 22:43 [Error] Failed to call hook 'OnEnterZone' on plugin 'Factions v3.4.0' (NullReferenceException: Object reference not set to an instance of an object)
    config don't have it.
     
  16. How to fix this eror "Failed to call hook 'cmdCUILeader'" ?
     
  17. Post the error lines please from console or recon
     
  18. (22:34:30) | [Oxide] 22:34 [Error] Failed to call hook 'cmdCUILeader' on plugin 'Factions v3.4.0' (KeyNotFoundException: The given key was not present in the dictionary.)

    (22:34:30) | [Oxide] 22:34 [Debug] at System.Collections.Generic.Dictionary`2[System.UInt16,Oxide.Plugins.Factions+Faction].get_Item (UInt16 key) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.GetFactionType (.BasePlayer player) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.CheckForActiveEnemies (UInt16 faction) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.Leader (.BasePlayer player) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.CUILeader (.BasePlayer player) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.cmdCUILeader (.Arg arg) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.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
     
  19. The only way this error would occur is if the player trying to access the Leader Panel is not a Leader. Which in that case the button should not even be present.

    Please describe what actions are being taken to create this error.

    Here are some helpful questions:

    1. Is the player creating this error a Leader?
    if Yes: 1a. Is the Faction still in existence? (check data files to make sure it is still there)
    1b. Is the Players UserID listed in the Leaders section of the data file?
     
  20. Regular players have no button.
    1. Yes it is a leader.
    1.a yes it is fractions by default which were created right at the beginning

    this mistake appears periodically


    "Factions": {
    "1254": {
    "Name": "Faction A",
    "FactionKit": null,
    "UIColor": "0.45 0.0 0.9 1.0",
    "ChatColor": "<color=#7300e6>",
    "LeaderTitle": "Leader",
    "Kills": 2,
    "PlayerCount": 7,
    "tax": 10.0,
    "group": null,
    "kit": null,
    "type": 0,
    "FactionZone": false
    },
    "1241": {
    "Name": "Faction B",
    "FactionKit": null,
    "UIColor": "1.0 0.51 0.2 1.0",
    "ChatColor": "<color=#ff9933>",
    "LeaderTitle": "Leader",
    "Kills": 1,
    "PlayerCount": 5,
    "tax": 30.0,
    "group": null,
    "kit": null,
    "type": 0,
    "FactionZone": false
    },
    "1287": {
    "Name": "Faction C",
    "FactionKit": null,
    "UIColor": "0.16 0.63 0.16 1.0",
    "ChatColor": "<color=#29a329>",
    "LeaderTitle": "Leader",
    "Kills": 58,
    "PlayerCount": 6,
    "tax": 49.0,
    "group": null,
    "kit": null,
    "type": 0,
    "FactionZone": false
    },
    "2872": {
    "Name": "Rebels",
    "FactionKit": null,
    "UIColor": "0.52 0.68 0.68 1.0",
    "ChatColor": "<color=#85adad>",
    "LeaderTitle": "None",
    "Kills": 0,
    "PlayerCount": 11,
    "tax": 0.0,
    "group": null,
    "kit": null,
    "type": 1,
    "FactionZone": false
    }
    },
    "leader": {
    "1287": 76********5171,
    "1254": 76********3757,
    "1241": 76********1785
    [DOUBLEPOST=1474570879][/DOUBLEPOST](23:56:30) | [Oxide] 23:56 [Error] Failed to call hook 'OnEnterZone' on plugin 'Factions v3.4.0' (KeyNotFoundException: The given key was not present in the dictionary.)

    (23:56:30) | [Oxide] 23:56 [Debug] at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[Oxide.Plugins.Factions+Gear]].get_Item (System.String key) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.GiveBZItems (.BasePlayer player, System.String role) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.OnEnterZone (System.String zoneID, .BasePlayer player) [0x00000] in <filename unknown>:0

    at Oxide.Plugins.Factions.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