I actually used part of your tutorial for this, I'm also having an issue where it only says login, while the account doesn't exist. I'll show the onplayerconnect and login dialog code.
OnPlayerConnect
pawn Код:
format(str,sizeof(str),"SELECT * FROM "SQL_ACCOUNT_TABLE" WHERE User = '%s'",pName2(playerid));
mysql_query(str);
mysql_store_result();
if (mysql_num_rows() == 1)
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "[::] Login", "Please enter your password below to login.", "Login", "");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "[::] Register", "Please enter your password below to register.", "Register", "");
}
And the Login Dialog:
pawn Код:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new
HashedPW[145],
str[1024];
mysql_real_escape_string(inputtext, HashedPW);
WP_Hash(HashedPW, sizeof (HashedPW), inputtext);
format(str, sizeof(str), "SELECT * FROM "SQL_ACCOUNT_TABLE" WHERE User = '%s' AND pPass = '%s'", pName2(playerid), HashedPW);
mysql_query(str);
InitiateLogin(playerid);
}
}