Server doesnt save score and money
#1

As said above, my mysql system doesnt save the score/money.

SavePlayer:
pawn Код:
SavePlayer(playerid)
{
    if(pInfo[playerid][Logged] == 1)
    {
        new Query[500];
        format(Query, 500, "UPDATE `playerdata` SET `admin` = '%d', `score` = '%d', `money` = '%d', `kills` = '%d', `deaths` = '%d' WHERE `id` = '%d' LIMIT 1",
        pInfo[playerid][pAdmin],
        pInfo[playerid][pScore],
        pInfo[playerid][pMoney],
        pInfo[playerid][pKills],
        pInfo[playerid][pDeaths],
        pInfo[playerid][ID]);
        mysql_query(Query);
    }
}
And yes i did at onplayerdisconnect
pawn Код:
SavePlayer(playerid);
My enum:
pawn Код:
enum PlayerInfo
{
    ID, // id of the player
    pDutyOn,
    pDutyOff,
    Nick[24], // name of the player
    pAdmin, // admin level of the player
    pMoney, //money of the player
    pKills, // Kills of the player
    pDeaths, // deaths of the player
    pScore, // score of the player
    IP[16], // Storing the ip of the player
        Logged, // Players logged in or not variable
        IsRegistered //checks if the player is registered or not.
};
Please someone help me, because its important for my server.
Reply
#2

21 views no answer.
Reply
#3

You don't place a grave accent around each field. So remove them from things like money.
Reply
#4

pawn Код:
SavePlayer(playerid)
{
    if(pInfo[playerid][Logged] == 1)
    {
        new Query[500];
        format(Query, 500, "UPDATE ґplayerdataґ SET ґadminґ = '%d', ґscoreґ = '%d', ґmoneyґ = '%d', ґkillsґ = '%d', ґdeathsґ = '%d' WHERE ґidґ = '%d' LIMIT 1",
        pInfo[playerid][pAdmin],
        pInfo[playerid][pScore],
        pInfo[playerid][pMoney],
        pInfo[playerid][pKills],
        pInfo[playerid][pDeaths],
        pInfo[playerid][ID]);
        mysql_query(Query);
    }
}
Reply
#5

Quote:
Originally Posted by RevolutionaryGaming
Посмотреть сообщение
You don't place a grave accent around each field. So remove them from things like money.
What do you mean, lol?

@Justbored i think that just fixed it.

EDIT:
Код:
[14:05:27] [MySQL] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ґplayerdataґ SET ґadminґ = '5', ґscoreґ = '350', ґmoneyґ = '9999999', ґ' at line 1.
[14:05:27] [part] Zumorio has left the server (0:1)
It gives me this error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)