[FilterScript] [v1.0]Sistema de Login/Registro JMLogBox
#1

Sistema de Login/Registro Jeanmon357
Olб pessoal, aqui trago um novo sistema de registro/login simples, feito inteiramente por mim, baseado na include para salvar dados Dini
O que o Sistema Salva?
-Vida
-Colete
-Score
-Dinheiro
-Skin
-Nivel de Procurado
Onde acho essa tal include dini?
A include feita por DracoBlue jб estб no JMLogBox.rar, portanto vocк nгo precisa procura-la!
Como instalo?
Vocк precisa baixar o arquivo JMLogBox.rar. Entгo vocк vai copiar o conteъdo do arquivo e colar na pasta do seu servidor, й simples!
Quais sгo os bugs?
Atй agora nгo achei nenhum, mas caso vocк encontre um poste um comentбrio e eu arrumarei na versгo 1.1
Dъvidas
-Posso edita-lo?
RE:Pode, contanto que vocк deixe os devidos crйditos!
-Posso retirar os crйditos?
RE:NГO!
DOWNLOAD
Vocк pode executar o donwload do Fliter Script neste Link
Link: http://solidfiles.com/d/fa5f121bff/
Gostou? Da reputation! Nгo custa nada, й apenas um agradecimento a um bom trabalho!

Caso vocк tenha mais dъvidas deixe um comentбrio e eu a responderei!
Reply
#2

Pastebin?

@off
Post 400 \х/
Reply
#3

Mais um

Parabйns e quanto ao reputation...
(meu rep nem vale nada ainda ariairaira, se valesse eu te dava =/)
Reply
#4

Obrigado FFS e HardWare n entendi...
Reply
#5

Parabens pelo seu sistema
Reply
#6

Obrigado Bruno
Reply
#7

Coloca no Pastebin.
Reply
#8

Pra que? й melhor fazer download!!
Reply
#9

Nй Nгo
Reply
#10

Pra que baixar, se pode colocar em um link onde se pode ver o cуdigo muito mais rбpido. Mas enfim, faзa como quiser.
Reply
#11

Quote:
Originally Posted by jeanmon357
Посмотреть сообщение
Obrigado FFS e HardWare n entendi...
FFS й meu clг
iBauss й meu nick І

Quanto ao pastebin й melhor para as pessoas que sу irгo ver o cуdigo para lhe avaliar e lhe avisar caso houver algum erro.
Reply
#12

Quote:

Quanto ao pastebin й melhor para as pessoas que sу irгo ver o cуdigo para lhe avaliar e lhe avisar caso houver algum erro.

Exatamente. Eu nгo pretendo usar, sу quero ver como estб o cуdigo.
Reply
#13

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>
#include <dini>

new Tentativas[MAX_PLAYERS];
new Morreu[MAX_PLAYERS];
new Matou[MAX_PLAYERS];

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Carregando: Jeanmon357 Login Box.....");
    print(" Jeanmon357 Login Box Carregado!");
    print(" Todos os direitos reservados a Jeanmon357");
    print(" NГO RETIRE OS CRЙDITOS");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Descarregando: Jeanmon357 Login Box.....");
    print(" Jeanmon357 Login Box Descarregado!");
    print(" Todos os direitos reservados a Jeanmon357");
    print(" NГO RETIRE OS CRЙDITOS");
    print("--------------------------------------\n");
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif
public OnPlayerConnect(playerid)
{
    LoadImportantePlayer(playerid);
    LoadImportantePlayer2(playerid);
    new arquivoplayers[64];
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(arquivoplayers,sizeof(arquivoplayers),"/Players/%s.txt",Nome);
    if(dini_Exists(arquivoplayers))
    {

        ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bem Vindo devolta ao Brasil True Life City, sua conta jб esta registrada, portanto coloque sua senha para efetuar o Login.","Login","Sair");
    }
    else
    {
        ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registro","Bem Vindo ao Brasil True Life City, registre-se para poder jogar!","Registrar","Sair");
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Lrcreditos", cmdtext, true, 10) == 0)
    {
        MostrarCreditos(playerid);
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==DIALOG_LOGIN)
    {
        if(response==0)
        {
            new string[126];
            GetPlayerName(playerid,string,sizeof(string));
            format(string,sizeof(string),"O Player %s foi kickado por nгo se logar!");
            SendClientMessageToAll(0xFFAACCDDAA,string);
            Kick(playerid);
            SendClientMessage(playerid,0xFFAACCDDAA,"Sem se logar vocк nгo pode jogar, por isso foi kikado");
        }
        if(response==1)
        {
            if(!strlen(inputtext))
        {
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bem Vindo devolta ao Brasil True Life City, sua conta jб esta registrada, portanto coloque sua senha para efetuar o Login.","Logar","Sair");
                return 1;
        }
            else
        {
                Logar(playerid,inputtext);
                return 1;
        }
    }
}
    if(dialogid==DIALOG_REGISTER)
    {
        if(response==0)
        {
            new string[126];
            GetPlayerName(playerid,string,sizeof(string));
            format(string,sizeof(string),"O Player %s foi kickado por nгo se registrar!");
            SendClientMessageToAll(0xFFAACCDDAA,string);
            Kick(playerid);
            SendClientMessage(playerid,0xFFAACCDDAA,"Sem se registrar vocк nгo pode jogar, por isso foi kikado");
        }
        if(response==1)
        {
            if(!strlen(inputtext))
        {
                SendClientMessage(playerid,0xFFAACCDDAA,"Esta senha nгo й aceitada! Por favor coloque outra!");
                ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registro","Bem Vindo ao Brasil True Life City, registre-se para poder jogar!","Registrar","Sair");
                return 1;
        }
            else
        {
                Register(playerid,inputtext);
                return 1;
        }
    }
}
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
stock Register(playerid,key[])
{
    new arquivoplayers[64];
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(arquivoplayers,sizeof(arquivoplayers),"/Players/%s.txt",Nome);
    dini_Create(arquivoplayers);
    dini_Set(arquivoplayers,"Senha",key);
    SendClientMessage(playerid,0xFFAACCDDAA,"Registrado com sucesso");
    dini_IntSet(arquivoplayers,"Level",0);
    new Float:Vida, Float:Colete;
    GetPlayerHealth(playerid, Vida);
    GetPlayerArmour(playerid, Colete);
    dini_IntSet(arquivoplayers, "Dinheiro", GetPlayerMoney(playerid));
    dini_IntSet(arquivoplayers, "LevelProcurado", GetPlayerWantedLevel(playerid));
    dini_IntSet(arquivoplayers, "SkinPlayer", GetPlayerSkin(playerid));
    dini_FloatSet(arquivoplayers, "Vida", Vida);
    dini_FloatSet(arquivoplayers, "Colete", Colete);
    return 1;
}
stock Logar(playerid,key[])
{
    new arquivoplayers[64];
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(arquivoplayers,sizeof(arquivoplayers),"/Players/%s.txt",Nome);
    if(!strcmp(key,dini_Get(arquivoplayers,"Senha"),false))
    {
        SetPlayerScore(playerid,dini_Int(arquivoplayers,"Level"));
        GivePlayerMoney(playerid, dini_Int(arquivoplayers, "Dinheiro"));
        SetPlayerWantedLevel(playerid, dini_Int(arquivoplayers, "LevelProcurado"));
        SetPlayerSkin(playerid, dini_Int(arquivoplayers, "SkinPlayer"));
        SetPlayerHealth(playerid, dini_Float(arquivoplayers, "Vida"));
        SetPlayerArmour(playerid, dini_Float(arquivoplayers, "Colete"));
        Morreu[playerid] = dini_Int(arquivoplayers, "Morreu");
        Matou[playerid] = dini_Int(arquivoplayers, "Matou");
        SendClientMessage(playerid,0xFFAACCDDAA,"Vocк logou com sucesso!");
        return 1;
    }
    if(Tentativas[playerid]==4)
    {
        SendClientMessage(playerid,0xFFAACCDDAA,"Vocк foi kickado por errar a sua senha mais do que 3 vezes");
        Kick(playerid);
        return 1;
    }
    else
    {
        ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bem Vindo devolta ao Brasil True Life City, sua conta jб esta registrada, portanto coloque sua senha para efetuar o Login.","Logar","Sair");
        SendClientMessage(playerid,0xFFAACCDDAA,"Sua senha estб errada! Caso vocк a erre mais de 3 vezes vocк serб kickado por motivos de seguranзa!");
        Tentativas[playerid]++;
        return 1;
    }
}
stock LoadImportantePlayer(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    SendClientMessage(playerid,0xFFAACCDDAA,"Ou entгo digite /lrcreditos");
    return 1;
}
stock LoadImportantePlayer2(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    return 1;
}
stock MostrarCreditos(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    SendClientMessage(playerid,0xFFAACCDDAA,"Se os crйditos de quando vocк loga esta diferente, o dono do servidor os trocou e tentou levar os crйditos!");
    return 1;
}
'-'
Reply
#14

1є problema: Vocк utilizou main() sendo que ele nгo й necessбrio.
2є problema: Vocк utilizou dini, uma include que й lenta, desatualizada e nгo recomendada.
3є problema:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==DIALOG_LOGIN)
    {
        if(response==0)
        {
            new string[126];
            GetPlayerName(playerid,string,sizeof(string));
            format(string,sizeof(string),"O Player %s foi kickado por nгo se logar!");
            SendClientMessageToAll(0xFFAACCDDAA,string);
            Kick(playerid);
            SendClientMessage(playerid,0xFFAACCDDAA,"Sem se logar vocк nгo pode jogar, por isso foi kikado");
        }
        if(response==1)
        {
            if(!strlen(inputtext))
        {
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bem Vindo devolta ao Brasil True Life City, sua conta jб esta registrada, portanto coloque sua senha para efetuar o Login.","Logar","Sair");
                return 1;
        }
            else
        {
                Logar(playerid,inputtext);
                return 1;
        }
    }
}
    if(dialogid==DIALOG_REGISTER)
    {
        if(response==0)
        {
            new string[126];
            GetPlayerName(playerid,string,sizeof(string));
            format(string,sizeof(string),"O Player %s foi kickado por nгo se registrar!");
            SendClientMessageToAll(0xFFAACCDDAA,string);
            Kick(playerid);
            SendClientMessage(playerid,0xFFAACCDDAA,"Sem se registrar vocк nгo pode jogar, por isso foi kikado");
        }
        if(response==1)
        {
            if(!strlen(inputtext))
        {
                SendClientMessage(playerid,0xFFAACCDDAA,"Esta senha nгo й aceitada! Por favor coloque outra!");
                ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registro","Bem Vindo ao Brasil True Life City, registre-se para poder jogar!","Registrar","Sair");
                return 1;
        }
            else
        {
                Register(playerid,inputtext);
                return 1;
        }
    }
}
    return 1;
}
Vocк estб fazendo essa identaзгo errada.

4є problema: Vocк colocou a callback OnPlayerClickPlayer no script, mais nгo utilizou ela.

5є problema: Vai dar warning na stock Logar, faltou um return 1;

6є problema: Pra que 3 stocks para enviar mensagens praticamente idкnticas?

pawn Код:
stock LoadImportantePlayer(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    SendClientMessage(playerid,0xFFAACCDDAA,"Ou entгo digite /lrcreditos");
    return 1;
}
stock LoadImportantePlayer2(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    return 1;
}
stock MostrarCreditos(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    SendClientMessage(playerid,0xFFAACCDDAA,"Se os crйditos de quando vocк loga esta diferente, o dono do servidor os trocou e tentou levar os crйditos!");
    return 1;
}
7є problema: Vocк esqueceu de postar no pastebin.

Oque eu posso te dizer do seu sistema? Уtimo! Somente arrume os problemas acima citados e ficarб excelente e terб minha reputaзгo!
Reply
#15

Lуs, lembre-se que o Main nгo estб sendo lido e compilado.
Repare:

pawn Код:
#define FILTERSCRIPT // Define FILTERSCRIPT

#if defined FILTERSCRIPT // Se FILTERSCRIPT for definido, entгo executa as funзхes/callbacks abaixo.

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Carregando: Jeanmon357 Login Box.....");
    print(" Jeanmon357 Login Box Carregado!");
    print(" Todos os direitos reservados a Jeanmon357");
    print(" NГO RETIRE OS CRЙDITOS");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Descarregando: Jeanmon357 Login Box.....");
    print(" Jeanmon357 Login Box Descarregado!");
    print(" Todos os direitos reservados a Jeanmon357");
    print(" NГO RETIRE OS CRЙDITOS");
    print("--------------------------------------\n");
    return 1;
}

#else // Se nгo, executa o MAIN.

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif // Finaliza o IF.
Nгo tem necessidade disso, porйm tambйm nгo haverб problemas pois nгo serб lido.


#topic
Dб pra melhorar.
Reply
#16

Quote:
Originally Posted by DreeH
Посмотреть сообщение
Lуs, lembre-se que o Main nгo estб sendo lido e compilado.
Repare:

pawn Код:
#define FILTERSCRIPT // Define FILTERSCRIPT

#if defined FILTERSCRIPT // Se FILTERSCRIPT for definido, entгo executa as funзхes/callbacks abaixo.

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Carregando: Jeanmon357 Login Box.....");
    print(" Jeanmon357 Login Box Carregado!");
    print(" Todos os direitos reservados a Jeanmon357");
    print(" NГO RETIRE OS CRЙDITOS");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print(" Descarregando: Jeanmon357 Login Box.....");
    print(" Jeanmon357 Login Box Descarregado!");
    print(" Todos os direitos reservados a Jeanmon357");
    print(" NГO RETIRE OS CRЙDITOS");
    print("--------------------------------------\n");
    return 1;
}

#else // Se nгo, executa o MAIN.

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif // Finaliza o IF.
Nгo tem necessidade disso, porйm tambйm nгo haverб problemas pois nгo serб lido.


#topic
Dб pra melhorar.
Eu vi isso, mais й perca de tempo deixa-lo ali. A diferenзa de deixar ou nгo, sгo apenas linhas.
Reply
#17

Quote:
Originally Posted by Los
Посмотреть сообщение
1є problema: Vocк utilizou main() sendo que ele nгo й necessбrio.
2є problema: Vocк utilizou dini, uma include que й lenta, desatualizada e nгo recomendada.
3є problema:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==DIALOG_LOGIN)
    {
        if(response==0)
        {
            new string[126];
            GetPlayerName(playerid,string,sizeof(string));
            format(string,sizeof(string),"O Player %s foi kickado por nгo se logar!");
            SendClientMessageToAll(0xFFAACCDDAA,string);
            Kick(playerid);
            SendClientMessage(playerid,0xFFAACCDDAA,"Sem se logar vocк nгo pode jogar, por isso foi kikado");
        }
        if(response==1)
        {
            if(!strlen(inputtext))
        {
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bem Vindo devolta ao Brasil True Life City, sua conta jб esta registrada, portanto coloque sua senha para efetuar o Login.","Logar","Sair");
                return 1;
        }
            else
        {
                Logar(playerid,inputtext);
                return 1;
        }
    }
}
    if(dialogid==DIALOG_REGISTER)
    {
        if(response==0)
        {
            new string[126];
            GetPlayerName(playerid,string,sizeof(string));
            format(string,sizeof(string),"O Player %s foi kickado por nгo se registrar!");
            SendClientMessageToAll(0xFFAACCDDAA,string);
            Kick(playerid);
            SendClientMessage(playerid,0xFFAACCDDAA,"Sem se registrar vocк nгo pode jogar, por isso foi kikado");
        }
        if(response==1)
        {
            if(!strlen(inputtext))
        {
                SendClientMessage(playerid,0xFFAACCDDAA,"Esta senha nгo й aceitada! Por favor coloque outra!");
                ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registro","Bem Vindo ao Brasil True Life City, registre-se para poder jogar!","Registrar","Sair");
                return 1;
        }
            else
        {
                Register(playerid,inputtext);
                return 1;
        }
    }
}
    return 1;
}
Vocк estб fazendo essa identaзгo errada.

4є problema: Vocк colocou a callback OnPlayerClickPlayer no script, mais nгo utilizou ela.

5є problema: Vai dar warning na stock Logar, faltou um return 1;

6є problema: Pra que 3 stocks para enviar mensagens praticamente idкnticas?

pawn Код:
stock LoadImportantePlayer(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    SendClientMessage(playerid,0xFFAACCDDAA,"Ou entгo digite /lrcreditos");
    return 1;
}
stock LoadImportantePlayer2(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    return 1;
}
stock MostrarCreditos(playerid)
{
    SendClientMessage(playerid,0xFFAACCDDAA,"Sistema de Login/Registro feito por Jeanmon357!");
    SendClientMessage(playerid,0xFFAACCDDAA,"Se os crйditos de quando vocк loga esta diferente, o dono do servidor os trocou e tentou levar os crйditos!");
    return 1;
}
7є problema: Vocк esqueceu de postar no pastebin.

Oque eu posso te dizer do seu sistema? Уtimo! Somente arrume os problemas acima citados e ficarб excelente e terб minha reputaзгo!
Lуs, quem vocк pensas que й ?
abaixa a bola ai!, vocк nгo tem esta moral toda nгo!
estou achando que vou comeзar a fazer assim com seus projetos tambйm...
Reply
#18

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
Lуs, quem vocк pensas que й ?
abaixa a bola ai!, vocк nгo tem esta moral toda nгo!
estou achando que vou comeзar a fazer assim com seus projetos tambйm...
Leia o post inteiro, nгo critiquei, somente citei os problemas para serem corrigidos. Se vocк nгo tem olhar crнtico, I'm sorry, mais ao vocк postar um release vocк concorda que pode ser criticado e surgira problemas. Faзa isso com meus projetos e terei o prazer de te agradecer por me apontar os erros.

Quote:
Originally Posted by Los
Посмотреть сообщение
Oque eu posso te dizer do seu sistema? Уtimo! Somente arrume os problemas acima citados e ficarб excelente e terб minha reputaзгo!
Reply
#19

Quote:

2є problema: Vocк utilizou dini, uma include que й lenta, desatualizada e nгo recomendada.

Lento, desatualizado e nгo recomendado nгo faz com que sua aplicaзгo em um script seja considerada um problema, nгo passa da escolha dele.
Reply
#20

Bom Los, quanto aos problemas irei conserta-los... E quanto a sua critica pelas mensagens, isso й contra os tiradores de crйditos, caso eles sу deletem o comando ainda tem os stocks e pode dar erros, fazendo com que eles coloquem novamente o stock para meus crйditos...
A e, obrigado pela sua уtima crнtica fiquei feliz em saber que vocк gostou.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)