[Dъvida] Nгo loga
#1

Aк eu estava usando um GameMod ontem gostei e peguei algumas coisas para fazer de Base para um outro que eu estava ultilizando no caso GodFather, traduzi ele completamente.
Eu fui colocar o Box pra logar, sу que quando digita a senha nгo loga, sу dб pra logar com o comando /login
eu jб retirei esse comando do GM e nada acontece, vocкs pode me ajudar? vlw *.*
Reply
#2

Manda o seu Dialog.
No caso, public..
Reply
#3

public OnPlayerSpawn(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new string[128];
format(string, sizeof(string), ACCOUNTS_FOLDER, name);
if (AccountInfo[playerid][aLogged] == 0)
{
if (!fexist(string))
{
new kayitmsg[256];
format(kayitmsg,256,"Welcome to the server\n\n%s please open a new account\n\nEnter the new password:",name);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Register",kayitmsg,"Register","Quit");
register[playerid] = 1;
login[playerid] = 0;
}
else if (fexist(string))
{
new girismsg[256];
format(girismsg,256,"Welcome to the server\n\nUser Name: %s\n\nEnter your password:",name);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT ,"Login",girismsg,"Login","Quit");
register[playerid] = 0;
login[playerid] = 1;
}
}
return 1;
}


esse? '--'
Reply
#4

cara vc deve te traduzido tipo login[playerid] = 1; pra logar{playerid] = 1 alguma coisa tipo e nao mudo tipo new login pra new logar(ex nao ke dise ke tenha isso no gm)

mais num fs ke eu tradizi sem kere fis isso ai e deu erro
Reply
#5

Nгo, eu coloquei o comando /login denovo estб logando normalmente pq ainda estou colocando veiculos, mas eu traduzi tudo correto jб testei tudinho nгo hб erros. x-x
Reply
#6

Posta o que estб no public OnDialogResponse, no caso o Login e Register.


@Pedro

Cara, eu nгo entendi bulunfas oque vocк escreveu aн, pqp.
Reply
#7

Aqui


PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
        if (
response == 1)
        {
                if(
dialogid == 12345)
                {
                        if(
strlen(inputtext))
                        {
                                
Encrypt(inputtext);
                                new 
player[MAX_PLAYER_NAME];
                                
GetPlayerName(playeridplayer50);
                                new 
string3[32];
                                new 
playername3[MAX_PLAYER_NAME];
                                
GetPlayerName(playeridplayername3sizeof(playername3));
                                
format(string3sizeof(string3), ACCOUNTS_FOLDERplayername3);
                                new 
ip[20];
                                
GetPlayerIp(playerid,ip,sizeof(ip));
                                new 
FilehFile fopen(string3io_write);
                                if (
hFile)
                                {
                                        
strmid(AccountInfo[playerid][aPassword], inputtext0strlen(inputtext), 255);
                                        new var[
128];
                                        
format(var, 128"Password=%s\n"AccountInfo[playerid][aPassword]);fwrite(hFile, var);
                                        
format(var, 128"IP=%s\n",ip);fwrite(hFile, var);
                                        
fclose(hFile);
                                        
printf("%s is signed up.",playername3);
                                        
SendClientMessage(playeridGREEN"|- Have you registered. You can login now. -|");
                                        new 
girismsg[256];
                                        
format(girismsg,256,"Welcome to the server\n\nUser Name: %s\n\nEnter your password:",playername3);
                                        
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
                                        
register[playerid] = 0;
                                        
login[playerid] = 1;
                                }
                        }
                        else if(!
strlen(inputtext))
                        {
                                new 
name[MAX_PLAYER_NAME];
                                
GetPlayerName(playeridnamesizeof(name));
                                new 
kayitmsg[256];
                                
format(kayitmsg,256,"Welcome to the server\n\n%s please open a new account\n\nEnter the new password:",name);
                                
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",kayitmsg,"Register","Quit");
                                
register[playerid] = 1;
                                
login[playerid] = 0;
                        }
                }
                if(
dialogid == 12346)
                {
                        
Encrypt(inputtext);
                        new 
string2[128];
                        new 
playername2[MAX_PLAYER_NAME];
                        
GetPlayerName(playeridplayername2sizeof(playername2));
                        
format(string2sizeof(string2), ACCOUNTS_FOLDERplayername2);
                        new 
FileUserFile fopen(string2io_read);
                        if ( 
UserFile )
                        {
                                new 
PassData[256];
                                new 
keytmp[256], valtmp[256];
                                
freadUserFile PassData sizeofPassData ) );
                                
keytmp ini_GetKeyPassData );
                                if( 
strcmpkeytmp "Password" true ) == )
                                {
                                        
valtmp ini_GetValuePassData );
                                        
strmid(AccountInfo[playerid][aPassword], valtmp0strlen(valtmp)-1255);
                                }
                                if(
strcmp(AccountInfo[playerid][aPassword],inputtexttrue ) == 0)
                                {
                                    if(
strlen(inputtext))
                                    {
                                        for(new 
0strlen(AccountInfo[playerid][aPassword]); p++)
                                        {
                                                
inputtext[p] = '?';
                                        }
                                        
SetTimerEx("LogIn"LOGIN_DELAY*10000"d"playerid);
                                        
printf("%s is logged in.",playername2);
                                        new 
key[256] , val[256];
                                        new 
Data[256];
                                        while ( 
freadUserFile Data sizeofData ) ) )
                                        {
                                                
key ini_GetKeyData );
                                                
/*if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file.
                                                {
                                                        val = ini_GetValue( Data );
                                                        AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined.
                                                }
                                                */
                                        
}
                                        
fclose(UserFile);
                                    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)