25.06.2012, 19:28
Okay, that works but it now interferes with the Login / Register script. Even if the account is registered it says that it is not and makes a new entry. I have put in the code you have said above, this is my Register / Login dialogue.
I cannot find where it conflicts either.
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", pName(playerid), playerid);
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", pName(playerid), playerid);
DialogPassword(playerid, REGISTER, "Account Registration", Msg, "Register", "Leave");
}
mysql_free_result();
}