29.03.2014, 10:23
This isn't a bug with Y_INI, it all depends on how you script it.
The reason this particular issue occurs is because when a player is Kicked, it still calls OnPlayerDisconnect.
If you look on the tutorial, the server will create a file for that user if he disconnects.
So when you click Quit and are kicked, the OnPlayerDisconnect callback is called and therefor the file is created.
A temporary way to fix this is this:
The reason this particular issue occurs is because when a player is Kicked, it still calls OnPlayerDisconnect.
If you look on the tutorial, the server will create a file for that user if he disconnects.
So when you click Quit and are kicked, the OnPlayerDisconnect callback is called and therefor the file is created.
A temporary way to fix this is this:
pawn Код:
new Spawned[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
Spawned[playerid] = 1;
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(Spawned[playerid] != 1) return 1;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_Close(File);
return 1;
}