Raised This Month: $ Target: $400
 0% 

OciXCrom's Rank System [XP|Levels|Ranks]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
JusTGo
Veteran Member
Join Date: Mar 2013
Old 02-04-2023 , 13:27   Re: OciXCrom's Rank System [XP|Levels|Ranks]
Reply With Quote #19

Quote:
Originally Posted by DruGzOG View Post
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;

__________________
JusTGo is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode