SA-MP Forums Archive
Dialog Register/Login Bug ! D: - 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: Dialog Register/Login Bug ! D: (/showthread.php?tid=436632)



Dialog Register/Login Bug ! D: - Guest123 - 12.05.2013

hello i add new stuff on my server, i think it work bug ... * LuxAdmin

after i connect to the server, it shot Register Dialog, but i already Registerd

register dialog showed,



and after i click on register dialog, nothing showed



pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(AccInfo[playerid][Registered] == 0 && ServerInfo[MustRegister] == 1 && (!IsPlayerNPC(playerid))){
     new rstring[256];
    format(rstring,256,"Welcome %s\n\nEnter You Password To Connect To This Server:\n[0.3x]Freeroam+Advance[0.3x]",pName(playerid));
    ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE_INPUT,"Register Account",rstring,"Register","Quit");
    return 0;
    }
    // Request Login
      new login[256];
    if(ServerInfo[MustLogin] == 1 && AccInfo[playerid][Registered] == 1 && AccInfo[playerid][LoggedIn] == 0 && (!IsPlayerNPC(playerid))){
    format(login,256,"Welcome Back %s\n\nEnter You Password To Connect To This Server:\n[0.3x]Freeroam+Advance[0.3x]",pName(playerid));
    ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE_PASSWORD,"Login Account",login,"Login","Quit");
    return 0;
    }
  return 1;
}
i think i want use
pawn Код:
if (udb_Create(PlayerName2(playerid)))
pawn Код:
if (!udb_Create(PlayerName2(playerid)))
but i didt know hot to make that D:

Sorry for bad english

NO BUG WITH DIALOGID !!


Re: Dialog Register/Login Bug ! D: - BossZk - 12.05.2013

just redownload luxadmin


Re: Dialog Register/Login Bug ! D: - Guest123 - 12.05.2013

dude, i want add new stuff, auto show dialog on connect because my player not know how to login


Re: Dialog Register/Login Bug ! D: - Guest123 - 12.05.2013

anyone ?


Re: Dialog Register/Login Bug ! D: - Kwarde - 12.05.2013

Quote:
Originally Posted by Guest123
Посмотреть сообщение
i think i want use
pawn Код:
if (udb_Create(PlayerName2(playerid)))
pawn Код:
if (!udb_Create(PlayerName2(playerid)))
If these are the checks if an account exists; it checks it now, but will also create this file! You should use fexist(const pattern[]); to check existance, so:
pawn Код:
if (fexist(PlayerName2(playerid)))
This will check if a file exists


Re: Dialog Register/Login Bug ! D: - Guest123 - 12.05.2013

LOL tnx for you information

i add it on OnPlayerConnect

pawn Код:
new name[MAX_PLAYER_NAME]; // the name and the file
    GetPlayerName(playerid, name, MAX_PLAYER_NAME); // getting client's name
    format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)) );

if(!fexist(file)) { // if the file does not exists
        new rstring[256];
        format(rstring,256,"Welcome %s\n\nEnter You Password To Connect To This Server:\n[0.3x]Freeroam+Advance[0.3x]",pName(playerid));
        ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE_INPUT,"Register Account",rstring,"Register","Quit");
    }
    else {
        new LOL[256];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(LOL,256,"Welcome Back %s\n\nEnter You Password To Connect To This Server:\n[0.3x]Freeroam+Advance[0.3x]",pName(playerid));
        ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE_PASSWORD,"Login Account",LOL,"Login","Quit");
    }



Re: Dialog Register/Login Bug ! D: - Kwarde - 12.05.2013

That should work yes
If there's still something not working, just let me (or others) now