16.05.2014, 17:31
I got the following Dialog, But when i log in i immidiatly crash the entire server,
Database is in Varchar and not encrypted, just plain passwords.
Anyone able to help me fix this?
Database is in Varchar and not encrypted, just plain passwords.
Anyone able to help me fix this?
pawn Код:
if(dialogid == DIALOG_LOGIN)
{
if(!response)
{
SendClientMessage(playerid, COLOR_WHITE, "You must login to play and hence have been kicked.");
Kick(playerid);
}
if(response)
{
new query[200], pname[24], escapepass[100];
GetPlayerName(playerid, pname, 24);
mysql_real_escape_string(inputtext, escapepass);
format(query, sizeof(query), "SELECT `user` FROM playerdata WHERE user = '%s' AND password = '%s'", pname, escapepass);
mysql_query(query);
mysql_store_result();
new numrows = mysql_num_rows();
if(numrows == 1) MySQL_Login(playerid);
if(!numrows)
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""Blue"Please log-in", ""White"Welcome back to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to log-in!\n\n"White"Please insert "Red"your"White" password below:", "Login", "Cancel");
GameTextForPlayer(playerid,"~r~Wrong password.",2000,6);
}
mysql_free_result();
}
}
return 1;