25.12.2010, 11:50
I have a problem. This is my script:
And when i exit the game, i realize there is something wrong in it (The login and register stuff already work anyway). Look at this error message in server.log:
I already check if there is something wrong in database, and there isn't! What's wrong??
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;
}
Код:
[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 kill='0',death='0',score='0',interior='0' WHERE username='VirSpector' at line 1.