[Ajuda] erro estranho
#10

Entao, vou mandar aqui meu sistema e mostro pra vcs uma soluзгo melhor:

PHP код:
enum PlayerInfo {
    
pDinheiro,
    
pLevel,
    
Float:pVida,
    
Float:pColete,
    
pSkin,
    
pProfissao,
    
pProcurado,
    
bool:Ajudante,
    
bool:Moderador,
    
bool:Corregedor,
    
bool:Administrador,
    
bool:Master,
    
bool:Oculto
};
new 
pInfo[MAX_PLAYERS][PlayerInfo]; 
PHP код:
#define Registro                                                                1
#define Login                                                                   2
#define DIALOG_BAN                                                              3
#define PM_P                                                                    4
#define DESEMPREGADO                                                            5 
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))
    {
        
pInfo[playerid][pVida] = GetPlayerHealth(playeridarmour);
        
pInfo[playerid][pColete] = GetPlayerArmour(playeridhealth);
        
pInfo[playerid][pDinheiro] = GetPlayerMoney(playerid);
        
pInfo[playerid][pSkin] = GetPlayerSkin(playerid);
        
pInfo[playerid][pLevel] = GetPlayerScore(playerid);
        
pInfo[playerid][pProcurado] = GetPlayerWantedLevel(playerid);
        
DOF2_SetFloat(gfile"Vida"pInfo[playerid][pVida]);
        
DOF2_SetFloat(gfile"Colete"pInfo[playerid][pColete]);
        
DOF2_SetInt(gfile"Level"pInfo[playerid][pLevel]);
        
DOF2_SetInt(gfile"Skin"pInfo[playerid][pSkin]);
        
DOF2_SetInt(gfile"Procurado"pInfo[playerid][pProcurado]);
        
DOF2_SetInt(gfile"Profissao"pInfo[playerid][pProfissao]);
        
DOF2_SetInt(gfile"Dinheiro"pInfo[playerid][pDinheiro]);
        
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_SaveFile();
    } 
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) < || strlen(inputtext) > 20 || !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_SetFloat(gfile"Vida"100.00000000);
                
DOF2_SetFloat(gfile"Colete"100.00000000);
                
DOF2_SetInt(gfile"Skin"137);
                
DOF2_SetInt(gfile"Dinheiro"0);
                
DOF2_SetInt(gfile"Procurado"0);
                
DOF2_SetInt(gfile"Profissao"DESEMPREGADO);
                
DOF2_SetBool(gfile"Ajudante"false);
                
DOF2_SetBool(gfile"Moderador"false);
                
DOF2_SetBool(gfile"Corregedor"false);
                
DOF2_SetBool(gfile"Administrador"false);
                
DOF2_SetBool(gfile"Master"false);
                
DOF2_SetBool(gfile"Oculto"false);
                
DOF2_SaveFile();
                
GivePlayerMoney(playerid5000);
                
SpawnPlayer(playerid);
            }
        }
        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][pProcurado] = DOF2_GetInt(gfile"Procurado");
                
pInfo[playerid][pVida] = DOF2_GetFloat(gfile"Vida");
                
pInfo[playerid][pColete] = DOF2_GetFloat(gfile"Colete");
                
pInfo[playerid][pSkin] = DOF2_GetInt(gfile"Skin");
                
pInfo[playerid][pLevel] = DOF2_GetInt(gfile"Level");
                
pInfo[playerid][pProfissao] = DOF2_GetInt(gfile"Profissao");
                
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");
                
SendClientMessage(playerid, -1"{FFFFFF}Login efeituado com sucesso!");
                
SpawnPlayer(playerid);
                
SetPlayerSkin(playeridDOF2_GetInt(gfile"Skin"));
            }
            else
            {
                
format(strsizeof(str), "Ola, seja bem vindo ao servidor novamente!");
                
ShowPlayerDialog(playeridLoginDIALOG_STYLE_PASSWORD"{FFFFFF}LOGIN"str"Login""Cancelar");
            }
        }
    }
    return 
1;

me ajudem, ele ta setando a prof como 0!
Reply


Messages In This Thread
erro estranho - by vitinhosamp - 28.07.2018, 20:40
Re: erro estranho - by humildadeforever - 28.07.2018, 20:42
Re: erro estranho - by vitinhosamp - 28.07.2018, 21:08
Re: erro estranho - by humildadeforever - 28.07.2018, 21:15
Re: erro estranho - by AdrianoStk - 28.07.2018, 21:16
Re: erro estranho - by Santso - 28.07.2018, 21:20
Re: erro estranho - by humildadeforever - 28.07.2018, 21:34
Re: erro estranho - by AutoMatic2 - 28.07.2018, 21:46
Re: erro estranho - by AdrianoStk - 28.07.2018, 21:57
Re: erro estranho - by vitinhosamp - 29.07.2018, 03:10

Forum Jump:


Users browsing this thread: 1 Guest(s)