Y_INI Saving System
#2

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:
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;
}
Reply


Messages In This Thread
Y_INI Saving System - by AnonScripter - 29.03.2014, 10:10
Re: Y_INI Saving System - by EiresJason - 29.03.2014, 10:23
Re: Y_INI Saving System - by AnonScripter - 29.03.2014, 10:27
Re: Y_INI Saving System - by BroZeus - 29.03.2014, 10:33
Re: Y_INI Saving System - by AnonScripter - 29.03.2014, 10:34
Re: Y_INI Saving System - by EiresJason - 29.03.2014, 10:37
Re: Y_INI Saving System - by AnonScripter - 29.03.2014, 10:45
Re: Y_INI Saving System - by EiresJason - 29.03.2014, 10:47
Re: Y_INI Saving System - by AnonScripter - 29.03.2014, 10:51

Forum Jump:


Users browsing this thread: 1 Guest(s)