[Ajuda] Warning em salvamento DOF2
#1

/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();
    } 
Reply
#2

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.
Reply
#3

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;
} 
Reply
#4

ALG AJUDA ! porfavor
Reply
#5

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;
} 
Reply
#6

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
. 
Reply
#7

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!
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)