[Ajuda] Dificuldade com verificaзгo de senha (Sistema de Registro)
#2

Analisando rбpido seu code.. se funcionar eu explico o motivo

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_REGISTRO)
    {

        new STR[128];
        GetPlayerName( playerid, Nome, sizeof( Nome ) );
        GetPlayerIp( playerid, PlayerIP, sizeof( PlayerIP ) );
        format( Arquivo, sizeof( Arquivo ), "Contas/%s.ini", Nome );

        if(response)
        {

            if( strlen ( inputtext ) < 4 || strlen ( inputtext ) > 16 && !strlen( inputtext ) )
            {


                SendClientMessage( playerid, COR_AVISO, "| AVISO | Atenзгo sua Senha tem que ter no Minimo 4 Caracteres e no Mбximo 16 Caracteres.");
                format( STR, sizeof( STR ), "Bem Vindo(a) ao Servidor  %s\n\nVocк nгo tem uma Conta Cadastrada\n\nDigite uma Senha para se Cadastrar\n\nStatus:Nгo Cadastrado\n\nSeu IP:%s", Nome, PlayerIP );
                ShowPlayerDialog( playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, " ~ Registrando ~", STR, "Registrar", "Cancelar");
                return 1;

                }else{
                DOF2_CreateFile( Arquivo );
                DOF2_SetString( Arquivo, "Senha", inputtext );
                DOF2_SetInt( Arquivo, "Administrador", 0 );
                DOF2_SetInt( Arquivo, "Level", 0 );
                DOF2_SetInt( Arquivo, "Dinheiro", 250 );
                DOF2_SetInt( Arquivo, "Skin", 0 );
                DOF2_SetInt( Arquivo, "Matou", 0 );
                DOF2_SetInt( Arquivo, "Morreu", 0 );
                DOF2_SaveFile();

                format( STR, sizeof( STR ), "Bem Vindo(a) ao Servidor %s\n\nVocк Acaba de se  Cadastrada\n\nDigite Sua Senha para Logar no Servidor\n\nStatus:Registrado\n\nSeu IP:%s", Nome, PlayerIP );
                ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, " ~ Logando ~", STR, "Logar", "Cancelar");
                return 1;
                }
               
            }else{
            format( STR, sizeof( STR ), "| INFO | O Jogador(a) %s foi Kickado do Servidor Motivo:N/A Registrou", Nome );
            SendClientMessageToAll( COR_ADMIN, STR );
        }
    }
    if(dialogid == DIALOG_LOGIN)
    {

        new STR[128];
        if(response)
        {

            if( !strlen ( inputtext ) )
            {

                SendClientMessage( playerid, COR_AVISO, "| AVISO | Atenзгo Vocк precisa digitar sua Senha para Logar.");
                format( STR, sizeof( STR ), "Bem Vindo(a) Novamente ao Servidor %s\n\nVocк ja tem uma Conta Cadastrada\n\nDigite Sua Senha para Logar no Servidor\n\nStatus:Registrado\n\nSeu IP:%s", Nome, PlayerIP );
                ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, " ~ Logando ~", STR, "Logar", "Cancelar");
                return 1;
            }
            GetPlayerName( playerid, Nome, sizeof( Nome ) );
            format( Arquivo, sizeof( Arquivo ), "Contas/%s.ini", Nome );
            if(!strcmp(inputtext,DOF2_GetString(Arquivo,"Senha"),false))
            {
                Administrador[playerid] = DOF2_GetInt( Arquivo, "Administrador");
                Level[playerid] = DOF2_GetInt( Arquivo, "Level");
                GivePlayerMoney(playerid, DOF2::GetInt(Arquivo,"Dinheiro"));
                Skin[playerid] = DOF2_GetInt( Arquivo, "Skin");
                Matou[playerid] = DOF2_GetInt( Arquivo, "Matou");
                Morreu[playerid] = DOF2_GetInt( Arquivo, "Morreu");
                DOF2_SaveFile();
                return 1;
            }else{
                PlayerERRO[playerid]+=1;
                if(PlayerERRO[playerid] == 3 )
                {
                    format( STR, sizeof( STR ), "| INFO | O Jogador(a) %s foi Kickado do Servidor Motivo:Limite de Erro", Nome );
                    SendClientMessageToAll( COR_ADMIN, STR );
                    Kick(playerid);
                }   return 1;
            }

        }else{
            format( STR, sizeof( STR ), "| INFO | O Jogador(a) %s foi Kickado do Servidor Motivo:N/A Registrou", Nome );
            SendClientMessageToAll( COR_ADMIN, STR );
            return 1;
        }
    }
   return 1;
}
Reply


Messages In This Thread
Dificuldade com verificaзгo de senha (Sistema de Registro) - by BWCALLEf - 08.12.2014, 15:28
Re: Dificuldade... - by JonathanFeitosa - 08.12.2014, 16:03
Re: Dificuldade... - by BWCALLEf - 08.12.2014, 19:01
Re: Dificuldade... - by JonathanFeitosa - 08.12.2014, 19:05
Re: Dificuldade... - by BWCALLEf - 08.12.2014, 22:12
Re: Dificuldade... - by JonathanFeitosa - 08.12.2014, 22:21
Re: Dificuldade... - by BWCALLEf - 08.12.2014, 22:46

Forum Jump:


Users browsing this thread: 1 Guest(s)