[Ajuda] Sistema de Login com falha
#8

Sei q n pediu, mas eu recomendo usar esta forma mais otimizada e foi removido coisas desnecessбrias e removi o erro da condicional da senha.

Denada

PHP код:
#include a_samp
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 

    new 
arquivo[40], nome[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnomeMAX_PLAYER_NAME); 
    
format(arquivo40"contas/%s.ini"nome); 
    if(
dialogid == DIALOG_REGISTRO
    { 
        if(!
response
           return 
Kick(playerid); 
        else 
        { 
            if(
strlen(inputtext) < || strlen(inputtext) > 20
                return 
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_PASSWORD"Registro""Vocк digitou sua muito curta ou comprida!\nTente uma entre 3 e 20 caracteres!""Confirma""Cancelar"); 
            else
            { 
                
DOF2_CreateFile(arquivo); 
                
DOF2_SetString(arquivo"senha"inputtext); 
                
DOF2_SetInt(arquivo"morreu"Player[playerid][morreu]); 
                
DOF2_SetInt(arquivo"matou"Player[playerid][matou]); 
                
DOF2_SetInt(arquivo"dinheiro"Player[playerid][dinheiro]); 
                
DOF2_SetInt(arquivo"level"Player[playerid][level]); 
                
DOF2_SaveFile(); 
                
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Cadastro realizado com sucesso! Por favor, faзa login""Confirma""Cancela"); 
            } 
        } 
    } 
    if(
dialogid == DIALOG_LOGIN
     { 
        if(!
response
          return 
Kick(playerid); 
        else 
        {
            if(
strcmp((DOF2_GetString(arquivo"senha"), inputtexttrue) == 0// se a senha estiver correta
            

                
Player[playerid][morreu] = DOF2_GetInt(arquivo"morreu"); 
                
Player[playerid][matou] = DOF2_GetInt(arquivo"matou"); 
                
Player[playerid][dinheiro] = DOF2_GetInt(arquivo"dinheiro"); 
                
Player[playerid][level] = DOF2_GetInt(arquivo"level"); 
                
GivePlayerMoney(playeridPlayer[playerid][dinheiro]); 
                
SetPlayerScore(playeridPlayer[playerid][level]); 
            } 
            else 
//se a senha estiver errada
            

                
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Vocк digitou sua senha errado, digite-a novamente para logar!\nSe errar 5 vezes vocк serб kickado!""Confirma""Cancelar"); 
                
Erro[playerid]++; 
                if(
Erro[playerid] == 5
                    return 
SendClientMessage(playerid0xFF0000FF"Vocк foi kickado por errar 5 vezes a sua senha!"),
                    
Kick(playerid);  
            }
        } 
   } 
    return 
1

Reply


Messages In This Thread
Sistema de Login com falha - by Mazin - 01.04.2016, 20:29
Re: Sistema de Login com falha - by F1N4L - 01.04.2016, 20:39
Re: Sistema de Login com falha - by Mazin - 01.04.2016, 21:35
Re: Sistema de Login com falha - by F1N4L - 01.04.2016, 21:41
Re: Sistema de Login com falha - by Mazin - 01.04.2016, 21:51
Re: Sistema de Login com falha - by F1N4L - 01.04.2016, 21:55
Re: Sistema de Login com falha - by Mazin - 02.04.2016, 04:13
Re: Sistema de Login com falha - by F1N4L - 02.04.2016, 11:46

Forum Jump:


Users browsing this thread: 2 Guest(s)