19.01.2015, 01:49
(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 'px = 236.024322,py = -306.421966,pz = 1.578125,pa = 33.499992,h' at line 1
It won't update the player data at all, it stays all 0 except for the username and password.
Code:
It won't update the player data at all, it stays all 0 except for the username and password.
Code:
pawn Код:
stock SaveAccount(playerid)
{
GetPlayerPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
GetPlayerFacingAngle(playerid,PlayerInfo[playerid][pPosA]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
GetPlayerArmour(playerid,PlayerInfo[playerid][pArmor]);
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
new string[2000];
format(query,sizeof(query),"UPDATE `users` SET ");
format(string,sizeof(string),"px = %f,",PlayerInfo[playerid][pPosX]);
strcat(query,string,sizeof(query));
format(string,sizeof(string),"py = %f,",PlayerInfo[playerid][pPosY]);
strcat(query,string,sizeof(query));
format(string,sizeof(string),"pz = %f,",PlayerInfo[playerid][pPosZ]);
strcat(query,string,sizeof(query));
format(string,sizeof(string),"pa = %f,",PlayerInfo[playerid][pPosA]);
strcat(query,string,sizeof(query));
format(string,sizeof(string),"hp = %f,",PlayerInfo[playerid][pHealth]);
strcat(query,string,sizeof(query));
format(string,sizeof(string),"armor = %f,",PlayerInfo[playerid][pArmor]);
strcat(query,string,sizeof(query));
format(string,sizeof(string)," WHERE username = '%e'",GPN(playerid));
strcat(query,string,sizeof(query));
mysql_tquery(sqlid,query);