Login Dialog doesn't show! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Login Dialog doesn't show! (
/showthread.php?tid=336176)
Login Dialog doesn't show! -
HazardGaming - 21.04.2012
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!
Re: Login Dialog doesn't show! -
Ainseri - 21.04.2012
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.
Re: Login Dialog doesn't show! -
HazardGaming - 21.04.2012
Didn't work, Still no dialog comes up!
Re: Login Dialog doesn't show! -
HazardGaming - 21.04.2012
I think it's something inside my script. how would I find out?
Re: Login Dialog doesn't show! -
Ainseri - 21.04.2012
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.
Re: Login Dialog doesn't show! -
admantis - 21.04.2012
Hello,
Make sure that the directory pointed in UserPath exists, or you are using the function correctly.