Login/Register Problem.
#2

Umm that's because the code is executed sequentially from top to bottom.

Try something like:
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64];
    format(string,sizeof(string),"Player file name"); // Format it to match a players file like "UserData_Name.ini"
    if(fexist(string))  // This will check if that file exists. If it does we can assume that the player is already registered.
    {
         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Basic RolePlay - {FF9900}Login","\n\n{FF9900}___________________________________\n\n{FFFFFF}Welcome to {FF9900}Basic Roleplay\n\n{FFFFFF}You have {FF9900}Account\n\n{FFFFFF}Forum {FF9900}www.site.com\n\n{FFFFFF}Please type your password to {FF9900}Login\n\n{FFFFFF}Have a nice {FF9900}Day!\n\n{FF9900}___________________________________","Login","Quit");
    }
    else // The file does NOT exist which means they connected for the first time.
    {
          ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{FFFFFF}Basic RolePlay - {FF9900}Register","\n\n{FF9900}___________________________________\n\n{FFFFFF}Welcome to {FF9900}Basic Roleplay\n\n{FFFFFF}You don't have {FF9900}Account\n\n{FFFFFF}Forum {FF9900}www.site.com\n\n{FFFFFF}Please type your password to {FF9900}Register.\n\n{FFFFFF}Have a nice {FF9900}Day!\n\n{FF9900}___________________________________","Register","Quit");
    }
    return 1;
}
Reply


Messages In This Thread
Login/Register Problem. - by Jigsaw123 - 26.09.2014, 14:46
Re: Login/Register Problem. - by dusk - 26.09.2014, 14:50

Forum Jump:


Users browsing this thread: 1 Guest(s)