SA-MP Forums Archive
You can login with any password :/ any ideas? - 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: You can login with any password :/ any ideas? (/showthread.php?tid=298084)



You can login with any password :/ any ideas? - HondaCBR - 19.11.2011

Basically im using gui to set password and load it:

pawn Код:
if(dialogid == REJESTRACJA)
    {
        if(response)
        {
            if(strlen(inputtext)>=5 && strlen(inputtext)<=20)
            {
                SetPlayerCameraPos(playerid, 2158.7505,-1813.7061,16.1406);
                SetPlayerCameraLookAt(playerid, 2146.5017,-1810.6697,16.1406);
                new tmppass[64];
                strmid(tmppass, tmp, 0, strlen(inputtext), 255);
                Encrypt(tmppass);
                OnPlayerRegister(playerid,tmppass);
                OnPlayerLogin(playerid,tmppass);
            }
            else
            {
                SetPlayerCameraPos(playerid, 2158.7505,-1813.7061,16.1406);
                SetPlayerCameraLookAt(playerid, 2146.5017,-1810.6697,16.1406);
                ShowPlayerDialog(playerid, REJESTRACJA, 1, "Rejestracja", "Haslo musi zawierac pomiedzy 5 - 20 znakow, wybierz nowe haslo:", "Zapisz", "Anuluj");
            }
            return 1;
        }
        else
        {
            Kick(playerid);
        }
    }

    if(dialogid == LOGOWANIE)
    {
        if(response)
        {
            new tmppass[64];
            tmp = strtok(inputtext);
            strmid(tmppass, tmp, 0, strlen(inputtext), 255);
            Encrypt(tmppass);
            OnPlayerLogin(playerid,tmppass);
            SetCameraBehindPlayer(playerid);
        }
        else
        {
            Kick(playerid);
        }
    }
But the problem is that whatever password you enter when registering, your password will be blanc, and when you login you can also use any password to login.

Also the age doesnt work properly you can put text insted of numbers and it doesnt limit it 7-90 any ideas?

pawn Код:
new wiek;
        wiek = strval(inputtext);
        if(wiek < 80 || wiek > 7)
        {
            PlayerInfo[playerid][pAge] = wiek;
            RegistrationStep[playerid] = 3;
            HidePlayerDialog(playerid);
                ShowPlayerDialog(playerid, 1501, DIALOG_STYLE_LIST, "Skad Pochodzisz?", "{FF0000} - Polska\n{37DB45} - Stany Zjednoczone\n{15D4ED} - Wielka Brytania", "Wybierz", "");
        }
        else
        {
            HidePlayerDialog(playerid);
            ShowPlayerDialog(playerid, 1500, DIALOG_STYLE_INPUT, "Wiek", "Wpisz poprawny wiek.", "Wybierz", "");
        }



Re: You can login with any password :/ any ideas? - aRoach - 19.11.2011

pawn Код:
if(dialogid == REJESTRACJA)
    {
        if(response)
        {
            if(strlen(inputtext)>=5 && strlen(inputtext)<=20)
            {
                SetPlayerCameraPos(playerid, 2158.7505,-1813.7061,16.1406);
                SetPlayerCameraLookAt(playerid, 2146.5017,-1810.6697,16.1406);
                new tmppass[64];
                tmppass = inputtext;
                Encrypt(tmppass);
                OnPlayerRegister(playerid,tmppass);
                OnPlayerLogin(playerid,tmppass);
            }
            else
            {
                SetPlayerCameraPos(playerid, 2158.7505,-1813.7061,16.1406);
                SetPlayerCameraLookAt(playerid, 2146.5017,-1810.6697,16.1406);
                ShowPlayerDialog(playerid, REJESTRACJA, 1, "Rejestracja", "Haslo musi zawierac pomiedzy 5 - 20 znakow, wybierz nowe haslo:", "Zapisz", "Anuluj");
            }
            return 1;
        }
        else
        {
            Kick(playerid);
        }



Re: You can login with any password :/ any ideas? - HondaCBR - 19.11.2011

error 047: array sizes do not match, or destination array is too small

this line: tmppass = inputtext;

and what about the login bit?


Re: You can login with any password :/ any ideas? - Sasino97 - 19.11.2011

Quote:
Originally Posted by HondaCBR
Посмотреть сообщение
error 047: array sizes do not match, or destination array is too small

this line: tmppass = inputtext;

and what about the login bit?
Replace

pawn Код:
tmppass = inputtext
with

pawn Код:
format(tmppass, sizeof(tmppass), inputtext);
It will work


Re: You can login with any password :/ any ideas? - HondaCBR - 19.11.2011

It works, but how can i use this in the login section so you have to put your password insted of anythign or leaving the field blanc?