21.04.2010, 16:21
I'm trying to make this script works for a few days by myself. I dont have many knowledge over arrays so i cant figure out how to do it.
Please help meeeahh!
I think the problem is in the red part. Im using the a_mysql.inc plugin, that one that almost everyone has.
In the password entered answer, it comes the right one. And in the MySql log:
Please help meeeahh!
Quote:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == login) { new query[256]; format(query,sizeof(query),"SELECT `senha` FROM `usuario` WHERE `login` = '%s'",PlayerName(playerid)); mysql_query(query); mysql_store_result(); PlayerStatistics[playerid][PASSWORD] = mysql_fetch_int(); if(strcmp( inputtext, PlayerStatistics[ playerid ][ PASSWORD ], true ) == 0 ) { Logged[playerid]==1; printf("[Login]: O usuario `%s` fez login com sucesso!",PlayerName(playerid)); SendClientMessage(playerid, COR_INFO, "You've been succesfully authed."); new welcome[256]; format(welcome,sizeof(welcome),"Welcome back '%s' ",PlayerName(playerid)); SendClientMessage(playerid, COR_INFO, welcome); } else { new welcome[256]; format(welcome,sizeof(welcome),"Bad, bad password. Password entered: '%s' ",inputtext); SendClientMessage(playerid, COR_BRANCO, welcome); SendClientMessage( playerid, COR_BRANCO, "Bad, bad password. To avoid lammers you will be automatically disconnected." ); SetTimer("kicklogin", 10000, false); } return 0; } return 0; } |
In the password entered answer, it comes the right one. And in the MySql log:
Quote:
[13:16:25] --------------------------- [13:16:25] MySQL Debugging activated (04/21/10) [13:16:25] --------------------------- [13:16:25] [13:16:56] >> mysql_query( Connection handle: 1 ) [13:16:56] CMySQLHandler::Query(SELECT `login` FROM `usuario` WHERE `login` = 'Lucca_Xavier') - Successfully executed. [13:16:56] >> mysql_store_result( Connection handle: 1 ) [13:16:56] CMySQLHandler::StoreResult() - Result was stored. [13:16:56] >> mysql_num_rows( Connection handle: 1 ) [13:16:56] CMySQLHandler::NumRows() - Returned 1 rows(s) [13:16:59] >> mysql_query( Connection handle: 1 ) [13:16:59] CMySQLHandler::Query(SELECT `senha` FROM `usuario` WHERE `login` = 'Lucca_Xavier') - Successfully executed. [13:16:59] >> mysql_store_result( Connection handle: 1 ) [13:16:59] CMySQLHandler::StoreResult() - Result was stored. [13:16:59] >> mysql_fetch_int( Connection handle: 1 ) [13:16:59] CMySQLHandler::FetchRow() - Return: MYPASSWORD! |