password_hash=182845945 ip=216.172.142.176 registered=1 RegisteredDate=27/5/2015 Nick=$$M@ster$$ loggedin=0 banned=0 level=0 LastOn=27/5/2015 money=86207 Score=47 kills=2 deaths=0 hours=1 minutes=52 seconds=40 dRank=0 Help Operator=0 Donor=0 x1=165 y1=1971 z1=19 interior1=0 weap1=24 weap1ammo=100 weap2=27 weap2ammo=279 weap3=0 weap3ammo=0 weap4=31 weap4ammo=163 weap5=0 weap5ammo=0 weap6=0 weap6ammo=0 health=100 armour=1 TimesOnServer=2
if (udb_Exists(PlayerName2(playerid))) { if(PlayerInfo[playerid][LoggedIn] == 0) { ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, ""cred"Account Login",""ccolor"This account is registered!"cgreen" Please login To continue","Login","Kick"); } } if (!udb_Exists(PlayerName2(playerid))) { if(PlayerInfo[playerid][Registered] == 0) { new string[200]; format(string, sizeof(string),""cgreen"Welcome To Real World At War 2™ "cred"%s "ccolor"You are not Registered\n"corange"Please Enter a password to register an account", PlayerName2(playerid)); ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick"); } } if(PlayerInfo[playerid][LoggedIn] == 1) { new pname[128]; new file[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), savefolder,pname); if(!dini_Exists(file)) { dini_Create(file); dini_IntSet(file, "Score", 0); dini_IntSet(file, "Money", 0); SetPlayerScore(playerid, dini_Int(file, "Score")); SetPlayerMoney(playerid, dini_Int(file, "Money")); } else { SetPlayerScore(playerid, dini_Int(file, "Score")); SetPlayerMoney(playerid, dini_Int(file, "Money")); } }
Because you use files, it is too inefficient to do it in Pawn. Write a shell script that deletes files that were modified more than X days in the past.
And oh, server lag isn't created by files just sitting there doing nothing. The lag is more than likely caused by this outdated and slow contraption known as dini, which opens and closes the file each time it writes a value. |