26.12.2016, 09:21
All the codes is fine and is good and it was working when i added cookie system i removed all players data then
I go game to register and when i relog it say register and when i took a look on php my admin when i register it doesn't save the account in the Database
Codes :
Mysql Log:
I go game to register and when i relog it say register and when i took a look on php my admin when i register it doesn't save the account in the Database
Codes :
Код:
public OnAccountRegister(playerid) { pData[playerid][ID] = cache_insert_id(); //loads the ID of the player in the variable once they registered. printf("New account registered. ID: %d", pData[playerid][ID]); //just for debugging. pData[playerid][Money] = 50000; GivePlayerMoney(playerid, 50000); return 1; } public OnAccountLoad(playerid) { new score,string[143]; pData[playerid][Admin] = cache_get_field_content_int(0, "Admin"); //we're getting a field 4 from row 0. And since it's an integer, we use cache_get_row_int pData[playerid][VIP] = cache_get_field_content_int(0, "VIP"); //Above pData[playerid][Money] = cache_get_field_content_int(0, "Money");//Above pData[playerid][Kills] = cache_get_field_content_int(0,"Kills"); pData[playerid][Cookies] = cache_get_field_content_int(0,"Cookies"); pData[playerid][Cakes] = cache_get_field_content_int(0,"Cakes"); pData[playerid][Icecream] = cache_get_field_content_int(0,"Icecream"); pData[playerid][Deaths] = cache_get_field_content_int(0, "Deaths"); score = cache_get_field_content_int(0, "Score"); pData[playerid][Money] = cache_get_field_content_int(0, "Money"); SetPlayerScore(playerid, score); GivePlayerMoney(playerid, pData[playerid][Money]);//Let's set their money //For player's position, set it once they spawn(OnPlayerSpawn) format(string,sizeof(string),"* Login Successful... Welcome Back to XtremeX %s",GetName(playerid)); //tell them that they have successfully logged in return 1; } public AutoLogin(playerid) { new score,String[134]; pData[playerid][Admin] = cache_get_field_content_int(0, "Admin"); //we're getting a field 4 from row 0. And since it's an integer, we use cache_get_row_int pData[playerid][VIP] = cache_get_field_content_int(0, "VIP"); //Above pData[playerid][Money] = cache_get_field_content_int(0, "Money");//Above pData[playerid][Kills] = cache_get_field_content_int(0,"Kills"); pData[playerid][Cookies] = cache_get_field_content_int(0,"Cookies"); pData[playerid][Cakes] = cache_get_field_content_int(0,"Cakes"); pData[playerid][Icecream] = cache_get_field_content_int(0,"Icecream"); pData[playerid][Deaths] = cache_get_field_content_int(0, "Deaths"); score = cache_get_field_content_int(0, "Score"); pData[playerid][Money] = cache_get_field_content_int(0, "Money"); SetPlayerScore(playerid, score); GivePlayerMoney(playerid, pData[playerid][Money]);//Let's set their money //For player's position, set it once they spawn(OnPlayerSpawn) format(String,sizeof(String),"* Auto-IP Login Successful... Welcome back to XtremeX %s!",GetName(playerid)); SendClientMessage(playerid, 0x00FF0054, String); //tell them that they have successfully logged in return 1; }
Код:
execution [12:09:02] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.424 milliseconds [12:09:02] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [12:09:02] [DEBUG] Calling callback "OnAccountCheck".. [12:09:02] [DEBUG] cache_get_data - connection: 1 [12:09:02] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [12:09:11] [DEBUG] mysql_format - connection: 1, len: 300, format: "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `VIP`,`Kills`,`Cookies`,`Cakes`,`Icecream`,`Deaths`,`Score`, `Mone..." [12:09:11] [ERROR] mysql_format - destination size is too small [12:09:11] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `V", callback: "OnAccountRegister", format: "i" [12:09:11] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution [12:09:11] [ERROR] CMySQLQuery::Execute[OnAccountRegister] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 [12:09:11] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - error will be triggered in OnQueryError