Como Comparar Com <DINI>
#1

Iae Galerinha Do Bem Eu To Criando O Sistema De Registro Do Meu [GameMode] E Ele Esta Funcionando Que й Uma Beleza O Registro Mas Estou Com Problemas Para Fazer O Login й Que Eu Nгo Sei Como Faзo Para Comparar O Que O Player Digita No Inputtext Com A Senha Se Puderem Me Ajudar Eu Agradeзo Muitissississimo.

Estou Usando Dini

E O Dini_Set Da Senha й
pawn Код:
dini_Set(NovaConta, "Senha", inputtext);
Reply
#2

Se colocar sу a "Senha" ele so iria escrever "senha" no arquivo Deves escrever a senha e a chave certo?
Quote:

dini_Set(NovaConta, "Senha=%s", inputtext);

Reply
#3

Sim isto eu sei mas eu queria saber como faзo para comparar o Inputtext com a Senha do arquivo para ele spawnar o player e isto que nгo estou conseguindo fazer
Reply
#4

Quote:
Originally Posted by Unset
Посмотреть сообщение
Se colocar sу a "Senha" ele so iria escrever "senha" no arquivo Deves escrever a senha e a chave certo?
Vocк estб: Errado.


On-Topic:
Use: dini_Get("Pasta.ini","Senha");

Ficando:
pawn Код:
if(!strcmp(inputtext,dini_Get("Pasta.ini","Senha"),false)) {//Se estiver certo
}
Reply
#5

Tб mas aki no caso ele cria um archivo com o nome do player:
Ai no caso eu usaria

pawn Код:
if(!strcmp(inputtext,dini_Get("%s.ini",PlayerNome,"Senha"),false)) {//Se estiver certo
}
??
depois do "%s.ini" e antes do "Senha" para carregar o archivo do player ??
Agradesco se reponder
Reply
#6

Quote:
Originally Posted by TiagoPS
Посмотреть сообщение
Tб mas aki no caso ele cria um archivo com o nome do player:
Ai no caso eu usaria

pawn Код:
if(!strcmp(inputtext,dini_Get("%s.ini",PlayerNome,"Senha"),false)) {//Se estiver certo
}
??
depois do "%s.ini" e antes do "Senha" para carregar o archivo do player ??
Agradesco se reponder
Faзa mais ou menos assim, no DialogResponse:
pawn Код:
new nome[25];GetPlayerName(playerid,nome,25);
new Contas[50];format(Contas,50,"Contas/%s.ini",nome);
if(!strcmp(inputtext,dini_Get(Contas,PlayerNome,"Senha"),false)) {
//Se estiver certo
}
Modifique o:
format(Contas,50,"Contas/%s.ini",nome);

De acordo com seu GM.
Reply
#7

Desculpe-me mas nгo estou conseguindo se puder me ajudar eu agradeзo muito aki esta todo meu codigo

pawn Код:
public OnPlayerConnect(playerid)
{
    if(Registrado[playerid] == NAO)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new mensagem[256];
        format(mensagem,256,"Seja Bem Vindo %s\nPor Favor Digite Uma Senha Para Se Registrar",name);
        ShowPlayerDialog(playerid,REGISTRO,DIALOG_STYLE_INPUT,"Registrar",mensagem,"Registrar","Cancelar");
        return 1;
    }
    if(Registrado[playerid] == SIM)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new mensagem[256];
        format(mensagem,256,"Seja Bem Vindo %s\nPor Favor Digite Sua Senha Para Se Logar",name);
        ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Login",mensagem,"Logar","Cancelar");
        return 1;
    }
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (response == 1)
    {
        if(dialogid == REGISTRO)
        {
            if(strlen(inputtext))
            {
            new NovaConta[100];
            new PlayerNome[MAX_PLAYER_NAME];
            GetPlayerName(playerid, PlayerNome, sizeof(PlayerNome));
            format(NovaConta, sizeof(NovaConta), "%s.ini", PlayerNome);
            dini_Create(NovaConta);
            dini_Set(NovaConta, "Senha", inputtext);
            SendClientMessage(playerid,VERDE,"[FLB] Sua conta foi criada com sucesso");
            SpawnPlayer(playerid);
            Registrado[playerid] = SIM;
            }
            else
            {
            SendClientMessage(playerid,VERMELHO,"[FLB] Vocк nгo quis se registrar, por este motivo sera Kicado");
            Kick(playerid);
            }
        }
        if(dialogid == LOGIN)
        {
            //AKI И PARA LOGAR SE A SENHA ESTIVER CORRETA
            return 1;
        }
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by TiagoPS
Посмотреть сообщение
Desculpe-me mas nгo estou conseguindo se puder me ajudar eu agradeзo muito aki esta todo meu codigo

pawn Код:
public OnPlayerConnect(playerid)
{
    if(Registrado[playerid] == NAO)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new mensagem[256];
        format(mensagem,256,"Seja Bem Vindo %s\nPor Favor Digite Uma Senha Para Se Registrar",name);
        ShowPlayerDialog(playerid,REGISTRO,DIALOG_STYLE_INPUT,"Registrar",mensagem,"Registrar","Cancelar");
        return 1;
    }
    if(Registrado[playerid] == SIM)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new mensagem[256];
        format(mensagem,256,"Seja Bem Vindo %s\nPor Favor Digite Sua Senha Para Se Logar",name);
        ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Login",mensagem,"Logar","Cancelar");
        return 1;
    }
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (response == 1)
    {
        if(dialogid == REGISTRO)
        {
            if(strlen(inputtext))
            {
            new NovaConta[100];
            new PlayerNome[MAX_PLAYER_NAME];
            GetPlayerName(playerid, PlayerNome, sizeof(PlayerNome));
            format(NovaConta, sizeof(NovaConta), "%s.ini", PlayerNome);
            dini_Create(NovaConta);
            dini_Set(NovaConta, "Senha", inputtext);
            SendClientMessage(playerid,VERDE,"[FLB] Sua conta foi criada com sucesso");
            SpawnPlayer(playerid);
            Registrado[playerid] = SIM;
            }
            else
            {
            SendClientMessage(playerid,VERMELHO,"[FLB] Vocк nгo quis se registrar, por este motivo sera Kicado");
            Kick(playerid);
            }
        }
        if(dialogid == LOGIN)
        {
            new nome[28];GetPlayerName(playerid,nome,28);
            new Contas[28];format(Contas,50,"%s.ini",nome);
            if(!strcmp(inputtext,dini_Get(Contas,PlayerNome,"Senha"),false)) {
            //Se estiver certo
            }
            return 1;
        }
    }
    return 1;
}
Apenas mude o:
//Se estiver certo
Reply
#9

Код:
C:\Documents and Settings\TIAGO\Desktop\Servidor\gamemodes\Novo.pwn(272) : error 017: undefined symbol "PlayerNome"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Compilou Correctamente Mas Deu Um Erro

Linha:
pawn Код:
if(!strcmp(inputtext,dini_Get(Contas,PlayerNome,"Senha"),false))
Reply
#10

Quote:
Originally Posted by TiagoPS
Посмотреть сообщение
Код:
C:\Documents and Settings\TIAGO\Desktop\Servidor\gamemodes\Novo.pwn(272) : error 017: undefined symbol "PlayerNome"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Compilou Correctamente Mas Deu Um Erro

Linha:
pawn Код:
if(!strcmp(inputtext,dini_Get(Contas,PlayerNome,"Senha"),false))
Se mudou o nome para PlayerNome.
Troque:
pawn Код:
if(!strcmp(inputtext,dini_Get(Contas,nome,"Senha"),false))
Nada demais.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)