SA-MP Forums Archive
[Ajuda] Servidor trava .. DOF2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Servidor trava .. DOF2 (/showthread.php?tid=360812)



Servidor trava .. DOF2 - Lukinhas_Ice - 19.07.2012

bom .. voltei a fazer o Login e Registro em Dialog, tб pronto, mais quando eu entro no servidor fica lб
Код:
[22:22:29] Connected. Joining the game...

[22:22:29] » {FF0000}Lucas (ID:0) Entrou {FFFFFF}no {66FF33}Servidor!

[22:22:29]  **********************************************************************************

[22:22:29]                         Bem vindo

[22:22:29]                     Tipos de Partidas

[22:22:29]           AAD | Arena's | Team Death Match

[22:22:29]  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[22:22:29] Para ver seus stats digite /Stats
e fica nisso, ele "congela" quando vai carregar o dialog, carrega tudo acima do dialog ..

parte dele do OnPlayerConnect
pawn Код:
new file[64];
GetPlayerName(playerid,file,sizeof(file));
format(file,sizeof(file),DOF2_File(file));
if(DOF2_FileExists(file))
{
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Bem Vindo Novamente, Logue-se","{FFFFFF}Coloque sua {00FF22}senha {FFFFFF}Para logar!","Log-in","Quit");

}


else
{
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registre-se para poder jogar!","{FFFFFF}Coloque sua {00FF22}senha {FFFFFF}Para registrar!","Register","Quit");

}
e no OnDialogResponse
pawn Код:
switch(dialogid)  {
    case DIALOG_REGISTER:                      
    {
        if(!response) Kick(playerid);          
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registre-se para poder jogar!","{FFFFFF}Coloque sua {00FF22}senha {FFFFFF}Para registrar!","Register","Quit");
        if(response) {                          
            new file[64];                        
           GetPlayerName(playerid,file,sizeof(file));
            format(file,sizeof(file),DOF2_File(file));
            DOF2_CreateFile(file, inputtext);    
            DOF2_SetInt (file, "Kills", 0);      
            DOF2_SetInt (file, "Deaths", 0);      
            DOF2_SetInt (file, "AdminLevel", 0);  
            DOF2_SaveFile();            
               }
    }
    case DIALOG_LOGIN: {
        if(!response) Kick(playerid);            
        if(response) {                          
            new file[64];                      
                                                 
            GetPlayerName(playerid,file,sizeof(file));
                                                 
            format(file,sizeof(file),DOF2_File(file));
            if(DOF2_FileExists(file)) {          
                                           
                if(DOF2_CheckLogin(file,inputtext)) {
                                                 
                    PlayerInfo[playerid][pKills] = DOF2_GetInt(file,"Kills");
                    PlayerInfo[playerid][pDeaths] = DOF2_GetInt(file,"Deaths");
                    PlayerInfo[playerid][pAdmin] = DOF2_GetInt(file,"AdminLevel");
                                 
                    return 1;
                }
                else {                          
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Senha Incorreta!","{F81414}Vocк digitou uma senha errada\n{FFFFFF}Digite sua senha aqui para entrar !","Log-in","Quit");
                    return 1;
                }
            }
        }
    }
}



Re: Servidor trava .. DOF2 - Lukinhas_Ice - 19.07.2012

por que ninguйm me responde =/


Re: Servidor trava .. DOF2 - ViniBorn - 19.07.2012

Faзa o debug no cуdigo que nгo estб sendo executado


Re: Servidor trava .. DOF2 - Lukinhas_Ice - 19.07.2012

nгo sei fazer nгo =[


Re: Servidor trava .. DOF2 - [JD]BlackFire - 19.07.2012

pode estar criando um arquivo jб existente ou carregando um inxistente.


Re: Servidor trava .. DOF2 - Lukinhas_Ice - 19.07.2012

Quote:
Originally Posted by [JD]BlackFire
Посмотреть сообщение
pode estar criando um arquivo jб existente ou carregando um inxistente.
nгo =[


Re: Servidor trava .. DOF2 - ViniBorn - 19.07.2012

Espalhe 'printf' pelo cуdigo enumerados, e veja em qual parte eles param de ser exibidos.