30.05.2015, 22:16
So I had this working, I played around and tried adding Health and Armour, didn't work out and tried to reverse everything but now the code isn't working to save. Was wondering if anyone here can point out what this error could be from?
Error Code:
Code:
OnPlayerDisconnect:
I would assume it would be in the playerdisconnect as everything will load when joining, but nothing saves when leaving. If it isn't this, I'll post the other areas with MySQL.
Error Code:
Код:
[08:13:55] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `accounts` SET `Money` = '%d' , `PosX` = '%f' , `PosY` = '%f' , `PosZ` = '%f' , `PosA` = '%f' WHERE `ID` = '%d'" [08:13:55] [ERROR] mysql_format - destination size is too small [08:13:55] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET `Money` = '0' , `PosX` = '1706.716' , `Pos", callback: "(null)", format: "(null)" [08:13:55] [DEBUG] CMySQLQuery::Execute[] - starting query execution [08:13:56] [ERROR] CMySQLQuery::Execute[] - (error #1064) 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 '' at line 1 [08:13:56] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
OnPlayerDisconnect:
Код:
public OnPlayerDisconnect(playerid, reason) { new query[128], Float:pos[4]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]); mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `Money` = '%d' , `PosX` = '%f' , `PosY` = '%f' , `PosZ` = '%f' , `PosA` = '%f' WHERE `ID` = '%d'", GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]); mysql_tquery(mysql, query, "", ""); return true; }