SA-MP Forums Archive
Login Bug Help Pleas when login Kick - 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 Bug Help Pleas when login Kick (/showthread.php?tid=324521)



Login Bug Help Pleas when login Kick - jentie2006 - 09.03.2012

can any help me when i login he kick me
pawn Код:
//---------------- Login/Register -------------------------------------
        case (DIALOGID+40):
        {
            if(!response)
                return Kick(playerid);
            new pw[255];
            format(PlayerFile, sizeof(PlayerFile), "/accounts/%s.sav", PlayerName[playerid]);
            pw = dini_Get(PlayerFile , "password");
           
            if(!isValidPW(playerid, inputtext, pw))
            {
                return ShowPlayerDialog(playerid, DIALOGID+40, DIALOG_STYLE_INPUT,"Welcome to Exchange-Life","You have entered a wrong password. Try again","Login","Quit");
            }
           
            OnPlayerLogin(playerid);
            TextDrawHideForPlayer(playerid, welcometextdraw[1]);
            TextDrawHideForPlayer(playerid, welcometextdraw[0]);
            return 1;
        }
        case (DIALOGID+41)://Register
        {
            if(!response) return Kick(playerid);
            new pw[255];
            PlayerIsInInfoTutorial[playerid] = 0;
            SpawnPlayer(playerid);
            format(PlayerFile, sizeof(PlayerFile), "/accounts/%s.sav", PlayerName[playerid]);
            SavePlayer(playerid);//creates a possible Accountfile
            dini_Set(PlayerFile, "password",  inputtext);//Sets the password
            dini_IntSet(PlayerFile, "sAllowRandomMessage",1);
            format(pw,sizeof(pw),"%s",inputtext); //Instantly gets the password from original string, no need to get it out of the account since it is always equal to inputtext
            PlayerInfo[playerid][pPassword] = pw;

            IsPlayerLoggedIn[playerid]=1;
            TextDrawHideForPlayer(playerid, welcometextdraw[1]);
            TextDrawHideForPlayer(playerid, welcometextdraw[0]);
            SendClientMessage(playerid, COLOR_GREEN, "__________________________________________________");
            SendClientMessage(playerid, COLOR_WHITE, "You have succesfully created an account.");
            PlayerInfo[playerid][pDoneTutorial]=0;
            InfoInIt(playerid, 0);
            return 1;
        }
i hope any can help


Re: Login Bug Help Pleas when login Kick - ReneG - 10.03.2012

If you are using the 0.3d version you must use SetSpawnInfo before calling SpawnPlayer or else you will get immediately kicked.