Hey!
I'm trying to save some data of a player on connect, but only save that data once. I'm using the example from the docs: Oxide API for Rust
But this still allows the data to be written again. Is this example incorrect?Code:var info = new PlayerInfo(player); if (storedData.Players.Contains(info)) PrintToChat(player, "Your data has already been added to the file"); else { PrintToChat(player, "Saving your data to the file"); storedData.Players.Add(info); Interface.Oxide.DataFileSystem.WriteObject("MyDataFile", storedData); }
Restrict data saving if it's already been saved?
Discussion in 'Rust Development' started by Bobakanoosh, Feb 26, 2017.