SA-MP Forums Archive
Login Dialog disappears after server restart - 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 disappears after server restart (/showthread.php?tid=510074)



Login Dialog disappears after server restart - AndySedeyn - 29.04.2014

Hello folks
I'm having a weird bug with my Login Dialog.

When I make a new account everything works, logging off and back in and loading the correct information works good. But when I restart my server the login dialog disappears when I enter an incorrect password or the correct password leaving me with the "spawn" button. When I do click "spawn" I get spawned in Blueberry with the CJ skin.

Let me give you a concrete example of the problem:
I restart the server and go on the server. I enter an incorrect password and the dialog disappears leaving me with only the "Spawn" button available. Let's say for an instance that I click the "spawn" button, I get spawned in Blueberry in CJ skin.

I have to delete my Bible.ini (Player file) and make the account again to make it work properly again.

OnPlayerConnect:
pawn Код:
if(fexist(UserPath(pID)) || gPlayerRegistered[pID] == 1)
    {
        INI_ParseFile(UserPath(pID), "LoadUser_%s", .bExtra = true, .extra = pID);
        ShowPlayerDialog(pID, DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","{FFFFFF}Welcome back to {00FF26}SERVER NAME!{FFFFFF}\n\nThat name is registered. Please enter your password below.","Login","Quit"); //login
    }
    else
    {
        format(string, sizeof(string), "{FFFFFF}Welcome %s to {00FF00}SERVER NAME!{FFFFFF}\n\nThe registration process will be as following:\n\nStep 1: Agreement on server rules.\nStep 2: Password selection.\nStep 3: Age selection.\nStep 4: A roleplay test that consists out of 5 random questions.\n\nGood luck!\n Kind regards, the SERVER's community!", GetName(pID));
        ShowPlayerDialog(pID, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX, "SERVER NAME",string, "Continue", "Quit");
    }
LOGIN_DIALOG:
pawn Код:
if(dialogid == DIALOG_LOGIN) // login
            {
                if(!response) return SetTimerEx("kickbugfix", 1000, false, "i", pID);
                if(response)
                {
                    if(udb_hash(inputtext) == PlayerInfo[pID][pPass])
                    {
                        INI_ParseFile(UserPath(pID), "LoadUser_%s", .bExtra = true, .extra = pID);
                        SetSpawnInfo(pID, 0, PlayerInfo[pID][pSkin], PlayerInfo[pID][pLastX], PlayerInfo[pID][pLastY], PlayerInfo[pID][pLastZ], PlayerInfo[pID][pFacingAngle], 0, 0, 0, 0, 0, 0);
                        SpawnPlayer(pID);
                        GivePlayerCash(pID, PlayerInfo[pID][pCash]);
                        SetPlayerScore(pID, PlayerInfo[pID][pLevel]);
                        SetPlayerHealth(pID, PlayerInfo[pID][pHealth]);
                        SetPlayerArmour(pID, PlayerInfo[pID][pArmour]);
                        SetPlayerInterior(pID, PlayerInfo[pID][pInt]);
                        SetPlayerVirtualWorld(pID, PlayerInfo[pID][pVW]);
                        format(tmp2, sizeof(tmp2), "~g~Welcome ~n~~w~   %s", GetName(pID));
                        GameTextForPlayer(pID, tmp2, 5000, 1);
                        TogglePlayerSpectating(pID, 0);
                        SetPlayerColor(pID, TRANSPARENT_WHITE);
                        gPlayerLogged[pID] = 1;
                        return 1;
                    }
                    else
                    {
                        ShowPlayerDialog(pID, DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","{FFFFFF}Welcome back to {00FF26}SERVER!{FFFFFF}\n\nThat name is registered. Please enter your password below.\n\n{FF0000} You have entered an incorrect password!","Login","Quit"); //login
                        gPlayerLogged[pID] = 0;
                        return 1;
                    }
                }
            }



Re: Login Dialog disappears after server restart - IndependentGaming - 29.04.2014

The Accounts are not connecting to the database


Re: Login Dialog disappears after server restart - Ada32 - 29.04.2014

for the spawn button problem onplayerrequestspawn return 0

as for the dialog, just re-show when they entered an incorrect password


Re: Login Dialog disappears after server restart - AndySedeyn - 29.04.2014

-deleted-


Re: Login Dialog disappears after server restart - AndySedeyn - 29.04.2014

Same problem, when I restart my server it stops working correctly.

I restarted my server after changing the return to 0;
I deleted my .ini file and made a new account, everything worked as I said before
I then restarted my server, logged in with the same account and the dialog disappears after filling in the correct password. Same happens when I enter an incorrect password.

If it is what you say, hwakinsRP, can you give me some more information on what I'm doing wrong here?


Re: Login Dialog disappears after server restart - AndySedeyn - 29.04.2014

Sorry for the triple post but this is an important notice for my problem:

I just noticed that my whole DIALOG won't work. If I click: "Quit" it will not disconnect from the server in fact, it will let the dialog disappear. When I click the arrow: ">" next to "Spawn" it brings the dialog back but none of the buttons work.