Quote:
Originally Posted by DruGzOG
Any idea to prevent this?
|
Yes it should be easy to fix, Just create a variable and set it to true once the player data is loaded, Then when saving data use the variable to see if the player's data got loaded and only save if the variable is set to true
It should look something like this:
PHP Code:
new bool:gLoaded[33]
public saveData(id) {
if(gLoaded[id] != true) return;
// The rest of the code
}
public loadData(id) {
// after data is retrived
gLoaded[id] = true;
}
public client_disconnected(id) {
// Make sure to mark the data as unloaded after player disconnects after saving it for the last time or else the save will not be executed
saveData(id)
gLoaded[id] = false;
}
__________________