SA-MP Forums Archive
[Ajuda] Warning em salvamento 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] Warning em salvamento DOF2 (/showthread.php?tid=593560)



Warning em salvamento DOF2 - zPawnu - 07.11.2015

/eae galera to fazendo um sistema de salvamento de dados poderiam me ajudar com esses warnings ?

PHP Code:
C:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2702) : warning 217: loose indentation
C
:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2878) : warning 204: symbol is assigned a value that is never used: "Balas"
C:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2878) : warning 204: symbol is assigned a value that is never used: "Arma"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
3 Warnings
. 
linhas

ґ
PHP Code:
    new file[155], aname[MAX_PLAYER_NAME], Arma[13], Balas[13], string[155];
    
GetPlayerName(playerid, aname, sizeof(aname));
    
format(file, sizeof(file), "Contas/%.ini", aname);
    if(
DOF2_FileExists(file))
    {
    
DOF2_SetFloat(file, "Vida", pInfo[playerid][vida]);
    for(new 
i= 0; i < 13; i++)
    {
        
format(string, sizeof(string), "Arma%d", i);
        
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]);
        
format(string, sizeof(string), "Balas%d", i);
        
DOF2_SetInt(file, string, Balas[i]);
      }
      
DOF2_SaveFile();
    } 



Re: Warning em salvamento DOF2 - garotin - 07.11.2015

Isso estб meio confuso
PHP Code:
format(string, sizeof(string), "Arma%d", i); // Nгo entendi o sentido disso.
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]); 
format(string, sizeof(string), "Balas%d", i); 
DOF2_SetInt(file, string, Balas[i]); 
Acho que o correto seria
PHP Code:
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]); 
format(string, sizeof(string), "Arma%d", i);
DOF2_SetInt(file, string, Arma[i]);
format(string, sizeof(string), "Balas%d", i); 
DOF2_SetInt(file, string, Balas[i]); 
Duvidas me avise.


Re: Warning em salvamento DOF2 - zPawnu - 07.11.2015

Quote:
Originally Posted by garotin
View Post
Isso estб meio confuso
PHP Code:
format(string, sizeof(string), "Arma%d", i); // Nгo entendi o sentido disso.
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]); 
format(string, sizeof(string), "Balas%d", i); 
DOF2_SetInt(file, string, Balas[i]); 
Acho que o correto seria
PHP Code:
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]); 
format(string, sizeof(string), "Arma%d", i);
DOF2_SetInt(file, string, Arma[i]);
format(string, sizeof(string), "Balas%d", i); 
DOF2_SetInt(file, string, Balas[i]); 
Duvidas me avise.
PHP Code:
C:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2878) : warning 204: symbol is assigned a value that is never used: "Balas"
C:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2878) : warning 204: symbol is assigned a value that is never used: "Arma"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings
. 
toda minha linha
PHP Code:
public OnPlayerDisconnect(playerid, reason)  
{
    
//========= salvamento de vida // armas
    
new file[155], aname[MAX_PLAYER_NAME], Arma[13], Balas[13], string[155];
    
GetPlayerName(playerid, aname, sizeof(aname));
    
format(file, sizeof(file), "Contas/%.ini", aname);
    if(
DOF2_FileExists(file))
    {
    
DOF2_SetFloat(file, "Vida", pInfo[playerid][vida]);
    for(new 
i= 0; i < 13; i++)
    {
        
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]);
        
format(string, sizeof(string), "Arma%d", i);
        
DOF2_SetInt(file, string, Arma[i]);
        
format(string, sizeof(string), "Balas%d", i);
        
DOF2_SetInt(file, string, Balas[i]);
      }
      
DOF2_SaveFile();
    }
        return 
1;
} 



Re: Warning em salvamento DOF2 - zPawnu - 07.11.2015

ALG AJUDA ! porfavor


Re: Warning em salvamento DOF2 - PT - 07.11.2015

tente

PHP Code:
public OnPlayerDisconnect(playerid, reason)
{
    new 
file[50], aname[MAX_PLAYER_NAME]; 
    
GetPlayerName(playerid, aname, sizeof(aname)); 
    
format(file, sizeof(file), "Contas/%.ini", aname); 

    if(
DOF2_FileExists(file)) 
    { 
        
DOF2_SetFloat(file, "Vida", pInfo[playerid][vida]); 
        
        new 
Arma[13], Balas[13], sArma[20], sBalas[20];
        for(new 
i = 0; i < 13; i++)
        {
            
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]);
            
            
format(sArma, sizeof(sArma),"Arma%d", i);
            
DOF2_SetInt(file, sArma, Arma[i]);
            
            
format(sBalas, sizeof(sBalas),"Balas%d", i);
            
DOF2_SetInt(file, sBalas, Balas[i]);
        }
        
DOF2_SaveFile(); 
    }
    return 
1;
} 



Re: Warning em salvamento DOF2 - zPawnu - 07.11.2015

Quote:
Originally Posted by PT
View Post
tente

PHP Code:
public OnPlayerDisconnect(playerid, reason)
{
    new 
file[50], aname[MAX_PLAYER_NAME]; 
    
GetPlayerName(playerid, aname, sizeof(aname)); 
    
format(file, sizeof(file), "Contas/%.ini", aname); 
    if(
DOF2_FileExists(file)) 
    { 
        
DOF2_SetFloat(file, "Vida", pInfo[playerid][vida]); 
        
        new 
Arma[13], Balas[13], sArma[20], sBalas[20];
        for(new 
i = 0; i < 13; i++)
        {
            
GetPlayerWeaponData(playerid, i, Arma[i], Balas[i]);
            
            
format(sArma, sizeof(sArma),"Arma%d", i);
            
DOF2_SetInt(file, sArma, Arma[i]);
            
            
format(sBalas, sizeof(sBalas),"Balas%d", i);
            
DOF2_SetInt(file, sBalas, Balas[i]);
        }
        
DOF2_SaveFile(); 
    }
    return 
1;
} 
PHP Code:
C:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2851) : warning 204: symbol is assigned a value that is never used: "Balas"
C:\Users\Jefferson\Desktop\ProjectDayz\gamemodes\GM.pwn(2851) : warning 204: symbol is assigned a value that is never used: "Arma"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
1 Error
. 



Re: Warning em salvamento DOF2 - [BOPE]Seu._.Madruga - 07.11.2015

Eu que fiz este cуdigo na minha vнdeo aula, porйm o cуdigo nгo й dessa forma que vocк publicou, Como o membro acima disse nгo tem sentido o cуdigo que vocк implementou!


Re: Warning em salvamento DOF2 - zPawnu - 11.11.2015

Quote:
Originally Posted by [BOPE]Seu._.Madruga
View Post
Eu que fiz este cуdigo na minha vнdeo aula, porйm o cуdigo nгo й dessa forma que vocк publicou, Como o membro acima disse nгo tem sentido o cуdigo que vocк implementou!
ss eu vi teu tutorial