Stats doesnt save then player disconnects
#1

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.
Reply
#2

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
Reply
#3

I already have created
Reply
#4

did you created the file on register ?
Reply
#5

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

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
Reply
#7

I fixed it by adding autosave
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)