13.08.2013, 11:10
What's wrong with this?
pawn Код:
forward CheckPlayer(playerid);
public CheckPlayer(playerid)
{
new string[256], PlayerName[MAX_PLAYER_NAME], EscapedName[MAX_PLAYER_NAME];
mysql_store_result();
GetPlayerName(playerid,PlayerName, sizeof(PlayerName));
mysql_real_escape_string(PlayerName, EscapedName);
format(string, sizeof(string), "SELECT * from accounts WHERE Username='%s' LIMIT 1", EscapedName);
mysql_query(string);
if(mysql_num_rows() != 0) {
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "Notice", "This account is registered, if you are the account owner please login", "Login", "Close");
} else {
ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, "Notice", "This account is not registered, if you wish to register this account please enter a password below", "Register", "Close");
}
mysql_free_result();
return 1;
}