DataFile c#

Discussion in 'Rust Development' started by cibal, Aug 19, 2015.

  1. when I try to store data on a DataFile using:
    Code:
    Interface.GetMod().DataFileSystem.WriteObject("MyDataFile", storedData);
    it says that Interface does not exist in the current context, must I do something to create the file before i use this code?
     
  2. Show us your code..
     
  3. Calytic

    Calytic Community Admin Community Mod

    I don't see a WriteObject call in that code?
     
  4. And i dont see a credit in that code :x + Developer Name
     
  5. I have tried to create it on plugin init:
    Code:
    [Info("SaveData", "developer", "0.0.1")]
      [Description("Save data on a data file into oxide/data")]
      class HitMarker : RustPlugin{
      static Dictionary<ulong, bool> PlayersData;
    void Init(){
        try {
            PlayersData = Interface.GetMod().DataFileSystem.ReadObject<PlayersData>("HitMarkerData");
        } catch { }
        if (PlayersData == null) PlayersData = new Dictionary<ulong, boolean>();
    }
    }