Player Data not saving OnPlayerDisconnect
#1

Hey Guys. I'm not sure what is going on.
For a while, I've been working on a GameMode, got it to work 100%.
The I found that there was a new SAMP (samp03x_svr_R1-2_win32 and sa-mp-0.3x-R1-2-install) and YSI Y_INI (YSI-master). Updated both and now when a player quits the game their data does not save.

I have not changed any code in the script but I recompiled after updating. Was working fine before I updated.

Anyone else have this problem?
Reply
#2

Please guys, this is putting my GameMode on hold, I really need to figure out what is going wrong.

Here is the OnPlayerDisconnect code...
Код:
public OnPlayerDisconnect(playerid, reason)
{
	if(fexist(PPath(playerid)))
	{
		Save_Info(playerid);
		return 1;
	}
	return 0;
}
And the Save_Info Code
Код:
stock Save_Info(playerid)
{
	GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
	GetPlayerFacingAngle(playerid, PlayerInfo[playerid][PosA]);

	new	INI:File = INI_Open(PPath(playerid));
	INI_SetTag(File,"Player_Data");
	INI_WriteFloat(File,"PosX", PlayerInfo[playerid][PosX]);
	INI_WriteFloat(File,"PosY", PlayerInfo[playerid][PosY]);
	INI_WriteFloat(File,"PosZ", PlayerInfo[playerid][PosZ]);
	INI_WriteFloat(File,"PosA", PlayerInfo[playerid][PosA]);
	INI_WriteInt(File,"VirtualWorld", GetPlayerVirtualWorld(playerid));
	INI_WriteInt(File,"Interior", GetPlayerInterior(playerid));
	INI_WriteInt(File,"Skin", GetPlayerSkin(playerid));
	INI_WriteInt(File,"Wallet", PlayerInfo[playerid][Wallet]);
	INI_WriteInt(File,"Bank", PlayerInfo[playerid][Bank]);
	INI_WriteString(File,"CarName", PlayerInfo[playerid][CarName]);
	INI_WriteInt(File,"CarID", PlayerInfo[playerid][CarID]);
	INI_WriteInt(File,"CarVW", PlayerInfo[playerid][CarVW]);
	INI_WriteInt(File,"CarI", PlayerInfo[playerid][CarI]);
	INI_WriteFloat(File,"CarX", PlayerInfo[playerid][CarX]);
	INI_WriteFloat(File,"CarY", PlayerInfo[playerid][CarY]);
	INI_WriteFloat(File,"CarZ", PlayerInfo[playerid][CarZ]);
	INI_WriteFloat(File,"CarA", PlayerInfo[playerid][CarA]);
	INI_WriteInt(File,"CarColor1", PlayerInfo[playerid][CarCol1]);
	INI_WriteInt(File,"CarColor2", PlayerInfo[playerid][CarCol2]);
	INI_Close(File);
}
Please guys this is really bugging me.

Thanx in advance.
Reply
#3

BUMP

I'm using the Whirlpool plugin and the gLibrary Include, could it be related to them? I also noticed that when I roll back to the old YSI the problem is fixed.

Y_ini saves normally during the game, but not when the player disconnects. Can someone please help me?

Thanx in advance.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)