Very strange mysql issue
#9

This is a silly mistake you have made and you wasted your time trying to configure it out what the problem is, well don't forget that you still save player status when he gets kicked ever though his status were not loaded, think about that! you forgot to add an exception when a player is getting kicked the player status gets saved even though he is not logged in that's why all his status went back to 0.

pawn Код:
stock SaveStats(playerid)
{
    new Query[256],
        Float:Pos[3];
   
    if(GetPlayerState(playerid) != PLAYER_STATE_SPAWNED && GetPlayerState(playerid) == PLAYER_STATE_WASTED)
        return 0;

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
   
    mysql_format(dbHandle, Query, sizeof(Query), "UPDATE `PlayerData` SET `pMoney` = '%d', `pAdmin` = '%d', `pVip` = '%d', `PosX` = '%f', `PosY` = '%f', `PosZ` = '%f', `pSkin` = '%d' WHERE `Username` = '%s'",
    GetPlayerMoney(playerid),
    PlayerInfo[playerid][pAdmin],
    PlayerInfo[playerid][pVip],
    Pos[0],
    Pos[1],
    Pos[2],
    PlayerInfo[playerid][pSkin],
    pName(playerid));
    mysql_query(dbHandle, Query, false);
    mysql_format(dbHandle, Query, sizeof(Query), "UPDATE `PlayerData` SET `pKills` = '%d', `pDeaths` = '%d', `pScore` = '%d' WHERE `Username` = '%s'",
    PlayerInfo[playerid][pKills],
    PlayerInfo[playerid][pDeaths],
    GetPlayerScore(playerid),
    pName(playerid));
    mysql_query(dbHandle, Query, false);
    printf("query size: %i", strlen(Query));
    return 1;
}
Reply


Messages In This Thread
Very strange mysql issue - by YoungKris - 15.06.2014, 14:08
Re: Very strange mysql issue - by RenovanZ - 15.06.2014, 14:18
Re: Very strange mysql issue - by YoungKris - 15.06.2014, 14:44
Re: Very strange mysql issue - by Theadamedge - 15.06.2014, 14:53
Re: Very strange mysql issue - by YoungKris - 15.06.2014, 19:47
Re: Very strange mysql issue - by Matess - 15.06.2014, 20:20
Re: Very strange mysql issue - by YoungKris - 15.06.2014, 21:12
Re: Very strange mysql issue - by Matess - 15.06.2014, 21:16
Re: Very strange mysql issue - by Patrick - 15.06.2014, 21:18
Re: Very strange mysql issue - by YoungKris - 16.06.2014, 12:53

Forum Jump:


Users browsing this thread: 4 Guest(s)