Problem MySQL Save Player
#3

pawn Код:
SavePlayer(playerid)
{
    if(!PlayerLogged[playerid])
        return 0;

    UserStats[playerid][moneysave] = GetPlayerMoney(playerid);

    new string[512];
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    format(string, sizeof(string), "UPDATE `users` SET `adminlevel` = '%d', `money` = '%d', `kill` = '%d',`death` = '%d',`score` = '%d',`interior` = '%d' WHERE `username` = '%s'", UserStats[playerid][admin], UserStats[playerid][moneysave], UserStats[playerid][kills], UserStats[playerid][deaths], UserStats[playerid][score], UserStats[playerid][interior], UserStats[playerid][name]);
    mysql_query(string);
    format(string, sizeof(string), "UPDATE `users` SET `boss` = '%s', `classid` = '%d', `x` = '%f', `y` = '%f', `z` ='%f', `health` = '%f' WHERE `username`= '%s'", UserStats[playerid][boss], UserStats[playerid][gang], x, y, z, UserStats[playerid][healthsave], UserStats[playerid][name]);
    mysql_query(string);
    return 1;
}
Should work, although make sure it matches the mySQL table, and also why are you using two queries for it?

And use threaded queries.
Reply


Messages In This Thread
Problem MySQL Save Player - by VirSpectorX - 25.12.2010, 11:50
Re: Problem MySQL Save Player - by VirSpectorX - 25.12.2010, 12:13
Re: Problem MySQL Save Player - by playbox12 - 25.12.2010, 12:51
Re: Problem MySQL Save Player - by VirSpectorX - 26.12.2010, 10:24
Re: Problem MySQL Save Player - by exDDDD - 11.02.2011, 18:48

Forum Jump:


Users browsing this thread: 1 Guest(s)