08.02.2016, 11:22
Ive tried to fix it but i am unable to.
It does not show the login dialog if the player is registered,it always shows the register dialog
It does not show the login dialog if the player is registered,it always shows the register dialog
Код:
new query[250],rows,fields,str1[250]; mysql_format(mysql, query, sizeof(query), "SELECT `Password`, `Account_ID` FROM `players` WHERE `Name` = '%s' LIMIT 1", GetName(playerid)); mysql_tquery(mysql, query); cache_get_data(rows, fields, mysql); if(rows) { cache_get_field_content(0, "Password", PlayerInfo[playerid][pPass], mysql, 30); PlayerInfo[playerid][Accountid] = cache_get_field_content_int(0, "Account_ID"); format(str1, 150, "{FFFFFF}This name is registered,enter a password for this account:\n"); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_GREEN"UGF - Login", str1, "Login", ""); } else { format(str1, 150, "\n{FFFFFF}Welcome To FreeRoam Server\n\n{00FF00}Account Name:{FFFFFF} %s\n\nEnter A Password To Register This Account", GetName(playerid)); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", str1, "Register", ""); PlayerInfo[playerid][New] = 1; }