Login Dialog doesn't show!
#1

Im using YIni and this is really annoying me!
Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registering...","Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
It shows the register dialog but if they come back then it doesn't show the login one!
Reply
#2

Try swapping them around. Use 'if !fexist' and then have register under that and then have login under 'else'. It's odd but it has fixed these sorts of problems for me before.
Reply
#3

Didn't work, Still no dialog comes up!
Reply
#4

I think it's something inside my script. how would I find out?
Reply
#5

Wait. If only the register dialog shows up, then that of course means fexist is always returning 0. That means you're using the function incorrectly. Use printf("%d", fexist(UserPath(playerid))) immediately under OnPlayerConnect and then check the server console to see what it returns. Tell me what value it is. Then perhaps use Fopen to detect if it exists; Fopen will return 0 if it doesn't exist/couldn't be opened, and the file handle otherwise.
Reply
#6

Hello,
Make sure that the directory pointed in UserPath exists, or you are using the function correctly.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)