[Ajuda] Problema em Sistema de Registro e Login com DOF2!
#1

Olб galera do Fуrum SA:MP, eu criei um sistema de Registro e Login em DOF2, porйm ele estб dando um problema...

PHP код:
    if(dialogid == D_REGISTRO)
    {
        if(
response)
        {
            new 
dialog[500];
            if(
strlen(inputtext) < MIN_SENHA || strlen(inputtext) > MAX_SENHA)
            {
                
SendClientMessage(playeridCOR_ERRO"| ERRO | Sua senha deve conter de 5 б 15 caracteres para ser considerada vбlida!");
                
format(dialogsizeof(dialog), "\n{FFFF00}******* **** ***** - Registro\n\n{FFFFFF}Nick: {FF8000}%s\n\n{FFFFFF}Conta: {FF0000}Nгo Registrada\n\n{FFFFFF}IP: {FF8000}%s\n\n{FFFFFF}Informe uma senha abaixo:"PlayerName(playerid), PlayerIp(playerid));
                
ShowPlayerDialog(playeridD_REGISTRODIALOG_STYLE_PASSWORD"{FF0000}Registro - Senha"dialog"Registrar""Sair");
            }
            
GivePlayerMoney(playerid2000);
            
Info[playerid][Logado] = true;
            
LimparChat();
            
SendClientMessage(playerid0xFFFFFFAA"| INFO | Registro efetuado com sucesso!");
            
SpawnPlayer(playerid);
        }
        else
        {
            
SendClientMessage(playeridCOR_ERRO"| ERRO | Vocк foi kickado por sair sem se registrar");
            
Kick(playerid);
        }
        return 
1;
    } 
Quando ele estб deste modo ele spawna o player certinha, seta os 2000 de dinheiro, e tambйm seta a funзгo Logado, ai eu fui lб e criei essa parte de criar e salvar o arquivo do player...

PHP код:
            new arquivos[40];
            
format(arquivossizeof(arquivos), PASTA_CONTASPlayerName(playerid));
            
DOF2_CreateFile(arquivos);
            
DOF2_SetString(arquivos"Senha"encrypt(inputtext));
            
DOF2_SaveFile(); 
Porйm quando eu entro no servidor e clico em registrar, ele desligar o samp-server...
E se eu tiro ele funciona normal, entгo eu tirei por mim que o erro estб nessa parte...

Vocкs poderiam me ajudar nisso ai, pelo menos dizer oque й...
Reply
#2

mende o #define PASTA_CONTAS

vocк nгo criou a pasta das contas
Reply
#3

Quote:
Originally Posted by Marllun
Посмотреть сообщение
mende o #define PASTA_CONTAS
#define PASTA_CONTAS "Contas/%s.ini"

Quote:
Originally Posted by Marllun
Посмотреть сообщение
vocк nгo criou a pasta das contas
Sim ela estб criada...
Reply
#4

esse sistema de login ta usando outras pasta? ou estб usando algum plugin como o Whirlpool ?

tenta isso

PHP код:
new arquivos[40]; 
format(arquivossizeof(arquivos), PASTA_CONTASPlayerName(playerid)); 
DOF2_CreateFile(arquivos); 
DOF2_SetString(arquivos"Senha",inputtext);   
DOF2_SaveFile(); 
Reply
#5

Quote:
Originally Posted by Marllun
Посмотреть сообщение
esse sistema de login ta usando outras pasta? ou estб usando algum plugin como o Whirlpool ?
Sim, tenho o plugin Whirlpool instalado, seria uma boa eu remover ele?
Enquanto as pastas, sу esta usando uma mesmo...

Quote:
Originally Posted by Marllun
Посмотреть сообщение
tenta isso

PHP код:
new arquivos[40]; 
format(arquivossizeof(arquivos), PASTA_CONTASPlayerName(playerid)); 
DOF2_CreateFile(arquivos); 
DOF2_SetString(arquivos"Senha",inputtext);   
DOF2_SaveFile(); 
Mesma coisa.... Continua do mesmo jeito
Reply
#6

faz um teste remova o plugin.

remova isso
PHP код:
native WP_Hash(buffer[], len, const str[]); 
Reply
#7

Sу para dar uma complementada a mais na ajuda, no samp-server(LOG) aparece isso quando ele desliga...

PHP код:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[20:14:27filterscripts ""  (string)
[
20:14:27weburl "www.sa-mp.com"  (string)
[
20:14:27
[
20:14:27Server Plugins
[20:14:27] --------------
[
20:14:27]  Loading pluginsscanf
[20:14:27
[
20:14:27]  ===============================
[
20:14:27]       sscanf plugin loaded.     
[
20:14:27]          Version:  2.8.2        
[20:14:27]    (c2012 Alex "******" Cole  
[20:14:27]  ===============================
[
20:14:27]   Loaded.
[
20:14:27]  Loading plugincrashdetect
[20:14:27]   crashdetect v4.8.3 is OK.
[
20:14:27]   Loaded.
[
20:14:27]  Loading pluginMapAndreas
[20:14:27]   Loaded.
[
20:14:27]  Loading pluginstreamer
[20:14:27
*** 
Streamer Plugin v2.6.1 by Incognito loaded ***
[
20:14:27]   Loaded.
[
20:14:27]  Loading pluginWinExec
[20:14:27]   Loaded.
[
20:14:27]  Loaded 5 plugins.
[
20:14:27
[
20:14:27Ban list
[
20:14:27] --------
[
20:14:27]  Loadedsamp.ban
[20:14:27
[
20:14:27
[
20:14:27Filterscripts
[20:14:27] ---------------
[
20:14:27]   Loaded 0 filterscripts.
[
20:14:27] >>> ***SERVIDOR LIGADO*** <<<
[
20:14:27Nome
[
20:14:27Modo
[
20:14:27Versao
[
20:14:27GameMode
[
20:14:27] >>> ***FIM DAS INFORMACOES*** <<<
[
20:14:27Number of vehicle models0
[20:14:45] [connection127.0.0.1:63603 requests connection cookie.
[
20:14:46] [connectionincoming connection127.0.0.1:63603 id0
[20:14:46] [joinLincoln has joined the server (0:127.0.0.1)
[
20:14:55] [debugRun time error 4"Array index out of bounds"
[20:14:55] [debug]  Accessing element at index 59 past array upper bound 52
[20:14:55] [debugAMX backtrace:
[
20:14:55] [debug#0 0000ea68 in ?? () from VL.amx
[20:14:55] [debug#1 0000c49c in public OnDialogResponse () from VL.amx 
Reply
#8

Quote:
Originally Posted by Marllun
Посмотреть сообщение
faz um teste remova o plugin.
Removi e continuou do mesmo jeito....

Quote:
Originally Posted by Marllun
Посмотреть сообщение
remova isso
PHP код:
native WP_Hash(buffer[], len, const str[]); 
No caso, eu teria que remover isso da onde??
Reply
#9

Coloca o plugin dnv e faz oq ta aqui

http://forum.sa-mp.com/showpost.php?...45&postcount=2
Reply
#10

Код:
if(dialogid == D_REGISTRO) 
    { 
        if(response) 
        { 
            new dialog[500]; 
            if(strlen(inputtext) < MIN_SENHA || strlen(inputtext) > MAX_SENHA) 
            { 
                SendClientMessage(playerid, COR_ERRO, "| ERRO | Sua senha deve conter de 5 б 15 caracteres para ser considerada vбlida!"); 
                format(dialog, sizeof(dialog), "\n{FFFF00}******* **** ***** - Registro\n\n{FFFFFF}Nick: {FF8000}%s\n\n{FFFFFF}Conta: {FF0000}Nгo Registrada\n\n{FFFFFF}IP: {FF8000}%s\n\n{FFFFFF}Informe uma senha abaixo:", PlayerName(playerid), PlayerIp(playerid)); 
                return ShowPlayerDialog(playerid, D_REGISTRO, DIALOG_STYLE_PASSWORD, "{FF0000}Registro - Senha", dialog, "Registrar", "Sair");
            } 
            GivePlayerMoney(playerid, 2000); 
            Info[playerid][Logado] = true; 
            LimparChat(); 
            SendClientMessage(playerid, 0xFFFFFFAA, "| INFO | Registro efetuado com sucesso!"); 
            SpawnPlayer(playerid); 
        } 
        else 
        { 
            SendClientMessage(playerid, COR_ERRO, "| ERRO | Vocк foi kickado por sair sem se registrar"); 
            Kick(playerid); 
        } 
        return 1; 
    }
Ao fazer um if() vocк deve sempre colocar um return para evitar que o cуdigo abaixo seja executado.
@EDIT
E tambйm, a pasta dos usuбrios deve ficar dentro de scriptfiles, pois o samp-server nгo consegue criar pastas fora desse diretуrio.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)