19.09.2015, 10:15
I passed gm on r39-3 and now when I enter the server on my new account I bag password press register and I say this name is already used .... Although the database it's empty ...
and
Код:
[13:50:06] [DEBUG] mysql_tquery - connection: 1, query: "", callback: "(null)", format: "(null)" [13:50:06] [DEBUG] mysql_tquery - connection: 1, query: "", callback: "(null)", format: "(null)" [13:50:06] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `players` WHERE `username`='%e';" [13:50:06] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `players` WHERE `username`='Jimmi';", callback: "OnLoadPlayer", format: "i" [13:50:06] [DEBUG] CMySQLQuery::Execute[] - starting query execution [13:50:06] [ERROR] CMySQLQuery::Execute[] - (error #1065) Query was empty [13:50:06] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError [13:50:06] [DEBUG] CMySQLQuery::Execute[] - starting query execution [13:50:06] [ERROR] CMySQLQuery::Execute[] - (error #1065) Query was empty [13:50:06] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError [13:50:06] [DEBUG] CMySQLQuery::Execute[OnLoadPlayer] - starting query execution [13:50:06] [DEBUG] CMySQLQuery::Execute[OnLoadPlayer] - query was successfully executed within 35.160 milliseconds [13:50:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [13:50:06] [DEBUG] Calling callback "OnLoadPlayer".. [13:50:06] [DEBUG] cache_get_row_count - connection: 1 [13:50:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [13:50:14] [DEBUG] mysql_format - connection: 1, len: 256, format: " SELECT `id` from `players` WHERE `username` = '%e' LIMIT 1;" [13:50:14] [DEBUG] mysql_query - connection: 1, query: " SELECT `id` from `players` WHERE `username` = 'Jimmi' LIMIT 1;", use_cache: true [13:50:14] [DEBUG] CMySQLQuery::Execute - starting query execution [13:50:14] [DEBUG] CMySQLQuery::Execute - query was successfully executed within 11.751 milliseconds [13:50:14] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [13:50:14] [DEBUG] CMySQLHandle::SaveActiveResult - cache saved (id: 51) [13:50:14] [DEBUG] cache_get_row_count - connection: 1 [13:50:14] [DEBUG] cache_delete - cache_id: 51, connection: 1 [13:50:14] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [13:50:14] [DEBUG] CMySQLHandle::DeleteSavedResult - result deleted
Код:
forward MySQLCheckAccount(sqlplayersname[]); public MySQLCheckAccount(sqlplayersname[]) { new query[ 256 ]; mysql_format( handle, query, sizeof( query ), " SELECT `id` from `players` WHERE `username` = '%e' LIMIT 1;", sqlplayersname ); new Cache:r = mysql_query( handle, query ); if( !cache_num_rows() ) return 0,cache_delete( r ); else { return cache_get_field_content_int( 0, "id" ),cache_delete( r ); } }
Код HTML:
if(dialogid == 12345) { if(IsPlayerConnected(playerid)) { if(!response) { SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Info: {FFFFFF}Ai fost dat afara pentru ca nu ai acceptat inregistrarea."); Kick(playerid); return 1; } if(strlen(inputtext) >= 4 && strlen(inputtext) <= 70) { GetPlayerName(playerid, sendername, sizeof(sendername)); new sqlaccountexists = MySQLCheckAccount(sendername); if (sqlaccountexists != 0) { SendClientMessage(playerid, COLOR_WHITE, " "); SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Info: {FFFFFF}Acel nume este deja folosit, alege altul."); return 1; } new tmppass[64]; mysql_real_escape_string(inputtext, tmppass); if(strlen(tmppass) < 4) { new loginname[64]; GetPlayerName(playerid,loginname,sizeof(loginname)); ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"{FFFFFF}Logare","{FFFFFF}Scrie {0066FF}parola contului tau {FFFFFF}mai jos:","Logare","Iesi"); gPlayerLogTries[playerid] += 1; if(gPlayerLogTries[playerid] == 5) { Kick(playerid); } } OnPlayerRegister(playerid,tmppass); } else { new regname[64]; GetPlayerName(playerid,regname,sizeof(regname)); ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"{FFFFFF}Inregistrare","{FFFFFF}Scrie {0066FF}parola contului tau {FFFFFF}mai jos:","Inregistrare","Iesi"); } } }