Save stats problem
#5

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[128], Float:x, Float:y, Float:z;
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "Score", GetPlayerScore(playerid));
        dini_IntSet(file, "Money", GetPlayerMoney(playerid));
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
        dini_IntSet(file, "WantedLevel",GetPlayerWantedLevel(playerid));
        dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
        dini_IntSet(file, "Cop", PlayerInfo[playerid][pCop]);
        dini_IntSet(file, "Civilian", PlayerInfo[playerid][pCivilian]);
        dini_IntSet(file, "FirstTime", PlayerInfo[playerid][pFirstTime] = 1);
        GetPlayerPos(playerid, x, y, z);
        dini_FloatSet(file, "posX", x);
        dini_FloatSet(file, "posY", y);
        dini_FloatSet(file, "posZ", z);
    }
    gPlayerLogged[playerid] = 0;
    return 1;
}
Here it will save stats if player will be disconnected, as i said it sould work fine because if i reconnect then stats are fine but if i restart server then everything is back to 0 even if i disconnect before restarting server.
Reply


Messages In This Thread
Save stats problem - by tuuker - 04.03.2011, 09:12
Re: Save stats problem - by Mean - 04.03.2011, 09:18
Re: Save stats problem - by tuuker - 04.03.2011, 09:25
Re: Save stats problem - by iggy1 - 04.03.2011, 09:40
Re: Save stats problem - by tuuker - 04.03.2011, 09:48
Re: Save stats problem - by Mean - 04.03.2011, 09:51
Re: Save stats problem - by iggy1 - 04.03.2011, 09:53
Re: Save stats problem - by tuuker - 04.03.2011, 10:07
Re: Save stats problem - by BMUK - 04.03.2011, 11:06
Re: Save stats problem - by [MWR]Blood - 04.03.2011, 11:20

Forum Jump:


Users browsing this thread: 3 Guest(s)