Admin Filterscript
#1

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
Reply
#2

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.
Reply
#3

< Removed >
Reply
#4

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
Reply
#5

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?
Reply
#6

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?
Reply
#7

OnPlayerConnect doesn't work well in a filterscript
Reply
#8

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.
Reply
#9

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 5 Guest(s)