[Ajuda] DOF2 Salva password como 8
#4

Quote:
Originally Posted by Nill.Oliveira
View Post
Assim vai salvar a senha, mas apenas numeros que for digitado na hora de registrar..
pawn Code:
if(dialogid == DIALOG_REGISTER)
    {
        if(response)
        {
            if(strval(inputtext) < 2)
            {
                new
                    String[128],
                    StringT[129];

                format(String, sizeof(String), "{FFFFFF}Bem-Vindo{F0D50F} %s{FFFFFF}!!", GetName(playerid));
                format(StringT, sizeof(StringT), "__________________________________\n\n{FFFFFF}O user{F0D50F} %s{FFFFFF} nao esta Registado!\n\nA Password tem de ter entre 4 a 35 caracteres..!", GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, String, StringT, "Registar", "Sair");
            }
            else
            {
                new
                    Password[64],
                    StringY[128];

                format(StringY, sizeof(StringY), "{FFFFFF}Registas-te o user {F0D50F}'%s' {FFFFFF}com a password {F0D50F}'%s'{FFFFFF}, foste Logado automaticamente!", GetName(playerid), inputtext);
                SendClientMessage(playerid, 0x80FF00AA, StringY);

                format(Password, sizeof(Password), "%s", inputtext);
                PlayerInfo[playerid][pPassword] = Password;


                DOF2_CreateFile(GetConta(playerid));
                PlayerInfo[playerid][pPassword] = strval(inputtext);
                DOF2_SetString(GetConta(playerid), "User", GetName(playerid));
                DOF2_SetString(GetConta(playerid), "Password", PlayerInfo[playerid][pPassword]);
                PlayerInfo[playerid][pRegisto] = true;

                PlayerInfo[playerid][pMoney] = 10000;
                PlayerInfo[playerid][pScore] = 0;
                PlayerInfo[playerid][pAdmin] = 0;


                SetPlayerScore(playerid, 0);
                GivePlayerMoney(playerid, 10000);

                DOF2_SaveFile();
                //SalvarConta(playerid);
            }
        }
        else
        {
            SendClientMessage(playerid, Red, "Registro Cancelado.");
            Kick(playerid);
        }
    }



    //==============================LOGIN=======================================
    else if(dialogid == DIALOG_LOGIN)
    {
        if(response)
        {
            if(strlen(inputtext) >= 2)
            {
                if(strcmp(DOF2_GetString(GetConta(playerid), "Password", PlayerInfo[playerid][pPassword]), inputtext, true, 10) == 0)
                {
                    new String1[128],
                        String2[129];

                    format(String1, sizeof(String1), "{FFFFFF}Bem-Vindo {F0D50F} %s{FFFFFF}!!", GetName(playerid));
                    format(String2, 179, "__________________________________\n\n{FFFFFF}O user{F0D50F} %s{FFFFFF} esta Logado e Pronto a Jogar!\n\nBom Jogo!!!", GetName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_MSGBOX, String1, String2, "Ok", "");

                    CarregarConta(playerid);
                    //SpawnPlayer(playerid);
                }
                else
                {
                    new String[126],
                        StringT[127];

                    format(String, sizeof(String), "{FFFFFF}Bem-Vindo {F0D50F} %s{FFFFFF}!!", GetName(playerid));
                    format(StringT, 179, "__________________________________\n\n{FFFFFF}O user{F0D50F} %s{FFFFFF} esta Registado!\n\nPassword Errada..!", GetName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, String, StringT, "Login", "Sair");
                }
            }
        }
        else
        {
            SendClientMessage(playerid, Red, "Login Cancelado.");
            Kick(playerid);
        }
    }
Obs: ainda to procurando um jeito de salvar as letras tmb ..
pawn Code:
PlayerInfo[playerid][pPassword] = Password; // error: 047: array sizes do not match, or destination array is too small
Para salvas letras acho que em vez de Strval й Strlen.. Mas nao funciona :/
Reply


Messages In This Thread
DOF2 Salva password errada - by CrusherCpt - 06.11.2012, 20:43
Re: DOF2 Salva password como 8 - by CrusherCpt - 07.11.2012, 17:51
Re: DOF2 Salva password como 8 - by Nill.Oliveira - 07.11.2012, 18:06
Re: DOF2 Salva password como 8 - by CrusherCpt - 07.11.2012, 18:17
Re: DOF2 Salva password como 8 - by Nill.Oliveira - 07.11.2012, 18:19
Re: DOF2 Salva password como 8 - by humildadeforever - 07.11.2012, 18:23
Re: DOF2 Salva password como 8 - by CrusherCpt - 07.11.2012, 18:28

Forum Jump:


Users browsing this thread: 1 Guest(s)