Stats sometimes get reset
#1

Well i ran into a bug where sometimes stats reset. Idk it really never happened to my account but it does happen to others.

Sometimes the stats get reset and adminlevel and score get reset to 0 when a person logs in...

I did add a function that is supposed to save the files [onplayerdisconnect]

Code:
stock OnPlayerAccountUpdate(playerid)
{
    new string[128], mysqlud[256];
	format(string,sizeof(string),"/accounts/%s.ini", ReturnName(playerid));
	dini_IntSet(string, "Score", GetPlayerScore(playerid));
	dini_IntSet(string, "Cash", GetPlayerMoney(playerid));
	dini_IntSet(string, "Rank", PlayerInfo[playerid][Rank]);
	dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
	dini_IntSet(string, "Hours", PlayerInfo[playerid][Hours]);
	dini_IntSet(string, "Minutes", PlayerInfo[playerid][Minutes]);
	dini_IntSet(string, "Seconds", PlayerInfo[playerid][Seconds]);
	format(mysqlud,sizeof(mysqlud),"UPDATE `paccounts` SET `score` = '%d' `cash` = '%d' `rank` = '%d' `hours` = '%d' `mins` = '%d' `secs` = '%d' `adminlvl` = '%d' WHERE `name` = '%s'", GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][Rank], PlayerInfo[playerid][Hours], PlayerInfo[playerid][Minutes], PlayerInfo[playerid][Seconds], PlayerInfo[playerid][AdminLevel], ReturnName(playerid));
	mysql_query(mysqlud);
	return 1;
}
funny thing is that the kills / deaths always save.
Reply


Messages In This Thread
Stats sometimes get reset - by Saurik - 02.08.2010, 19:24
Re: Stats sometimes get reset - by iLinx - 02.08.2010, 20:11
Re: Stats sometimes get reset - by Ash. - 02.08.2010, 20:14

Forum Jump:


Users browsing this thread: 1 Guest(s)