Problema intalnita (descriere): Pai mysql_log spune tot Ero(area / rile) / warning-(ul / urile):
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[22:39:16] [ERROR] cache_get_field_content_int - invalid datatype
[22:39:29] [ERROR] mysql_format - no value for specifier "%s" available
[22:39:29] [ERROR] CMySQLQuery::Execute[] - (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 'WHERE `ID` = ''' at line 1
Liniile de cod / sursa / script-ul:
forward SavePlayerData(playerid);
public SavePlayerData(playerid)
{
szQuery[0] = EOS, PaccInfo[playerid][LGIN] = 0;
mysql_format(Handle, szQuery, 256, "UPDATE `users` SET `Money` = '%d', `Level` = '%d', `VIP` = '%d', `Kills` = '%d', `Deaths` = '%d', `Hours` = '%d', `Mins` = '%d', `Secs` = '%d' WHERE `Name` = '%e' WHERE `ID` = '%s'", PaccInfo[playerid][Money], PaccInfo[playerid][Level], PaccInfo[playerid][Vip], PaccInfo[playerid][Kills], PaccInfo[playerid][Deaths], PaccInfo[playerid][Hours], PaccInfo[playerid][Mins], PaccInfo[playerid][Secs], PaccInfo[playerid][ID]);//Scriem comanda pentru baza de date
mysql_tquery(Handle, szQuery, "", "", playerid);
return 1;
}
forward LoadPlayerData(playerid);
public LoadPlayerData(playerid)
{
szQuery[0] = EOS;
/*if(!cache_get_row_count(Handle))
{
format(szQuery, 128, "{00FF00}Salut {FF0000}%s{00FF00}nAcest nume este inregistrat.n{FFFF00}Te rugam sa introduci parola.", GetName(playerid));
ShowPlayerDialog(playerid, L_DIALOG, DIALOG_STYLE_PASSWORD, "Logare", szQuery, "Logare", "Exit");
return 1;
}*/
PaccInfo[playerid][ID] = cache_get_field_content_int(0, "ID", Handle);
cache_get_field_content(0, "IP", PaccInfo[playerid][IP], Handle, 20);
cache_get_field_content(0, "Name", PaccInfo[playerid][Name], Handle, 20);
cache_get_field_content(0, "Password", PaccInfo[playerid][Password], Handle, 20);
PaccInfo[playerid][Money] = cache_get_field_content_int(0, "Money", Handle);
PaccInfo[playerid][Level] = cache_get_field_content_int(0, "Level", Handle);
PaccInfo[playerid][Vip] = cache_get_field_content_int(0, "VIP", Handle);
PaccInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills", Handle);
PaccInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths", Handle);
PaccInfo[playerid][Hours] = cache_get_field_content_int(0, "Hours", Handle);
PaccInfo[playerid][Mins] = cache_get_field_content_int(0, "Mins", Handle);
PaccInfo[playerid][Secs] = cache_get_field_content_int(0, "Secs", Handle);
PaccInfo[playerid][LGIN] = 1;
format(szQuery, 128, "Bine ai revenit %s. Ai fost logat cu succes.", GetName(playerid));
SendClientMessage(playerid, LIGHTGREEN, szQuery);
return 1;
}
if(dialogid == R_DIALOG)
{
if(!response) return Kick(playerid);
szQuery[0] = EOS;
if(strlen(inputtext) < 3)
{
format(szQuery, 128, "Salut %s, acest nume nu este inregistrat.nTe rugam sa introduci parola.nParola trebuie sa contina minim 3 caractere.", GetName(playerid));
ShowPlayerDialog(playerid, R_DIALOG, DIALOG_STYLE_PASSWORD, "Inregistrare", szQuery, "Inregistrare", "Exit");
return 1;
}
new PasswordHash[129];
WP_Hash(PasswordHash, 129, inputtext);
PaccInfo[playerid][ID] = cache_insert_id(Handle);
mysql_format(Handle, szQuery, 256, "INSERT INTO `users` (`Name`, `Password`, `IP`, `Money`, `Level`, `VIP`, `Kills`, `Deaths`, `Hours`, `Mins`, `Secs`) VALUES ('%s', '%e', '%e', 0, 0, 0, 0, 0, 0, 0, 0)", GetName(playerid), PasswordHash, GetIP(playerid));
mysql_tquery(Handle, szQuery, "", "");
SendClientMessage(playerid, LIGHTBLUE, "Te-ai inregistrat cu succes, ai fost logat automat.");
PaccInfo[playerid][LGIN] = 1;
return 1;
}
if(dialogid == L_DIALOG)
{
if(!response) return Kick(playerid);
new PasswordHash[129];
WP_Hash(PasswordHash, sizeof(PasswordHash), inputtext);
mysql_format(Handle, szQuery, 256, "SELECT * FROM `users` WHERE `Name` = '%e' AND `Password` = '%e' LIMIT 1;", GetName(playerid), PasswordHash);
mysql_tquery(Handle, szQuery, "LoadPlayerData", "d", playerid);
return 1;
}
Imagini / Video (optional): - Ati incercat sa rezolvati singur?: Da, si mi-am frecat nervii vreo 5 ore.