Player stats sometimes not saving.
#1

pawn Code:
stock SavePlayerData(playerid)
{
    if(LoggedIn[playerid] == 1 && playerid != INVALID_PLAYER_ID)
    {
        new Float: x, Float: y, Float: z;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerArmour(playerid, PlayerArmour[playerid]);
        new query[600];
        format(query, sizeof(query), "UPDATE `accounts` SET LastX = %f, LastY = %f, LastZ = %f, LastVW = %d, LastInt = %d WHERE id = %d", x, y, z,GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), PlayerSQLID[playerid]);
        mysql_tquery(dbHandle, query, "", "");
        format(query, sizeof(query), "UPDATE `accounts` SET `TotalTime` = %d, `Money` = %d, ThiefCooldown = %d,HotwireCooldown = %d, `SGrip` = %d, `MGrip` = %d, `LGrip` = %d,`SFrame` = %d, `MFrame` = %d, `LFrame` = %d,`SBarrel` = %d, `MBarrel` = %d, `LBarrel` = %d, `Jail` = %d, `AdminJail` = %d, FishBait = %d, `Armour` = %f, LastLogin = %d, JobCooldown = %d, PizzaCooldown = %d, WepTime = %d, DrugTime = %d, MFrags = %d, LastPayday = %d, SweepCooldown = %d WHERE `id` = %d LIMIT 1"
        , TotalTime[playerid], PlayerMoney[playerid], ThiefCooldown[playerid],HotwireCooldown[playerid],SGrip[playerid], MGrip[playerid], LGrip[playerid],SFrame[playerid],MFrame[playerid],LFrame[playerid], SBarrel[playerid],MBarrel[playerid],LBarrel[playerid], Jail[playerid], AdminJail[playerid],FishBait[playerid],PlayerArmour[playerid],LastLogin[playerid], JobCooldown[playerid], PizzaCooldown[playerid],WepTime[playerid], DrugTime[playerid], MFrags[playerid], LastPayday[playerid],
        SweepCooldown[playerid], PlayerSQLID[playerid]);
        mysql_tquery(dbHandle, query,"", "");
        for(new w = 0; w < 13; w++)
        {
            if(PlayerWeapons[playerid][w] > 0)
            {
                MySQL_SetInteger(PlayerWeapons[playerid][w], "WepAmmo", WepAmmo[PlayerWeapons[playerid][w]], "weapons");
            }
        }
    }
   
    //Simple mysql query.
    return 1;
}
It mostly seems to be total time played that gets lost.

Could anyone assist? I save on disconnect and every 5 minutes.
Reply


Messages In This Thread
Player stats sometimes not saving. - by Dokins - 25.09.2016, 20:27
Re: Player stats sometimes not saving. - by PrO.GameR - 25.09.2016, 20:42
Re: Player stats sometimes not saving. - by Dokins - 25.09.2016, 20:55
Re: Player stats sometimes not saving. - by Shinja - 25.09.2016, 21:15
Re: Player stats sometimes not saving. - by Dokins - 25.09.2016, 21:22
Re: Player stats sometimes not saving. - by SickAttack - 25.09.2016, 21:32
Re: Player stats sometimes not saving. - by amirm3hdi - 25.09.2016, 21:45
Re: Player stats sometimes not saving. - by Dokins - 25.09.2016, 22:40
Re: Player stats sometimes not saving. - by Shinja - 25.09.2016, 23:11
Re: Player stats sometimes not saving. - by SickAttack - 25.09.2016, 23:15

Forum Jump:


Users browsing this thread: 1 Guest(s)