1. Custom Permissions:
    when you created a kit or edited a kit do:
    /kit permission PERMISSIONNAME
    the permissionname can be a new permission or an existing permission.

    Custom permissions are oxide permissions:

    Apply the plug-in and the command must be set.
    where permissions?
    Did need a separate download?
    I did not find. Permissions!!!!!!
    Head hurts too
    Pearlmission is not separately file to the server.


    Oxide Permissions: <<<?????????????????????????????????????????? WT...

    !@$#%@%^@#$ WHERE PERMISSIONS file!!! WHERE PERMISSIONS file@#$

    default is: "canplayerslist"
    to let players see the players list you must do:

    Can you help mE who

    Please help me.

    oxide.covalence.playerdata?
    oxide.groups?
    oxide.users?

    NO!!! WHAT PERMISSIONS............................:(
    [DOUBLEPOST=1450626076][/DOUBLEPOST]Do you spend a -memorize command command ...
     
    Last edited by a moderator: Dec 20, 2015
  2. Wulf

    Wulf Community Admin

    You shouldnt be trying to find or edit files manually for permissions. All you'd need to use are the permission commands in the ingame chat.
    • /grant <group|user> <name|id> *|<permission>
    • /revoke <group|user> <name|id> *|<permission>
    • /group <add|set> <name> [title] [rank]
    • /group <remove> <name>
    • /group <parent> <name> <parentname>
    • /usergroup <add|remove> <username> <groupname>
    • /show <group|user> <name>
    • /show <groups|perms>
     
  3. x3 Item Drop Applicable to the server? Do you know?
    Do let us know if you know ?
    [DOUBLEPOST=1450629209][/DOUBLEPOST]oxide.root.json
    autosave_DiemensLand.plr
    autosave_DiemensLand.wld
    autoexec_default.cfg
    x3 Item Drop Applicable to the server?
    [DOUBLEPOST=1450629276][/DOUBLEPOST]People hate. Small items
    [DOUBLEPOST=1450629309][/DOUBLEPOST]Do you put up some authority to get more resources?
    [DOUBLEPOST=1450629495][/DOUBLEPOST]Battle Royale X10 server exactly like I want to run a server X3 . must apply to the server where to get more resources?
    [DOUBLEPOST=1450629570][/DOUBLEPOST]What I am saying is the plugin? Or is the game's internal settings
     
  4. Wulf

    Wulf Community Admin

    Use the LootConfig plugin.
     
  5. Thank you.
    [DOUBLEPOST=1450667444][/DOUBLEPOST]//#define DEBUG

    using System;
    using System.Collections.Generic;
    using System.Reflection;

    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;

    namespace Oxide.Plugins
    {
    [Info("LootConfig", "Nogrod", "1.0.0")]
    internal class LootConfig : HurtworldPlugin
    {
    private const int VersionConfig = 1;
    private ConfigData _config;

    private readonly FieldInfo lootConfigsField = typeof(LootCalculator).GetField("_lootConfigs", BindingFlags.NonPublic | BindingFlags.Instance);

    private new void LoadDefaultConfig()
    {
    }

    private new bool LoadConfig()
    {
    try
    {
    Config.Settings = new JsonSerializerSettings();
    if (!Config.Exists())
    return CreateDefaultConfig();
    _config = Config.ReadObject<ConfigData>();
    }
    catch (Exception e)
    {
    Puts("Config load failed: {0}{1}{2}", e.Message, Environment.NewLine, e.StackTrace);
    return false;
    }
    return true;
    }

    private void OnServerInitialized()
    {
    if (!LoadConfig())
    return;
    CheckConfig();
    NextTick(UpdateLoot);
    }

    [ConsoleCommand("loot.reload")]
    private void cmdConsoleReload(string commandString)
    {
    if (!LoadConfig())
    return;
    CheckConfig();
    UpdateLoot();
    Puts("Loot config reloaded.");
    }

    [ConsoleCommand("loot.reset")]
    private void cmdConsoleReset(string commandString)
    {
    lootConfigsField.SetValue(LootCalculator.Instance, new Dictionary<ELootConfig, LootTreeNode>());
    LootCalculator.Instance.Start();
    if (!CreateDefaultConfig())
    return;
    CheckConfig();
    UpdateLoot();
    Puts("Loot config reset.");
    }

    private bool CreateDefaultConfig()
    {
    Config.Clear();

    var lootConfigs = (Dictionary<ELootConfig, LootTreeNode>)lootConfigsField.GetValue(LootCalculator.Instance);

    try
    {
    Config.Settings = new JsonSerializerSettings
    {
    ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
    Converters = new List<JsonConverter>
    {
    new StringEnumConverter(),
    new LootTreeNodeConverter(),
    new ItemGeneratorStaticConverter()
    }
    };
    Config.WriteObject(new ExportData
    {
    Version = GameManager.Instance.GetProtocolVersion(),
    VersionConfig = VersionConfig,
    LootConfigs = lootConfigs
    });
    }
    catch (Exception e)
    {
    Puts("Config save failed: {0}{1}{2}", e.Message, Environment.NewLine, e.StackTrace);
    return false;
    }
    Puts("Created new config");
    return LoadConfig();
    }

    private void CheckConfig()
    {
    if (_config.Version == GameManager.Instance.GetProtocolVersion() && _config.VersionConfig == VersionConfig) return;
    Puts("Incorrect config version({0}/{1})", _config.Version, _config.VersionConfig);
    if (_config.Version > 0) Config.WriteObject(_config, false, $"{Config.Filename}.old");
    CreateDefaultConfig();
    }

    private void UpdateLoot()
    {
    var lootConfigs = new Dictionary<ELootConfig, LootTreeNode>();
    foreach (var nodeData in _config.LootConfigs)
    lootConfigs.Add(nodeData.Key, GetLootTreeNode(nodeData.Value));
    lootConfigsField.SetValue(LootCalculator.Instance, lootConfigs);
    }

    private LootTreeNode GetLootTreeNode(LootTreeNodeData lootTreeNodeData)
    {
    var lootTreeNode = new LootTreeNode
    {
    RollCount = lootTreeNodeData.RollCount,
    RollWithoutReplacement = lootTreeNodeData.RollWithoutReplacement
    };
    if (lootTreeNodeData.LootResult != null)
    {
    var itemGenerator = new ItemGeneratorStatic
    {
    ItemId = lootTreeNodeData.LootResult.ItemId,
    RandomVariance = lootTreeNodeData.LootResult.RandomVariance,
    StackSize = lootTreeNodeData.LootResult.StackSize
    };
    lootTreeNode.LootResult = itemGenerator;
    }
    foreach (var child in lootTreeNodeData.Children)
    lootTreeNode.AddChild(child.Key, GetLootTreeNode(child.Value));
    return lootTreeNode;
    }

    #region Nested type: ConfigData

    public class ConfigData
    {
    public int Version { get; set; }
    public int VersionConfig { get; set; }
    public Dictionary<ELootConfig, LootTreeNodeData> LootConfigs { get; set; } = new Dictionary<ELootConfig, LootTreeNodeData>();
    }

    #endregion

    #region Nested type: ExportData

    public class ExportData
    {
    public int Version { get; set; }
    public int VersionConfig { get; set; }
    public Dictionary<ELootConfig, LootTreeNode> LootConfigs { get; set; } = new Dictionary<ELootConfig, LootTreeNode>();
    }

    #endregion

    #region Nested type: LootTreeNodeConverter

    private class LootTreeNodeConverter : JsonConverter
    {
    private readonly FieldInfo childrenField = typeof(LootTreeNode).GetField("_children", BindingFlags.NonPublic | BindingFlags.Instance);

    public override bool CanRead => false;

    public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
    {
    var node = (LootTreeNode) value;
    writer.WriteStartObject();
    writer.WritePropertyName(nameof(node.RollCount));
    writer.WriteValue(node.RollCount);
    writer.WritePropertyName(nameof(node.RollWithoutReplacement));
    writer.WriteValue(node.RollCount);
    writer.WritePropertyName(nameof(node.LootResult));
    serializer.Serialize(writer, node.LootResult);
    //writer.WriteValue(node.LootResult);
    writer.WritePropertyName("Children");
    serializer.Serialize(writer, childrenField.GetValue(node));
    //writer.WriteValue(childrenField.GetValue(node));
    writer.WriteEndObject();
    }

    public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
    {
    return null;
    }

    public override bool CanConvert(Type objectType)
    {
    return typeof (LootTreeNode).IsAssignableFrom(objectType);
    }
    }

    #endregion

    #region Nested type: LootTreeNodeData

    public class LootTreeNodeData
    {
    public int RollCount { get; set; } = 1;
    public bool RollWithoutReplacement { get; set; } = true;
    public ItemGeneratorData LootResult { get; set; }
    public List<KeyValuePair<double, LootTreeNodeData>> Children { get; set; } = new List<KeyValuePair<double, LootTreeNodeData>>();
    }

    #endregion

    #region Nested type: LootTreeNodeConverter

    private class ItemGeneratorStaticConverter : JsonConverter
    {
    public override bool CanRead => false;

    public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
    {
    var itemGeneratorStatic = (ItemGeneratorStatic)value;
    writer.WriteStartObject();
    writer.WritePropertyName(nameof(itemGeneratorStatic.ItemId));
    writer.WriteValue(itemGeneratorStatic.ItemId.ToString());
    writer.WritePropertyName(nameof(itemGeneratorStatic.StackSize));
    writer.WriteValue(itemGeneratorStatic.StackSize);
    writer.WritePropertyName(nameof(itemGeneratorStatic.RandomVariance));
    writer.WriteValue(itemGeneratorStatic.RandomVariance);
    writer.WriteEndObject();
    }

    public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
    {
    return null;
    }

    public override bool CanConvert(Type objectType)
    {
    return typeof(ItemGeneratorStatic).IsAssignableFrom(objectType);
    }
    }

    #endregion

    #region Nested type: ItemGeneratorData

    public class ItemGeneratorData
    {
    public EItemCode ItemId { get; set; }
    public int StackSize { get; set; } = 1;
    public int RandomVariance { get; set; }
    }

    #endregion
    }
    }
    [DOUBLEPOST=1450667610][/DOUBLEPOST]ItemGeneratorData?
    public int StackSize { get; set; } = 1; <<<< Generator?
    LootTreeNodeData
    public int RollCount { get; set; } = 1; <<<< tree?
    [DOUBLEPOST=1450670109][/DOUBLEPOST]Found out!!!!
    Found out!Found out!Found out!Found out!Found out!