29.05.2015, 08:30
Quote:
The thing is, how can i do that i am still having some slight (little) problems with the MySQL.
How can i transfer the normal registration to the one with the pApprove var etc. |
PHP код:
new query[200];
format(query, sizeof(query), "SELECT * FROM `players` WHERE `username` = '%s' LIMIT 1", GetName(playerid));
mysql_query(query);
mysql_store_result();
new rows = mysql_num_rows();
new pApprove = cache_get_field_content_int(0,"pApprove");
if(rows)
{
if(pApprove == 0)
{
//Player exists, but has not been approved yet.
}else{
//Player exists and HAS been approved.
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""col_lb"Login", ""col_w"This account is registered to our database.\nInsert your password to login to your account.\n"col_r"If this is not your account, logged out and change your nickname.", "Login", "");
}
}
else
{
//Player does not exist.
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""col_lb"Register", ""col_w"This account is not registered to our database.\nEnter your own password to create a new account.", "Register", "");
}
mysql_free_result();