18.07.2012, 10:59
I actually managed to fix this problem but due to a backup issue I had to revert to a VERY old version of my script and basically, when the user connects the script determine if the account exists, for some reason it says that unregistered accounts exist.
Here is the code:
The rest of the register / login script works fine, so the problem is here. Any ideas?
Here is the code:
pawn Код:
stock InitConnection(playerid)
{
new Query[90], EscName[MAX_PLAYER_NAME];
mysql_real_escape_string(pName(playerid), EscName);
format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `username` = '%s')", EscName);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
format(Msg, sizeof(Msg), "Please enter your password below to log onto your account\n");
DialogPassword(playerid, LOGIN, "Account Login", Msg, "Login", "Leave");
}
else
{
format(Msg, sizeof(Msg), "This account is not registered, please enter a password below to continue\n");
DialogPassword(playerid, REGISTER, "Account Registration", Msg, "Register", "Leave");
}
mysql_free_result();
}