[Ajuda] login sem senha
#1

To fazendo sistema de login e senha, nгo sei mexer com DINI, sу vi uns tutoriais e to fuзando, mas a senha nгo ta salvando de jeito nenhum, nem ta entrando ta ficando como 0
Codigo base: http://pastebin.com/WBC19U3k
Reply
#2

Quote:
Originally Posted by luccagomes15
Посмотреть сообщение
To fazendo sistema de registro e login, mas tem um bug, se o cara da sу ENTER, sem senha consegue logar, eu comparei se a senha й igual a digitada, se digitar errado nao vai, mas se digitar nada, vai

pawn Код:
if(response == 1)
        {
            if(dini_Int(arq,"Senha") == strval(inputtext))
            {
                //money e pa
                SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
                Logado[playerid] = 1;
                return 1;
            }
            SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");
            ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
            return 1;
        }
        SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        Kick(playerid);
Copiou meu cуdigo.
Reply
#3

Espero ter ajudado.

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
arq[30];
    
format(arq,sizeof arq,"CONTAS/%s.ini"Nome(playerid));
    if(
dialogid == 1)
    {
        if(
response == 1)
        {
            new 
regstring[130];
            
dini_Create(arq);
            
SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo.");
            
format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
            
dini_IntSet(arq,"Senha"strval(inputtext));
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);

    }

    if(
dialogid == 2)
    {
        if(
response == 1)
        {
            if(
strcmp(dini_Int(arq"Senha"), strval(inputtext), true) == 0)
            {
                
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc.
                
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
                
Logado[playerid] = 1;
                return 
1;
            }
            
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
Espero ter ajudado.

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
arq[30];
    
format(arq,sizeof arq,"CONTAS/%s.ini"Nome(playerid));
    if(
dialogid == 1)
    {
        if(
response == 1)
        {
            new 
regstring[130];
            
dini_Create(arq);
            
SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo.");
            
format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
            
dini_IntSet(arq,"Senha"strval(inputtext));
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);
    }
    if(
dialogid == 2)
    {
        if(
response == 1)
        {
            if(
strcmp(dini_Int(arq"Senha"), strval(inputtext), true) == 0)
            {
                
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc.
                
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
                
Logado[playerid] = 1;
                return 
1;
            }
            
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);
    }
    return 
1;

Ta dando erro aqui
if(strcmp(dini_Int(arq, "Senha"), strval(inputtext), true) == 0)

error 035: argument type mismatch (argument 1)

O problema й q nem ta salvando a senha
Reply
#5

Ata esqueci de mudar uma funзгo xD, tente assim

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
arq[30];
    
format(arq,sizeof arq,"CONTAS/%s.ini"Nome(playerid));
    if(
dialogid == 1)
    {
        if(
response == 1)
        {
            new 
regstring[130];
            
dini_Create(arq);
            
SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo.");
            
format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
            
dini_IntSet(arq,"Senha"strval(inputtext));
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);

    }

    if(
dialogid == 2)
    {
        if(
response == 1)
        {
            if( 
strcmpdini_Getarq"Senha" ) ,strval(inputtext), true )  == )
            {
                
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc.
                
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
                
Logado[playerid] = 1;
                return 
1;
            }
            
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);
    }
    return 
1;

Reply
#6

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
Ata esqueci de mudar uma funзгo xD, tente assim

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
arq[30];
    
format(arq,sizeof arq,"CONTAS/%s.ini"Nome(playerid));
    if(
dialogid == 1)
    {
        if(
response == 1)
        {
            new 
regstring[130];
            
dini_Create(arq);
            
SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo.");
            
format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
            
dini_IntSet(arq,"Senha"strval(inputtext));
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);
    }
    if(
dialogid == 2)
    {
        if(
response == 1)
        {
            if( 
strcmpdini_Getarq"Senha" ) ,strval(inputtext), true )  == )
            {
                
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc.
                
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
                
Logado[playerid] = 1;
                return 
1;
            }
            
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
            return 
1;
        }
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
        
Kick(playerid);
    }
    return 
1;

if( strcmp( dini_Get( arq, "Senha" ) ,strval(inputtext), true ) == 0 )

error 035: argument type mismatch (argument 2)
Reply
#7

Coloca assim, se nao funcionar avisa o.o
PHP код:
if( strcmpdini_Get(arq"Senha" ) ,inputtexttrue ) == 
Reply
#8

Tinha uns erros e eu nao tinha percebido.
PHP код:
if(dialogid == 2

    if(
response
    { 
        if( 
strcmpdini_Getarq"Senha" ) ,inputtexttrue ) == 
        { 
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc. 
            
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!"); 
            
Logado[playerid] = 1;
            return 
1;
        } 
        else
        {
            
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");   
            
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair"); 
            return 
1
        } 
    }
    else
    {
        
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!"); 
        
Kick(playerid); 
    } 
    return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)