Saving Score.
#9

Quote:
Originally Posted by yvoms
View Post
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
    if(Logged[playerid] == 1)
    {
        new score = GetPlayerScore(playerid);
        new money = GetPlayerMoney(playerid);
        new query[300], pname[24]; new nquery[300];
        GetPlayerName(playerid, pname, 24);
        format(query, sizeof(query), "UPDATE `playerdata` SET score='%d', money='%d' WHERE user='%s'",
    mysql_query(query);
        }
    return 1;
}


Thats what i used, worked without any bugs.
You formatted the query, but you haven't inserted the values. Plus, there's a useless array.

OT :

You're having problems with your MySQL query. There have to be commas while updating each column. What the above user done is fine, except no insertion of values while formatting the query which makes things wrong.
Reply


Messages In This Thread
Saving Score. - by Maro06 - 26.06.2014, 18:23
Re : Saving Score. - by Clad - 26.06.2014, 18:26
Re: Re : Saving Score. - by Maro06 - 26.06.2014, 18:38
Re: Saving Score. - by Maro06 - 27.06.2014, 06:03
Re: Saving Score. - by yvoms - 27.06.2014, 06:43
Re: Saving Score. - by BroZeus - 27.06.2014, 07:15
Re: Saving Score. - by Maro06 - 28.06.2014, 12:23
Re: Saving Score. - by Maro06 - 28.06.2014, 15:42
Re: Saving Score. - by Lordzy - 28.06.2014, 15:48
Re: Saving Score. - by Maro06 - 28.06.2014, 19:35
Re: Saving Score. - by Maro06 - 29.06.2014, 01:56
Re: Saving Score. - by Maro06 - 29.06.2014, 12:01
Re: Saving Score. - by Maro06 - 29.06.2014, 22:30
Re: Saving Score. - by sammp - 29.06.2014, 22:36

Forum Jump:


Users browsing this thread: 1 Guest(s)