[Ajuda] Dof2 Com Problema '-'
#1

Toda Hora Que Fecho o Samp-Server Ou dou GMX LA , Reseta Tudo '-'
Olha Meu Codigo
PHP код:
//------Topo DO gm-------//
enum Info
{
    
Matou,
    
Morreu,
    
Score,
    
pAdmin,
};
new 
pInfo[MAX_PLAYERS][Info];
//------Quando o Player Registra !-------//
            
GetPlayerName(playeridNomesizeof(Nome));
            
format(Stringsizeof(String), CONTASNome);
            
DOF2::CreateFile(String);
            
DOF2::SetString(String,"Senha"inputtext);
            
DOF2::SetInt(String,"Dinheiro"DinheiroInicio);
                    
DOF2::SetInt(String"Matou"pInfo[playerid][Matou]);
            
DOF2::SetInt(String"Morreu"pInfo[playerid][Morreu]);
                    
DOF2::SetInt(String"Score"GetPlayerScore(playerid));
                    
DOF2::SetInt(String"Admin"pInfo[playerid][pAdmin]);
            
DOF2::SaveFile();
//------Funзao Para Salvar o Player---------//
stock SalvarPlayer(playerid)
{
    
GetPlayerName(playeridNomesizeof(Nome));
    
format(Stringsizeof(String), CONTASNome);
    
DOF2::SetInt(String,"Dinheiro"GetPlayerMoney(playerid));
        
DOF2::SetInt(String"Matou"pInfo[playerid][Matou]);
        
DOF2::SetInt(String"Morreu"pInfo[playerid][Morreu]);
    
DOF2::SetInt(String"Score"GetPlayerScore(playerid));
        
DOF2::SetInt(String"Admin"pInfo[playerid][pAdmin]);
    
DOF2::SaveFile();
    return 
true;
}
//----Funзao Para Carregar o Player-----//
stock CarregarPlayer(playerid)
{
    
GetPlayerName(playeridNomesizeof(Nome));
    
format(Stringsizeof(String), CONTASNome);
    
GivePlayerMoney(playeridDOF2::GetInt(String,"Dinheiro"));
        
pInfo[playerid][Matou] = DOF2::GetInt(String"Matou");
        
pInfo[playerid][Morreu] = DOF2::GetInt(String"Morreu");
    
SetPlayerScore(playeridDOF2::GetInt(String,"Score"));
        
pInfo[playerid][pAdmin] = DOF2::GetInt(String,"Admin");
    
DOF2::SaveFile();
    return 
true;

Reply
#2

Tenta usando isso em GameModeExit, acho que pode resolver
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) SalvarPlayer(i);
DOF2_Exit();
Reply
#3

ja estou usando
PHP код:
public OnGameModeExit()
{
    for(new 
0MAX_PLAYERSi++) SalvarPlayer(i);
    
DOF2_Exit();
    return 
1;

Reply
#4

PHP код:
public OnGameModeExit()
{
    for(new 
0MAX_PLAYERSi++) 
    {
        if(
IsPlayerConnected(i))
        {
            
SalvarPlayer(i);
        }
    }
    
DOF2_Exit();
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)