SA-MP Forums Archive
Stats doesnt save then player disconnects - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stats doesnt save then player disconnects (/showthread.php?tid=247212)



Stats doesnt save then player disconnects - Hernandez - 08.04.2011

Hi i have some little problem. my stats doesnt save then disconnect but then i die it saves.

Here is code
Код:
public OnPlayerDisconnect(playerid, reason)
{
	TextDrawDestroy(SPEEDOS[playerid]);
	TextDrawDestroy(HEALTH[playerid]);
	GameTextForPlayer(playerid, "_", 1000, 4);
	new n[MAX_PLAYER_NAME], file[256];
	GetPlayerName(playerid,n,sizeof(n));
	format(file,sizeof(file),"CionRP/Users/%s.txt",n);
	if(dini_Exists(file))
    {
	PInfo[playerid][Logged] = 0;
	dini_IntSet(file,"Logged",0);
	dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
	dini_IntSet(file, "Money",GetPlayerMoney(playerid));
	return 1;
    }
	return 1;
}
Please answer.


AW: Stats doesnt save then player disconnects - xerox8521 - 08.04.2011

go in your scriptfiles folder
and create a new folder named CionRP
go into the new folder and create a 2nd new one named Users


Re: Stats doesnt save then player disconnects - Hernandez - 08.04.2011

I already have created


AW: Stats doesnt save then player disconnects - xerox8521 - 08.04.2011

did you created the file on register ?


Re: Stats doesnt save then player disconnects - DRIFT_HUNTER - 08.04.2011

I think that you cannot save player stats OnPlayerDisconnect cos when its called player already disconnected


AW: Re: Stats doesnt save then player disconnects - xerox8521 - 08.04.2011

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
I think that you cannot save player stats OnPlayerDisconnect cos when its called player already disconnected
you actually can save it. as i have it too and works fine


Re: Stats doesnt save then player disconnects - Hernandez - 08.04.2011

I fixed it by adding autosave