Register dialog problem +rep
#1

I have this cod in OnPlayerConnect. Login dialog works fine when I enter with a registered username but register dialog doesnt appears if I get a new username. It directly show skin selector. How to fix that?

Код:
	if(mysql_num_rows() > 0) //If the user is found
    {
	PlayerInfo[playerid][pRegistered] = 1;
	PlayerInfo[playerid][pLogged] = 0;
	
	if (PlayerInfo[playerid][pRegistered] == 0 && PlayerInfo[playerid][pLogged] == 0)
	{
	format(string, sizeof(string), "Cops And Robbers\n \nNew Registration - Name: %s\n \nDo Not Register Multiple Accounts\nDo Not Use The Same Password That You Use Elsewhere\nMinimum 6 Chars Maximum 12 Chars\n \nPlease Enter A Password For Your Account:",PlayerInfo[playerid][pName],playerid);
	ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT , "CnR Registration",string, "Register", "Cancel");
	} // thats the problem
	
	if (PlayerInfo[playerid][pRegistered] == 1 && PlayerInfo[playerid][pLogged] == 0)
	{
	format(string, sizeof(string), "CnR\n \nThis name, %s, is Rgistered.\nIf this is not your account, please quit and change your name.\n \nPlease Enter Your Password To Login:",PlayerInfo[playerid][pName],playerid);
	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT , "Login", string, "Login", "Cancel");
	} //this one works fine
Reply
#2

pawn Код:
if(mysql_num_rows() > 0) //If the user is found
    {
        PlayerInfo[playerid][pRegistered] = 1;
        PlayerInfo[playerid][pLogged] = 0;
    }

    if (PlayerInfo[playerid][pRegistered] == 0 && PlayerInfo[playerid][pLogged] == 0)
    {
        format(string, sizeof(string), "Cops And Robbers\n \nNew Registration - Name: %s\n \nDo Not Register Multiple Accounts\nDo Not Use The Same Password That You Use Elsewhere\nMinimum 6 Chars Maximum 12 Chars\n \nPlease Enter A Password For Your Account:",PlayerInfo[playerid][pName],playerid);
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT , "CnR Registration",string, "Register", "Cancel");
    }

    if (PlayerInfo[playerid][pRegistered] == 1 && PlayerInfo[playerid][pLogged] == 0)
    {
        format(string, sizeof(string), "CnR\n \nThis name, %s, is Rgistered.\nIf this is not your account, please quit and change your name.\n \nPlease Enter Your Password To Login:",PlayerInfo[playerid][pName],playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT , "Login", string, "Login", "Cancel");
    }
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
pawn Код:
if(mysql_num_rows() > 0) //If the user is found
    {
        PlayerInfo[playerid][pRegistered] = 1;
        PlayerInfo[playerid][pLogged] = 0;
    }

    if (PlayerInfo[playerid][pRegistered] == 0 && PlayerInfo[playerid][pLogged] == 0)
    {
        format(string, sizeof(string), "Cops And Robbers\n \nNew Registration - Name: %s\n \nDo Not Register Multiple Accounts\nDo Not Use The Same Password That You Use Elsewhere\nMinimum 6 Chars Maximum 12 Chars\n \nPlease Enter A Password For Your Account:",PlayerInfo[playerid][pName],playerid);
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT , "CnR Registration",string, "Register", "Cancel");
    }

    if (PlayerInfo[playerid][pRegistered] == 1 && PlayerInfo[playerid][pLogged] == 0)
    {
        format(string, sizeof(string), "CnR\n \nThis name, %s, is Rgistered.\nIf this is not your account, please quit and change your name.\n \nPlease Enter Your Password To Login:",PlayerInfo[playerid][pName],playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT , "Login", string, "Login", "Cancel");
    }
Nothing changed its same
Reply
#4

pawn Код:
// reseting variables
PlayerInfo[playerid][pRegistered] = 0;
PlayerInfo[playerid][pLogged] = 0;
if(mysql_num_rows() > 0) //If the user is found
{
    PlayerInfo[playerid][pRegistered] = 1;
    format(string, sizeof(string), "CnR\n \nThis name, %s, is Rgistered.\nIf this is not your account, please quit and change your name.\n \nPlease Enter Your Password To Login:",PlayerInfo[playerid][pName],playerid);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT , "Login", string, "Login", "Cancel");
    //this one works fine
}
else // account doesn't exist so we call register dialog
{
    format(string, sizeof(string), "Cops And Robbers\n \nNew Registration - Name: %s\n \nDo Not Register Multiple Accounts\nDo Not Use The Same Password That You Use Elsewhere\nMinimum 6 Chars Maximum 12 Chars\n \nPlease Enter A Password For Your Account:",PlayerInfo[playerid][pName],playerid);
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT , "CnR Registration",string, "Register", "Cancel");
    // thats the problem
Reply
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
// reseting variables
PlayerInfo[playerid][pRegistered] = 0;
PlayerInfo[playerid][pLogged] = 0;
if(mysql_num_rows() > 0) //If the user is found
{
    PlayerInfo[playerid][pRegistered] = 1;
    format(string, sizeof(string), "CnR\n \nThis name, %s, is Rgistered.\nIf this is not your account, please quit and change your name.\n \nPlease Enter Your Password To Login:",PlayerInfo[playerid][pName],playerid);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT , "Login", string, "Login", "Cancel");
    //this one works fine
}
else // account doesn't exist so we call register dialog
{
    format(string, sizeof(string), "Cops And Robbers\n \nNew Registration - Name: %s\n \nDo Not Register Multiple Accounts\nDo Not Use The Same Password That You Use Elsewhere\nMinimum 6 Chars Maximum 12 Chars\n \nPlease Enter A Password For Your Account:",PlayerInfo[playerid][pName],playerid);
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT , "CnR Registration",string, "Register", "Cancel");
    // thats the problem
It works thank you +rep And how can i fix it like that; user would make his registration and then need to login to continue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)