07.09.2013, 10:45
Try this:
pawn Код:
public OnPlayerConnect(playerid)
{
new Query[80],string[128];
format(Query,sizeof(Query),"SELECT * FROM `Users` WHERE `Username` = `%s` LIMIT 1;",GetName(playerid));
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
format(string,sizeof(string),"Hey, %s! \nYour account is registered.\nPlease enter the password to log in!",GetName(playerid));
ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"Login",string,"Login","Quit");
}
else
{
format(string,sizeof(string),"Hey, %s! \nYour account is not registered. \nPlease register to continue!",GetName(playerid));
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register",string,"Register","Quit");
}
mysql_free_result();
return 1;
}