Stats problem [Saving]
#1

For some reason stat saving has randomly stopped working, But it was working a few days ago if anyone has enlighten me on this matter it would be fantastic.

pawn Код:
stock SaveStats(playerid)
{
    new Float: P_X, Float: P_Y, Float: P_Z, MySkin;

    if(OnAdminDuty[playerid] == 1)
    {

        MySkin = pData[playerid][Skin];
    } else {
   
        GetPlayerPos(playerid, P_X,P_Y,P_Z);
        MySkin = GetPlayerSkin(playerid);
    }
   
    format(Query,sizeof(Query),"UPDATE `Accounts` Email = '%s', `IP` = '%s', `P_X` = '%f', `P_Y` = '%f', `P_Z` = '%f', `StaffLevel` = '%d',`HelperLevel` = '%d', `DonatorLevel` = '%d', `Admin-Name` =  '%s', `Gender` = '%d', `Skin` = '%d', `Money` = '%d', `Level` = '%d' WHERE `Username` = '%s'",
    pData[playerid][Email],
    GetIP(playerid),
    P_X,
    P_Y,
    P_Z,
    pData[playerid][StaffLevel],
    pData[playerid][HelperLevel],
    pData[playerid][DonatorLevel],
    pData[playerid][aName],
    pData[playerid][Gender],
    MySkin,
    GetPlayerMoney(playerid),
    GetPlayerScore(playerid),
    GetPName(playerid));
   
    printf("Sarting Player Save (%s)",GetPName(playerid));
   
    mysql_query(Query);
    mysql_free_result();
   
    printf("%s Has left the server and his stats saved correctly",GetPName(playerid));
    return 1;
}
Reply
#2

Have you changed this stock abit?
Reply
#3

Nope....
Reply
#4

Did you change or add anything just before it stopped working? Not in the stock but in the script. And are sure that you are connected to the MySQL database?
Reply
#5

Is the variable 'Query' a global variable?

EDIT: NEVERMind:

The problem is in your query.

pawn Код:
// You forgot a 'SET'

format(Query,sizeof(Query),"UPDATE `Accounts` SET Email = '%s', `IP` = '%s', `P_X` = '%f', `P_Y` = '%f', `P_Z` = '%f', `StaffLevel` = '%d',`HelperLevel` = '%d', `DonatorLevel` = '%d', `Admin-Name` =  '%s', `Gender` = '%d', `Skin` = '%d', `Money` = '%d', `Level` = '%d' WHERE `Username` = '%s'",
Reply
#6

Thank you, I was wondering what i had done.


Note: Working, CLOSED.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)