mysql_format(MySQLCon, mysqlquery, sizeof(mysqlquery), "UPDATE `accounts` SET `name` = '%e', `accent` = '%e', `password` = '%e'", PlayerInformation[playerid][pName], PlayerInformation[playerid][pAccent], PlayerInformation[playerid][pPassword]);
Is that not what is causing the issue because the statement does not know where to update?
|
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;
}
format(query, sizeof(query), "UPDATE `samp_doors` SET `Door_Info` = '%s', `Door_Pos_X` = '%f', `Door_Pos_Y` = '%f', `Door_Pos_Z` = '%f' WHERE `ID` = '%i'", DoorInfo[DoorID][dInfo], DoorInfo[DoorID][dEnterX], DoorInfo[DoorID][dEnterY], DoorInfo[DoorID][dEnterZ], DoorInfo[DoorID][dID]); mysql_function_query(g_iHandle, query, false, "", ""); format(query, sizeof(query), "UPDATE `samp_doors` SET `Door_Ext_X` = '%f', `Door_Ext_Y` = '%f', `Door_Ext_Z` = '%f', `Door_Ent_Int` = '%i', `Door_Ext_Int` = '%i' WHERE `ID` = '%i'", DoorInfo[DoorID][dExitX], DoorInfo[DoorID][dExitY], DoorInfo[DoorID][dExitZ], DoorInfo[DoorID][dEnterInterior], DoorInfo[DoorID][dExitInterior], DoorInfo[DoorID][dID]); mysql_function_query(g_iHandle, query, false, "", ""); format(query, sizeof(query), "UPDATE `samp_doors` SET `Door_VW` = '%i', `Door_Icon` = '%i' WHERE `ID` = '%i'", DoorInfo[DoorID][dVirtualWorld], DoorInfo[DoorID][dPickupIcon], DoorInfo[DoorID][dID]); mysql_function_query(g_iHandle, query, false, "", "");
O i tend to do it like this, because it looks cleaner and ez'er to edit
Код:
format(query, sizeof(query), "UPDATE `samp_doors` SET `Door_Info` = '%s', `Door_Pos_X` = '%f', `Door_Pos_Y` = '%f', `Door_Pos_Z` = '%f' WHERE `ID` = '%i'", DoorInfo[DoorID][dInfo], DoorInfo[DoorID][dEnterX], DoorInfo[DoorID][dEnterY], DoorInfo[DoorID][dEnterZ], DoorInfo[DoorID][dID]); mysql_function_query(g_iHandle, query, false, "", ""); format(query, sizeof(query), "UPDATE `samp_doors` SET `Door_Ext_X` = '%f', `Door_Ext_Y` = '%f', `Door_Ext_Z` = '%f', `Door_Ent_Int` = '%i', `Door_Ext_Int` = '%i' WHERE `ID` = '%i'", DoorInfo[DoorID][dExitX], DoorInfo[DoorID][dExitY], DoorInfo[DoorID][dExitZ], DoorInfo[DoorID][dEnterInterior], DoorInfo[DoorID][dExitInterior], DoorInfo[DoorID][dID]); mysql_function_query(g_iHandle, query, false, "", ""); format(query, sizeof(query), "UPDATE `samp_doors` SET `Door_VW` = '%i', `Door_Icon` = '%i' WHERE `ID` = '%i'", DoorInfo[DoorID][dVirtualWorld], DoorInfo[DoorID][dPickupIcon], DoorInfo[DoorID][dID]); mysql_function_query(g_iHandle, query, false, "", ""); |
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_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]); |
[13:26:59] INSERT INTO `accounts` (`name`, `password`) VALUES ('Jack Leslie91', '2F9959B230A44678DD2DC29F037BA1159F233AA9AB183CE3A 0678EAAE002E5AA6F27F47144A1A4365116D3DB1B58EC47896 623B92D85CB2F191705DAF11858B8'), `money` = '250', `bank` = '100', `health` = '100.000000', `armour` = '0.000000', `lastx` = '1679.822388', `lasty` = '1480.007568', `lastz` = '10.763532', `lasta` = '255.419006', `interior` = '0', `world` = '0' WHERE `uniqueid` = '6' |
INSERT INTO `accounts` (`name`, `password`) VALUES ('Jack Leslie91', '2F9959B230A44678DD2DC29F037BA1159F233AA9AB183CE3A 0678EAAE002E5AA6F27F47144A1A4365116D3DB1B58EC47896 623B92D85CB2F191705DAF11858B8') |