06.03.2017, 07:15
Quote:
Is that not what is causing the issue because the statement does not know where to update?
|
pawn Код:
forward SavePlayerInformation(playerid);
public SavePlayerInformation(playerid)
{
new Float:x, Float:y, Float:z, Float:a, Float:health, Float:armour;
GetPlayerPos(playerid, x, y ,z); GetPlayerFacingAngle(playerid, a);
PlayerInformation[playerid][pLastX] = x; PlayerInformation[playerid][pLastY] = y; PlayerInformation[playerid][pLastZ] = z; PlayerInformation[playerid][pLastA] = a;
GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour);
PlayerInformation[playerid][pHealth] = health; PlayerInformation[playerid][pArmour] = armour;
mysql_format(MySQLCon, mysqlquery, sizeof(mysqlquery), "UPDATE `accounts` SET `name` = '%e', `accent` = '%e', `password` = '%e'", PlayerInformation[playerid][pName], PlayerInformation[playerid][pAccent], PlayerInformation[playerid][pPassword]);
mysql_format(MySQLCon, mysqlquery, sizeof(mysqlquery), "%s, `money` = '%d', `bank` = '%d', `health` = '%f', `armour` = '%f'", mysqlquery, PlayerInformation[playerid][pMoney], PlayerInformation[playerid][pBank], PlayerInformation[playerid][pHealth], PlayerInformation[playerid][pArmour]);
mysql_format(MySQLCon, mysqlquery, sizeof(mysqlquery), "%s, `lastx` = '%f', `lasty` = '%f', `lastz` = '%f', `lasta` = '%f'", mysqlquery, PlayerInformation[playerid][pLastX], PlayerInformation[playerid][pLastY], PlayerInformation[playerid][pLastZ], PlayerInformation[playerid][pLastA]);
mysql_format(MySQLCon, mysqlquery, sizeof(mysqlquery), "%s, `interior` = '%d', `world` = '%d'", mysqlquery, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
mysql_format(MySQLCon, mysqlquery, sizeof(mysqlquery), "%s WHERE `uniqueid` = '%d'", mysqlquery, PlayerInformation[playerid][pUniqueID]);
mysql_query(MySQLCon, mysqlquery);
printf("%s", mysqlquery);
return 1;
}
So for example, if mysqlquery was formatted to "NULL" in a previous code, it will use "NULL" instead of formatting to the first line.