14.07.2016, 02:50
PHP код:
================ ERROR ==================
[06:38:55] [ERROR] CMySQLQuery::Execute[Account_Registered] - (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
[06:44:36] [ERROR] mysql_format - destination size is too small
[06:44:36] [ERROR] CMySQLQuery::Execute[account_Registered] - (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 ''0' at line 1
[06:45:02] [ERROR] mysql_format - destination size is too small
[06:45:02] [ERROR] CMySQLQuery::Execute[account_Saved] - (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
=======================================
PHP код:
================== CODE =================
================== REGISTER ==============
forward Registeraccount(playerid);
public Registeraccount(playerid)
{
PlayerInfo[playerid][pLogged] = true;
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pMoney] = 5000;
PlayerInfo[playerid][pWrongPass] = 0;
ResetPlayerMoney(playerid);
new Query[300];
mysql_format(Connection, Query, sizeof(Query), "INSERT INTO `account`(`Name`, `Password`, `Email`, `Admin`, `Sex`, `Age`, `Level`, `Money`, `Skin`, `pCar`, `pSaxlid`, `pInterieri`, `pBankfuli`, `pBorbali`,`pSpoileri`,`pBamperi2`,`pPaintjobi`,`pHydrawlic`,`pSatiety`, `pWyurvili`) VALUES ('%e','%e','%e','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
Name(playerid),
PlayerInfo[playerid][pPassword],
PlayerInfo[playerid][pEmail],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pAge],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pCar],
PlayerInfo[playerid][pSaxlid],
PlayerInfo[playerid][pInterieri],
PlayerInfo[playerid][pBankfuli],
PlayerInfo[playerid][pBorbali],
PlayerInfo[playerid][pSpoileri],
PlayerInfo[playerid][pBamperi2],
PlayerInfo[playerid][pPaintjobi],
PlayerInfo[playerid][pHydrawlic],
PlayerInfo[playerid][pSatiety],
PlayerInfo[playerid][pWyurvili]);
mysql_tquery(Connection, Query, "account_Registered", "d", playerid);
SendClientMessage(playerid, -1, "Aqaunti Warmatebit Sheiqmna.");
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1721.8422, -1880.1793, 13.5649, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
HideTextDraw(playerid);
return 1;
}
=========================================================
================ SAVE ACCOUNT ===============================
forward Saveaccount(playerid);
public Saveaccount(playerid)
{
if(PlayerInfo[playerid][pLogged] == false) return 1;
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
ResetPlayerMoney(playerid);
new Query[300];
mysql_format(Connection, Query, sizeof(Query), "UPDATE `account` SET `Name`='%e', `Password`='%e', `Email`='%e', `Admin`='%d', `Sex`='%d', `Age`='%d', `Level`='%d', `Money`='%d', `Skin`='%d',`pCar`='%d', `pSaxlid`='%d', `pInterieri`='%d', `pBankfuli`='%d', `pBorbali`='%d',`pSpoileri`='%d',`pBamperi2`='%d',`pPaintjobi`='%d',`pHydrawlic`='%d', `pSatiety`='%d', `pWyurvili`='%d', WHERE `ID`='%d'",
Name(playerid),
PlayerInfo[playerid][pPassword],
PlayerInfo[playerid][pEmail],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pAge],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pSkin],
PlayerInfo[playerid][pCar],
PlayerInfo[playerid][pSaxlid],
PlayerInfo[playerid][pInterieri],
PlayerInfo[playerid][pBankfuli],
PlayerInfo[playerid][pBorbali],
PlayerInfo[playerid][pSpoileri],
PlayerInfo[playerid][pBamperi2],
PlayerInfo[playerid][pPaintjobi],
PlayerInfo[playerid][pHydrawlic],
PlayerInfo[playerid][pSatiety],
PlayerInfo[playerid][pWyurvili],
PlayerInfo[playerid][pID]);
mysql_tquery(Connection, Query, "account_Saved", "d", playerid);
PlayerInfo[playerid][pLogged] = false;
return 1;
}
=====================================================