I'm making a plugin where i need to save coordinates on a per player basis
"id": 76561############,
"currentJump": 0,
"Jumps": [
{
"x": -2100.028,
"y": 46.1595078,
"z": -1464.76868
},
{
"x": -2100.028,
"y": 46.1595078,
"z": -1464.76868
}
]
}this is what the data looks like before i reload the plugin ^^^^
"id": 0,
"currentJump": 0,
"Jumps": [
{
"x": -2100.028,
"y": 46.1595078,
"z": -1464.76868
},
{
"x": -2100.028,
"y": 46.1595078,
"z": -1464.76868
}
]
}for some reason the id is set to 0 on load of the plugin but the array of Vector3 coordinates is not (neither should be set to 0)
heres the code
StoredData storedData;
class StoredData
{
public List<jplayer> playerList = new List<jplayer>();
}
void Loaded()
{
storedData = Interface.Oxide.DataFileSystem.ReadObject<StoredData>("RustJumper");
Interface.Oxide.DataFileSystem.WriteObject("RustJumper", storedData);
}
void SaveData()
{
Interface.Oxide.DataFileSystem.WriteObject("RustJumper", storedData);
}heres the jplayer class
class jplayer
{
public jplayer(ulong id)
{
this.id = id;
this.currentJump = 0;
List<Vector3> jumps = new List<Vector3>();
this.Jumps = jumps;
}
public jplayer (ulong id, List<Vector3> jumps)
{
this.id= id;
this.currentJump = 0;
this.Jumps = jumps;
}
public ulong id { get; }
public int currentJump { get; set; }
public List<Vector3> Jumps { get; set; }
public String toString()
{
return "id: " + id + "\nCurrent Jump: " + currentJump;
}
}why is the id of all jplayers being set to 0 on the Loaded() hook