Dini OnPlayerDisconnect save stats help
#2

You need to instruct dini to write new values into the files when the player disconnects, for example:

pawn Код:
public OnPlayerDisconnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name)); // I recommend only doing this OnPlayerConnect and storing it in a multi-dimensional array for later referencing, but that is up to you
    format(file,sizeof(file),"/RicAdmin/users/%s.ini",name);
    if(IsLogged[playerid] == 1)
    {
        dini_IntSet(file,"AdminLevel", PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file,"Cash", GetPlayerMoney(playerid));
        dini_IntSet(file,"Score", GetPlayerScore(playerid));
    }
    IsLogged[playerid] = 0;
    return 1;
}
You have to remember that computers are very stupid, they cannot figure out what you want them to do on their own, you have to be very specific when programming, every instruction is given by you. So if you don't tell dini to set the values when the player disconnects, the values won't be set. I hope that helps.
Reply


Messages In This Thread
Dini OnPlayerDisconnect save stats help - by ricardo178 - 19.03.2011, 12:33
Re: Dini OnPlayerDisconnect save stats help - by JaTochNietDan - 19.03.2011, 12:57

Forum Jump:


Users browsing this thread: 1 Guest(s)