You can login with any password :/ any ideas?
#1

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", "");
        }
Reply
#2

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);
        }
Reply
#3

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

this line: tmppass = inputtext;

and what about the login bit?
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)