1. I would use this same function in js

    Code:
    Interface.GetMod().DataFileSystem.GetDatafile("Hunt_Data");
    Can someone help me ?
     
  2. Wulf

    Wulf Community Admin

    See the API docs: Rust.
     
  3. Code:
    data.GetData("exemple");
    ok, to convert the json , I'm not finding it
     
  4. Wulf

    Wulf Community Admin

    The datafile is already JSON, why does it need to be converted?
     
  5. I can not read the array that is inside this file "exemple"
     
  6. Wulf

    Wulf Community Admin

  7. my code
    Code:
    var ListInfo = {
        Title : "ListInfo",
        Author : "WilyWork",
        Version : V(0, 0, 1),
        Description : "list info all players",    Init: function() {
            var playerList = data.GetData("playerList");
            if(playerList){
                playerList.forEach(function(player){
                    print(player.name);
                    print(player.city);
                });
            }else{
                print("playerList undefined!");
            }
        }
    }
    playerList.json
    Code:
    {
      "76561197960383027": {
        "city": "Salvador",
        "name": "VimDM4"
      },
      "76561197960409264": {
        "city": "Salvador",
        "name": "Rafaliw"
      },
      "76561197960423352": {
        "city": "Salvador",
        "name": "Plaksnor"
      }
    }
     
  8. :D:D:D:D
     
    Last edited by a moderator: Jan 25, 2016
  9. Wulf

    Wulf Community Admin

    JavaScript, not C#. ;)
     
  10. My bad :(