SA-MP Forums Archive
[Ajuda] Error estranho - 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] Error estranho (/showthread.php?tid=656006)



Error estranho - BrGabrielBr - 05.07.2018

@@CLOSED.


Re: Error estranho - Cauezin - 05.07.2018

Manda o SavePlayer(playerid);


Re: Error estranho - BrGabrielBr - 05.07.2018

Quote:
Originally Posted by Cauezin
Посмотреть сообщение
Manda o SavePlayer(playerid);
PHP код:
SavePlayer(playerid)
{
    if( 
DOF2_FileExists(PegarConta(playerid)))
    {
        
DOF2_CreateFile(PegarConta(playerid));
        
DOF2_SetInt(PegarConta(playerid), "Skin"Player[playerid][Skin]);
        
DOF2_SetInt(PegarConta(playerid), "Score"Player[playerid][Score]);
        
DOF2_SetInt(PegarConta(playerid), "Matou"Player[playerid][Matou]);
        
DOF2_SetInt(PegarConta(playerid), "Morreu"Player[playerid][Morreu]);
        
DOF2_SetInt(PegarConta(playerid), "Faccoes"Player[playerid][Faccoes]);
        
DOF2_SetInt(PegarConta(playerid), "Morro"Player[playerid][Morro]);
        
DOF2_SetInt(PegarConta(playerid), "Cargo"Player[playerid][Cargo]);
        
DOF2_SetInt(PegarConta(playerid), "Dinheiro"GetPlayerMoney(playerid));
        
DOF2_SetInt(PegarConta(playerid), "Admin"Player[playerid][Admin]);
        
DOF2_SaveFile();
    }
    return 
1;




Re: Error estranho - bruxo00 - 05.07.2018

Й porque estб a usar a funзгo SavePlayer em algum lugar antes da conta ser carregada.


Re: Error estranho - BrGabrielBr - 05.07.2018

Quote:
Originally Posted by bruxo00
Посмотреть сообщение
Й porque estб a usar a funзгo SavePlayer em algum lugar antes da conta ser carregada.
Uso ela aqui
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
TextDrawHideForPlayer(playeridDataC), TextDrawHideForPlayer(playeridHoraC);
    
//
    
SavePlayer(playerid);
    return 
1;

sу ae mano



Re: Error estranho - AutoMatic2 - 05.07.2018

n sei se vai da certo mais coloca na OnGameModeExit:

PHP код:
for(new 0MAX_PLAYERSi++)
{
    
SalvarPlayer(i);

tenta assim:

PHP код:
SavePlayer(playerid

    if( 
DOF2_FileExists(PegarConta(playerid))) 
    { 
        
DOF2_SetInt(PegarConta(playerid), "Skin"Player[playerid][Skin]); 
        
DOF2_SetInt(PegarConta(playerid), "Score"Player[playerid][Score]); 
        
DOF2_SetInt(PegarConta(playerid), "Matou"Player[playerid][Matou]); 
        
DOF2_SetInt(PegarConta(playerid), "Morreu"Player[playerid][Morreu]); 
        
DOF2_SetInt(PegarConta(playerid), "Faccoes"Player[playerid][Faccoes]); 
        
DOF2_SetInt(PegarConta(playerid), "Morro"Player[playerid][Morro]); 
        
DOF2_SetInt(PegarConta(playerid), "Cargo"Player[playerid][Cargo]); 
        
DOF2_SetInt(PegarConta(playerid), "Dinheiro"GetPlayerMoney(playerid)); 
        
DOF2_SetInt(PegarConta(playerid), "Admin"Player[playerid][Admin]); 
        
DOF2_SaveFile(); 
    } 
    return 
1




Re: Error estranho - BrGabrielBr - 05.07.2018

Quote:
Originally Posted by AutoMatic2
Посмотреть сообщение
n sei se vai da certo mais coloca na OnGameModeExit:

PHP код:
for(new 0MAX_PLAYERSi++)
{
    
SalvarPlayer(i);

tenta assim:

PHP код:
SavePlayer(playerid

    if( 
DOF2_FileExists(PegarConta(playerid))) 
    { 
        
DOF2_SetInt(PegarConta(playerid), "Skin"Player[playerid][Skin]); 
        
DOF2_SetInt(PegarConta(playerid), "Score"Player[playerid][Score]); 
        
DOF2_SetInt(PegarConta(playerid), "Matou"Player[playerid][Matou]); 
        
DOF2_SetInt(PegarConta(playerid), "Morreu"Player[playerid][Morreu]); 
        
DOF2_SetInt(PegarConta(playerid), "Faccoes"Player[playerid][Faccoes]); 
        
DOF2_SetInt(PegarConta(playerid), "Morro"Player[playerid][Morro]); 
        
DOF2_SetInt(PegarConta(playerid), "Cargo"Player[playerid][Cargo]); 
        
DOF2_SetInt(PegarConta(playerid), "Dinheiro"GetPlayerMoney(playerid)); 
        
DOF2_SetInt(PegarConta(playerid), "Admin"Player[playerid][Admin]); 
        
DOF2_SaveFile(); 
    } 
    return 
1

Nгo deu certo


Re: Error estranho - AutoMatic2 - 05.07.2018

Vк se o seu:

LoadPlayer(playerid);

se ta +/- assim:

PHP код:
Player[playerid][Admin] = DOF2::GetInt(PegarContas(playerid), "Admin"); 
tbm coloca uma save file aki:

PHP код:
if(dialogid == DIALOG_REGISTER
    { 
        if(
response
        { 
            if(
strlen(inputtext) < || strlen(inputtext) > 20 || !strlen(inputtext)) 
            { 
                
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""COLORT_WHITE"• "#COLORT_SERVER"REGISTRO"COLORT_WHITE":", ""#COLORT_WHITE"Sua senha deve ter no minimo 5 digitos ou nъmeros!\n"#COLORT_WHITE"Й no Mбximo 20 digitos ou nъmero!\n"#COLORT_WHITE"Tente novamente.", "Registrar", "Sair"); 
            

            else 
            { 
                
//---------- [ Criar Arquivos й colocar valores ] -------------- 
                
DOF2_CreateFile(PegarConta(playerid)); 
                
DOF2_SetString(PegarConta(playerid),"Senha"inputtext); 
                
DOF2_SetInt(PegarConta(playerid),"Score"0); 
                
DOF2_SetInt(PegarConta(playerid),"Matou"0); 
                
DOF2_SetInt(PegarConta(playerid),"Morreu"0); 
                
DOF2_SetInt(PegarConta(playerid),"Skin"1); 
                
DOF2_SetInt(PegarConta(playerid),"Dinheiro"0); 
                
DOF2_SetInt(PegarConta(playerid), "Admin"0); 
                
DOF2_SaveFile();
                
// 
                
GivePlayerMoney(playerid,30000); 
                
SCM(playeridCOLOR_PRINCIPAL""TAG_SERVER" Registrado Com sucesso."); 
                
ShowPlayerDialog(playeridDIALOG_MORROSDIALOG_STYLE_LIST""COLORT_WHITE"» "COLORT_SERVER"Escolha sua comunidade para poder continuar:"""#COLORT_RED"CMD\n"#COLORT_BLUE"LLL\n"#COLORT_YELLOW"TD3\n"#COLORT_ORANGE"MLC\n"#COLORT_WHITE"Organizaзхes", "Selecionar", ""); 
            

        } 
        if(!
response
        { 
            
SCM(playeridCOLOR_HELPER""TAG_LOG" Vocк foi kickado, volte sempre!"); 
            
Kick(playerid); 
        } 
    } 



Re: Error estranho - BrGabrielBr - 05.07.2018

Quote:
Originally Posted by AutoMatic2
Посмотреть сообщение
Vк se o seu:

LoadPlayer(playerid);

se ta +/- assim:

PHP код:
Player[playerid][Admin] = DOF2::GetInt(PegarContas(playerid), "Admin"); 
tbm coloca uma save file aki:

PHP код:
if(dialogid == DIALOG_REGISTER
    { 
        if(
response
        { 
            if(
strlen(inputtext) < || strlen(inputtext) > 20 || !strlen(inputtext)) 
            { 
                
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""COLORT_WHITE"• "#COLORT_SERVER"REGISTRO"COLORT_WHITE":", ""#COLORT_WHITE"Sua senha deve ter no minimo 5 digitos ou nъmeros!\n"#COLORT_WHITE"Й no Mбximo 20 digitos ou nъmero!\n"#COLORT_WHITE"Tente novamente.", "Registrar", "Sair"); 
            

            else 
            { 
                
//---------- [ Criar Arquivos й colocar valores ] -------------- 
                
DOF2_CreateFile(PegarConta(playerid)); 
                
DOF2_SetString(PegarConta(playerid),"Senha"inputtext); 
                
DOF2_SetInt(PegarConta(playerid),"Score"0); 
                
DOF2_SetInt(PegarConta(playerid),"Matou"0); 
                
DOF2_SetInt(PegarConta(playerid),"Morreu"0); 
                
DOF2_SetInt(PegarConta(playerid),"Skin"1); 
                
DOF2_SetInt(PegarConta(playerid),"Dinheiro"0); 
                
DOF2_SetInt(PegarConta(playerid), "Admin"0); 
                
DOF2_SaveFile();
                
// 
                
GivePlayerMoney(playerid,30000); 
                
SCM(playeridCOLOR_PRINCIPAL""TAG_SERVER" Registrado Com sucesso."); 
                
ShowPlayerDialog(playeridDIALOG_MORROSDIALOG_STYLE_LIST""COLORT_WHITE"» "COLORT_SERVER"Escolha sua comunidade para poder continuar:"""#COLORT_RED"CMD\n"#COLORT_BLUE"LLL\n"#COLORT_YELLOW"TD3\n"#COLORT_ORANGE"MLC\n"#COLORT_WHITE"Organizaзхes", "Selecionar", ""); 
            

        } 
        if(!
response
        { 
            
SCM(playeridCOLOR_HELPER""TAG_LOG" Vocк foi kickado, volte sempre!"); 
            
Kick(playerid); 
        } 
    } 
Load estб assim amigгo
PHP код:
LoadPlayer(playerid)
{
    if( 
DOF2_FileExists(PegarConta(playerid)))
    {
        
DOF2_SetInt(PegarConta(playerid), "Senha"Player[playerid][Senha]);
        
DOF2_SetInt(PegarConta(playerid), "Skin"Player[playerid][Skin]);
        
DOF2_SetInt(PegarConta(playerid), "Score"Player[playerid][Score]);
        
DOF2_SetInt(PegarConta(playerid), "Dinheiro"Player[playerid][Dinheiro]);
        
DOF2_SetInt(PegarConta(playerid), "Admin"Player[playerid][Admin]);
        
DOF2_SetInt(PegarConta(playerid), "Faccoes"Player[playerid][Faccoes]);
        
DOF2_SetInt(PegarConta(playerid), "Morro"Player[playerid][Morro]);
        
DOF2_SetInt(PegarConta(playerid), "Cargo"Player[playerid][Cargo]);
        
DOF2_SetInt(PegarConta(playerid), "Morreu"Player[playerid][Matou]);
        
DOF2_SetInt(PegarConta(playerid), "Morreu"Player[playerid][Morreu]);
        
//
        
SetPlayerScore(playeridPlayer[playerid][Score]);
        
GivePlayerMoney(playeridPlayer[playerid] [Dinheiro]);
        
SetPlayerSkin(playeridPlayer[playerid][Skin]);
    }
    return 
1;




Re: Error estranho - AutoMatic2 - 05.07.2018

Sua load ta igual a salvar

load fica assim:

PHP код:
Player[playerid][Faccoes] = DOF2::GetInt(PegarConta(playerid), "Faccoes"); 
PHP код:
Player[playerid][Score] = DOF2::GetInt(PegarConta(playerid), "Score"); 
e vai..