SA-MP Forums Archive
Admin Filterscript - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin Filterscript (/showthread.php?tid=266074)



Admin Filterscript - Wesley221 - 03.07.2011

Hey guys,

Im cleaning up my admin script, changing it to DJson etc. But since i changed it, it doesnt show the dialog when i connect anymore. Does anyone know why it doesnt show anymore?

pawn Код:
#define Pfile "AdminSystem/Users/%s.djson"
#define Register ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Register", "Welcome to our server! Please fill in a password to register your account. \nAfter that we got a few questions for you. \n\nPassword:" , "Ok", "");
#define Login ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "Welcome back! Please fill in your password. \n\nPassword: ", "Ok", "");
public OnPlayerConnect(playerid)
{
    new file[128], name[24];
    GetPlayerName(playerid, name, sizeof name); format(file, sizeof file, Pfile, name);
    if(!fexist(file))
    {
        Register
    }
    else
    {
        Login
    }
    return 1;
}
Also i got the folders in my scriptfiles, and the file of my account does NOT exist
If theres anything you guys need to know, please tell me


Re: Admin Filterscript - Mean - 03.07.2011

I got this from wiki:
Quote:
Originally Posted by https://sampwiki.blast.hk/
Max dialogid is 32767. Using negative values will close any open dialog.
Could it be?
Also, try changing that REGISTER define to D_REGISTER or DIALOG_REGISTER (same with login) or something. Maybe there is already a "REGISTER" define somewhere so it blocks it.


Re: Admin Filterscript - HyperZ - 03.07.2011

< Removed >


Re: Admin Filterscript - SpiderWalk - 03.07.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Hey guys,

Im cleaning up my admin script, changing it to DJson etc. But since i changed it, it doesnt show the dialog when i connect anymore. Does anyone know why it doesnt show anymore?

pawn Код:
#define Pfile "AdminSystem/Users/%s.djson"
#define Register ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Register", "Welcome to our server! Please fill in a password to register your account. \nAfter that we got a few questions for you. \n\nPassword:" , "Ok", "");
#define Login ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "Welcome back! Please fill in your password. \n\nPassword: ", "Ok", "");
public OnPlayerConnect(playerid)
{
    new file[128], name[24];
    GetPlayerName(playerid, name, sizeof name); format(file, sizeof file, Pfile, name);
    if(!fexist(file))
    {
        Register
    }
    else
    {
        Login
    }
    return 1;
}
Also i got the folders in my scriptfiles, and the file of my account does NOT exist
If theres anything you guys need to know, please tell me
Try to see tutorial from Lorenz


Re: Admin Filterscript - Wesley221 - 03.07.2011

Quote:
Originally Posted by Mean
Посмотреть сообщение
I got this from wiki:

Could it be?
Also, try changing that REGISTER define to D_REGISTER or DIALOG_REGISTER (same with login) or something. Maybe there is already a "REGISTER" define somewhere so it blocks it.
Nope, there are just a few defines, but none of them overlap
pawn Код:
#define REGISTER 6000 // dialogids
#define LOGIN 6001 // dialogids
Quote:
Originally Posted by SpiderWalk
Посмотреть сообщение
Try to see tutorial from Lorenz
Got a link?


Re: Admin Filterscript - Wesley221 - 04.07.2011

I changed the ShowDialog lines, just to try to make it work. But that didnt work neither.
pawn Код:
/*Old one*/
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "Welcome back! Please fill in your password. \n\nPassword: ", "Ok", "");
/*New one*/
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "Welcome back! Please fill in your password. \n\nPassword: ", "Ok", "Cancel")
Both DONT work. Also, i just pasted the ShowPlayerDialog instead of the "Register/Login", and that didnt work neither. Anyone know what the problem could be?


Re: Admin Filterscript - MadeMan - 04.07.2011

OnPlayerConnect doesn't work well in a filterscript


Re: Admin Filterscript - Mean - 04.07.2011

Maybe thoose \n's (invalid chars, can't be used in input dialogs?) or you need \r\n in Windows...? Or a space after ":", I remember once I put a space after ":" in a textdraw and it didn't show. Try to change it to just "Type your password below:", also could be what MadeMan said, try OnPlayerRequestClass.


Re: Admin Filterscript - Wesley221 - 04.07.2011

Quote:
Originally Posted by Mean
Посмотреть сообщение
Maybe thoose \n's (invalid chars, can't be used in input dialogs?) or you need \r\n in Windows...? Or a space after ":", I remember once I put a space after ":" in a textdraw and it didn't show. Try to change it to just "Type your password below:", also could be what MadeMan said, try OnPlayerRequestClass.
Ive tried to changed the callback to OnPlayerRequestSpawn/Class, and both didnt work. Also, i removed the space after the ':', and still didnt work. Also, in my bank filterscript i have "\n\nPassword:" aswell, and that works. Thats the strange thing :S


Re: Admin Filterscript - Mean - 04.07.2011

Try just "Type your password below:", idk what else could possibly cause the problem.