SA-MP Forums Archive
Server doesnt save score and money - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server doesnt save score and money (/showthread.php?tid=434477)



Server doesnt save score and money - Jimmy0wns - 02.05.2013

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.


Re: Server doesnt save score and money - Jimmy0wns - 02.05.2013

21 views no answer.


Re: Server doesnt save score and money - RevolutionaryGaming - 02.05.2013

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


Respuesta: Server doesnt save score and money - JustBored - 03.05.2013

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);
    }
}



Re: Server doesnt save score and money - Jimmy0wns - 03.05.2013

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.