[Ajuda] ajuda com salvamento em DOF2
#1

estou tendo problemas para salvar e setar quando o player loga(skin, dinheiro, vida, colete), quando ele loga ele seta vida e colete cheio, e nao seta o que esta no arquvos deles, alguem pfv, se disponibilizaria para me ajudar a encontrar os bugs desse sistema e me ajudaria a retirar(claramente nao quero que vc faзa pra mim, pois estou aprendendo, entгo me aponte erros que posso arrumar e testar!), OBG <3

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    
format(gfilesizeof(gfile), "Contas/%s.txt"Pname(playerid));
    switch(
dialogid) {
        case 
Registro: {
            if(!
response)
            {
                
SendClientMessage(playerid0xFF0000AA"[ ERRO ]Vocк escolheu sair!");
                
Kick(playerid);
            }
            if(!
strlen(inputtext))
            {
                
SendClientMessage(playerid, -1"[ {FFFFFF}ERRO ]Digite uma senha para se registrar!");
                
format(strsizeof(str), "Ola, seja bem vindo pela primeira vez Sr.%s !"Pname(playerid));
                
ShowPlayerDialog(playeridRegistroDIALOG_STYLE_PASSWORD"{FFFFFF}REGISTRO"str"Registro""Cancelar");
            }
            else
            {
                
DOF2_CreateFile(gfile);
                
DOF2_SetString(gfile"Senha"inputtext);
                
DOF2_SetInt(gfile"Skin"pInfo[playerid][pSkin]);
                
DOF2_SetInt(gfile"Dinheiro"pInfo[playerid][pDinheiro]);
                
DOF2_SetFloat(gfile"Vida"pInfo[playerid][pVida]);
                
DOF2_SetFloat(gfile"Colete"pInfo[playerid][pColete]);
                
DOF2_SetInt(gfile"Level"pInfo[playerid][pLevel]);
                
DOF2_SetInt(gfile"Ajudante"pInfo[playerid][Ajudante] = false);
                
DOF2_SetInt(gfile"Moderador"pInfo[playerid][Moderador] = false);
                
DOF2_SetInt(gfile"Corregedor"pInfo[playerid][Corregedor] = false);
                
DOF2_SetInt(gfile"Administrador"pInfo[playerid][Administrador] = false);
                
DOF2_SetInt(gfile"Master"pInfo[playerid][Master] = false);
                
DOF2_SetInt(gfile"Oculto"pInfo[playerid][Oculto] = false);
                
DOF2_SaveFile();
                
SpawnPlayer(playerid);
                
SetPlayerSkin(playerid137);
                
GivePlayerMoney(playerid5000);
                
SetPlayerHealth(playerid100);
                
SetPlayerArmour(playerid100);
            }
        }
        case 
Login: {
            if(!
response)
            {
                
SendClientMessage(playerid0xFF0000AA"[ ERRO ]Vocк escolheu sair!");
                
Kick(playerid);
            }
            if(!
strlen(inputtext))
            {
                
SendClientMessage(playerid, -1"[{FFFFFF}ERRO ] Digite Sua senha para logar no servidor!");
                
format(strsizeof(str), "Ola, seja bem vindo ao servidor novamente!");
                
ShowPlayerDialog(playeridLoginDIALOG_STYLE_PASSWORD"{FFFFFF}LOGIN"str"Login""Cancelar");
            }
            if(
strcmp(inputtextDOF2_GetString(gfile"Senha")) == 0)
            {
                
pInfo[playerid][pLevel] = GetPlayerScore(playerid);
                
pInfo[playerid][pDinheiro] = GetPlayerMoney(playerid);
                
pInfo[playerid][pSkin] = DOF2_GetInt(gfile"Skin");
                
pInfo[playerid][pVida] = DOF2_GetFloat(gfile"Vida");
                
pInfo[playerid][pColete] = DOF2_GetFloat(gfile"Colete");
                
pInfo[playerid][pDinheiro] = DOF2_GetInt(gfile"Dinheiro");
                
pInfo[playerid][Ajudante] = DOF2_GetBool(gfile"Ajudante");
                
pInfo[playerid][Moderador] = DOF2_GetBool(gfile"Moderador");
                
pInfo[playerid][Corregedor] = DOF2_GetBool(gfile"Corregedor");
                
pInfo[playerid][Administrador] = DOF2_GetBool(gfile"Administrador");
                
pInfo[playerid][Master] = DOF2_GetBool(gfile"Master");
                
pInfo[playerid][Oculto] = DOF2_GetBool(gfile"Oculto");
                
pInfo[playerid][pVida] = DOF2_GetFloat(gfile"Vida");
                
SpawnPlayer(playerid);
                
SendClientMessage(playerid, -1"{FFFFFF}Login efeituado com sucesso!");
                
SetPlayerHealth(playeridpInfo[playerid][pVida]);
                
SetPlayerArmour(playeridpInfo[playerid][pColete]);
                
GivePlayerMoney(playeridpInfo[playerid][pDinheiro]);
                
SetPlayerSkin(playeridpInfo[playerid][pSkin]);
            }
            else
            {
                
format(strsizeof(str), "Ola, seja bem vindo ao servidor novamente!");
                
ShowPlayerDialog(playeridLoginDIALOG_STYLE_PASSWORD"{FFFFFF}LOGIN"str"Login""Cancelar");
            }
        }
    }
    return 
1;

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
string[64], Float:healthFloat:armour;
    
format(stringsizeof(string), "»O player %s se desconectou ao servidor!"Pname(playerid));
    
SendClientMessageToAll(-1string);
    
format(gfilesizeof(gfile), "Contas/%s.txt"Pname(playerid));
    if(
DOF2_FileExists(gfile))
    {
        
GetPlayerHealth(playeridhealth);
        
GetPlayerArmour(playeridarmour);
        
DOF2_SetInt(gfile"Dinheiro"GetPlayerMoney(playerid));
        
DOF2_SetFloat(gfile"Vida"health);
        
DOF2_SetFloat(gfile"Colete"armour);
        
DOF2_SetInt(gfile"Skin"GetPlayerSkin(playerid));
        
DOF2_SetInt(gfile"Level"GetPlayerScore(playerid));
        
DOF2_SetBool(gfile"Ajudante"pInfo[playerid][Ajudante]);
        
DOF2_SetBool(gfile"Moderador"pInfo[playerid][Moderador]);
        
DOF2_SetBool(gfile"Corregedor"pInfo[playerid][Corregedor]);
        
DOF2_SetBool(gfile"Administrador"pInfo[playerid][Administrador]);
        
DOF2_SetBool(gfile"Master"pInfo[playerid][Master]);
        
DOF2_SetBool(gfile"Oculto"pInfo[playerid][Oculto]);
        
DOF2_SetInt(gfile"Skin"GetPlayerSkin(playerid));
        
DOF2_SaveFile();
    }
    return 
1;

PHP код:
enum PlayerInfo {
    
pDinheiro,
    
pLevel,
    
Float:pVida,
    
Float:pColete,
    
pSkin,
    
pProfissao,
    
bool:Ajudante,
    
bool:Moderador,
    
bool:Corregedor,
    
bool:Administrador,
    
bool:Master,
    
bool:Oculto
};
new 
pInfo[MAX_PLAYERS][PlayerInfo]; 
Reply


Messages In This Thread
ajuda com salvamento em DOF2 - by vitinhosamp - 26.07.2018, 02:52
Re: ajuda com salvamento em DOF2 - by vitinhosamp - 26.07.2018, 06:04
Re: ajuda com salvamento em DOF2 - by ipsLuan - 26.07.2018, 11:16
Re: ajuda com salvamento em DOF2 - by vitinhosamp - 26.07.2018, 18:43
Re: ajuda com salvamento em DOF2 - by AutoMatic2 - 26.07.2018, 19:15
Re: ajuda com salvamento em DOF2 - by vitinhosamp - 26.07.2018, 23:32
Re: ajuda com salvamento em DOF2 - by Cleyson - 27.07.2018, 00:03
Re: ajuda com salvamento em DOF2 - by vitinhosamp - 27.07.2018, 00:07
Re: ajuda com salvamento em DOF2 - by ipsLuan - 27.07.2018, 00:31
Re: ajuda com salvamento em DOF2 - by vitinhosamp - 27.07.2018, 00:44

Forum Jump:


Users browsing this thread: 3 Guest(s)