[Ajuda] Conta registrada
#1

Bom dia,

Eu nгo sei o que pode ter ocorrido em meu gamemode, mas vamos lб, eu primeiramente adicionei um sistema de payday, funcionou que foi uma uva, tudo muito lindo, muito interessante, porйm, eu fui criar uma nova conta no servidor para ver se nгo estava bugada, e bom, estava, porйm, antes de adicionar esse sistema, estava funcionando normalmente, daн reverti tudo que fiz e pronto, continuou o mesmo problema, ao logar diz que a conta jб estб registrada e buga tudo, eu logo com qualquer senha nessa conta e nгo seta as configuraзхes iniciais.
Nгo faзo a menor ideia do que pode ter ocorrido.
pawn Код:
stock CriarConta(playerid)
{
    DOF2_CreateFile(Player[playerid][PastaConta]);
    DOF2_SetString(Player[playerid][PastaConta], "Senha", Player[playerid][SenhaDigitada]);
    DOF2_SetInt(Player[playerid][PastaConta], "Dinheiro", 250000);
    DOF2_SetInt(Player[playerid][PastaConta], "Level", 1);
    DOF2_SetInt(Player[playerid][PastaConta], "Vip", 0);
    DOF2_SetInt(Player[playerid][PastaConta], "Admin", 0);
    DOF2_SetFloat(Player[playerid][PastaConta], "Vida", 100.0);
    DOF2_SetFloat(Player[playerid][PastaConta], "Colete", 0.0);
    DOF2_SetInt(Player[playerid][PastaConta], "Sexo", Player[playerid][Sexo]);
    DOF2_SetInt(Player[playerid][PastaConta], "Skin", Player[playerid][Skin]);
    //DOF2_SetInt(Player[playerid][PastaConta], "Horas", Player[playerid][ConnectTime]);
    DOF2_SetInt(Player[playerid][PastaConta], "Matou", Player[playerid][MatouKD]);
    DOF2_SetInt(Player[playerid][PastaConta], "Morreu", Player[playerid][MorreuKD]);
    DOF2_SetInt(Player[playerid][PastaConta], "Profissao", Player[playerid][Profissao]);
    DOF2_SaveFile();

    Player[playerid][pLogado] = 1;

    TogglePlayerSpectating(playerid, false);
    CancelSelectTextDraw(playerid);
    SpawnPlayer(playerid);
    Player[playerid][Dinheiro]+=250000;
    Player[playerid][Level]+=1;
    //Player[playerid][ConnectTime]+=1;
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerSkin(playerid, Player[playerid][Skin]);
    SetPlayerPos(playerid, 1219.0356, -1428.0033, 13.3762);
    SetPlayerFacingAngle(playerid, 358.5789);
    SetCameraBehindPlayer(playerid);
    return 1;
}

stock CarregarConta(playerid)
{
    new string2[128];
    Player[playerid][Dinheiro] = DOF2_GetInt(Player[playerid][PastaConta], "Dinheiro");
    Player[playerid][Level] = DOF2_GetInt(Player[playerid][PastaConta], "Level");
    Player[playerid][Vip] = DOF2_GetInt(Player[playerid][PastaConta], "Vip");
    Player[playerid][Admin] = DOF2_GetInt(Player[playerid][PastaConta], "Admin");
    Player[playerid][Vida] = DOF2_GetFloat(Player[playerid][PastaConta], "Vida");
    Player[playerid][Colete] = DOF2_GetFloat(Player[playerid][PastaConta], "Colete");
    Player[playerid][Sexo] = DOF2_GetInt(Player[playerid][PastaConta], "Sexo");
    Player[playerid][Skin] = DOF2_GetInt(Player[playerid][PastaConta], "Skin");
//  Player[playerid][ConnectTime] = DOF2_GetInt(Player[playerid][PastaConta], "Horas");
    Player[playerid][MatouKD] = DOF2_GetInt(Player[playerid][PastaConta], "Matou");
    Player[playerid][MorreuKD] = DOF2_GetInt(Player[playerid][PastaConta], "Morreu");
    Player[playerid][Profissao] = DOF2_GetInt(Player[playerid][PastaConta], "Profissao");
    SetPVarInt(playerid, "WarnningAimbot", DOF2_GetInt(string2, "AimBot"));
    SetPVarInt(playerid, "WarnningMacro", DOF2_GetInt(string2, "AutoCbug"));

    Player[playerid][pLogado] = 1;

    TogglePlayerSpectating(playerid, false);
    CancelSelectTextDraw(playerid);
    SpawnPlayer(playerid);
    GivePlayerMoney(playerid, Player[playerid][Dinheiro]);
    SetPlayerScore(playerid, Player[playerid][Level]);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerPos(playerid, 1219.0356, -1428.0033, 13.3762);
    SetPlayerFacingAngle(playerid, 358.5789);
    SetPlayerHealth(playerid, Player[playerid][Vida]);
    SetPlayerArmour(playerid, Player[playerid][Colete]);
    SetPlayerSkin(playerid, Player[playerid][Skin]);
    SetCameraBehindPlayer(playerid);

    if(Player[playerid][Admin] == 1) { aRank = "Temporбrio"; }
    else if(Player[playerid][Admin] == 2) { aRank = "Administrador level 2"; }
    else if(Player[playerid][Admin] == 3) { aRank = "Administrador level 3"; }
    else if(Player[playerid][Admin] == 4) { aRank = "Administrador level 4"; }
    else if(Player[playerid][Admin] == 5) { aRank = "Administrador level 5"; }
    else if(Player[playerid][Admin] == 1337) { aRank = "Administrador Master"; }
    else if(Player[playerid][Admin] == 1338) { aRank = "Administrador responsavel pelos Lideres"; }
    else if(Player[playerid][Admin] == 1339) { aRank = "Administrador responsavel pelos Helpers"; }
    else if(Player[playerid][Admin] == 1340) { aRank = "Gerente"; }
    else if(Player[playerid][Admin] == 3000) { aRank = "Sub dono"; }
    else if(Player[playerid][Admin] == 5000) { aRank = "Dono"; }

    if(Player[playerid][Vip] == 0) { vRank = "FREE"; }
    else if(Player[playerid][Vip] == 1) { vRank = "VIP"; }
    else if(Player[playerid][Vip] == 2) { vRank = "SUPER-VIP"; }
    else if(Player[playerid][Vip] == 3) { vRank = "VIP SУCIO"; }

    if (Player[playerid][Vip] >= 0)
        {
            new string[MAX_STRING];
            format(string, sizeof(string), "Bem vindo ao Brasil PlayPerfect.");
            SendClientMessage(playerid, COLOR_GRAD2, string);
            format(string, sizeof(string), "Vocк logou como um player %s.", vRank);
            SendClientMessage(playerid, COLOR_GRAD2, string);
        }

    if(Player[playerid][Admin] >= 1)
    {
        AdminTrabalhando[playerid] = 1;
        new string[MAX_STRING];
        format(string, sizeof(string), "Vocк logou como administrador %s em modo trabalho. /jogar para sair.", aRank);
        SendClientMessage(playerid, COLOR_GRAD2, string);
    }
    return 1;
}


stock SalvarConta(playerid)
{


    //Save
    if(DOF2_FileExists(Player[playerid][PastaConta]))
    {
        new string3[128];
        Player[playerid][Dinheiro] = GetPlayerMoney(playerid);
        GetPlayerHealth(playerid, Player[playerid][Vida]);
        GetPlayerArmour(playerid, Player[playerid][Colete]);
        Player[playerid][Skin] = GetPlayerSkin(playerid);

        DOF2_SetInt(Player[playerid][PastaConta], "Dinheiro", Player[playerid][Dinheiro]);
        DOF2_SetInt(Player[playerid][PastaConta], "Level", Player[playerid][Level]);
        DOF2_SetInt(Player[playerid][PastaConta], "Vip", Player[playerid][Vip]);
        DOF2_SetInt(Player[playerid][PastaConta], "Admin", Player[playerid][Admin]);
        DOF2_SetFloat(Player[playerid][PastaConta], "Vida", Player[playerid][Vida]);
        DOF2_SetFloat(Player[playerid][PastaConta], "Colete", Player[playerid][Colete]);
        DOF2_SetInt(Player[playerid][PastaConta], "Sexo", Player[playerid][Sexo]);
        DOF2_SetInt(Player[playerid][PastaConta], "Skin", Player[playerid][Skin]);
        //DOF2_SetInt(Player[playerid][PastaConta], "Horas", Player[playerid][ConnectTime]);
        DOF2_SetInt(Player[playerid][PastaConta], "Matou", Player[playerid][MatouKD]);
        DOF2_SetInt(Player[playerid][PastaConta], "Morreu", Player[playerid][MorreuKD]);
        DOF2_SetInt(Player[playerid][PastaConta], "Profissao", Player[playerid][Profissao]);
        DOF2_SetInt(string3,"AimBot", GetPVarInt(playerid,"WarnningAimbot"));
        DOF2_SetInt(string3,"AutoCbug", GetPVarInt(playerid, "WarnningMacro"));
        DOF2_SaveFile();
    }



    //Kill Timers
    KillTimer(Player[playerid][PlayerTimerGroupOneID]);



    //Reset variaveis
    Player[playerid][Dinheiro] = 0;
    Player[playerid][Level] = 0;
    Player[playerid][Vip] = 0;
    Player[playerid][Admin] = 0;
    Player[playerid][pLogado] = 0;
    ResetStringPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
    format(Player[playerid][SenhaDigitada], 30, "");
    Player[playerid][Vida] = 0.0;
    Player[playerid][Colete] = 0.0;
    Player[playerid][Sexo] = 0;
    Player[playerid][Skin] = 0;
    Player[playerid][Profissao] = 0;
    //Player[playerid][ConnectTime] = 0;
    ChatKill[playerid] = false;
    format(Player[playerid][Nome], MAX_PLAYER_NAME, "");
    format(Player[playerid][PastaConta], 50, "");
    Player[playerid][LiberarSetinha] = 0;


    return 1;
}
Abraзos,
Raayzeck
Reply
#2

Faz a verificaзгo se o jogador tem uma conta ou nгo.
PHP код:
if(DOF2_FileExists(arquivo)) //conta existente 
Como vocк formata Player[playerid][PastaConta]?
Reply
#3

A formataзгo й a seguinte:
pawn Код:
format(Player[playerid][PastaConta], 50, PASTA_CONTAS, Player[playerid][Nome]);
Eu deveria fazer a verificaзгo se um jogador possui a conta ou nгo no stock CriarConta?
Reply
#4

No criarconta nгo й necessбrio, mas sim na hora em que ela й chamada.

PHP код:
if(!DOF2_FileExists(arquivo))
{
    
CriarConta(playerid);

Reply
#5

Atualmente ele sу й chamado quando vai escolher o sexo.

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == TDPainel[7]) //entrar
    
{

        if(
DOF2_FileExists(Player[playerid][PastaConta]))
        {

            if(
strlen(Player[playerid][SenhaDigitada]) < 4)
            {

                
ShowPlayerDialog(playeridD_SENHACURTADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: A sua senha deve ter no minнmo 4 caracteres e no mбximo 14 caracteres.""Ok""");
            }
            else
            {

                if(
strcmp(Player[playerid][SenhaDigitada], DOF2_GetString(Player[playerid][PastaConta], "Senha"), false) == 0)
                {

                    
ResetStringPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
                    
format(Player[playerid][SenhaDigitada], 30"");

                    for(new 
tdtd <= 15td++)
                    {

                        
TextDrawHideForPlayer(playeridTDPainel[td]);
                    }

                    
PlayerTextDrawHide(playeridPTDPainel[playerid][0]);
                    
PlayerTextDrawHide(playeridPTDPainel[playerid][1]);
                    
PlayerTextDrawHide(playeridPTDPainel[playerid][2]);

                    
CarregarConta(playerid);
                }
                else
                {

                    
ShowPlayerDialog(playeridD_SENHAERRADADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: A senha estб incorreta.""Ok""");
                }
            }
        }
        else
        {

            
ShowPlayerDialog(playeridD_CONTANAOREGISTRADADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: Sua conta nгo estб registrada.""Ok""");
        }
    }

    if(
clickedid == TDPainel[9])
    {

        if(!
DOF2_FileExists(Player[playerid][PastaConta])) //registrar
        
{

            if(
strlen(Player[playerid][SenhaDigitada]) < 4)
            {

                
ShowPlayerDialog(playeridD_SENHACURTADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: A sua senha deve ter no minнmo 4 caracteres e no mбximo 14 caracteres.""Ok""");
            }
            else
            {

                for(new 
tdtd <= 15td++)
                {

                    
TextDrawHideForPlayer(playeridTDPainel[td]);
                }

                
PlayerTextDrawHide(playeridPTDPainel[playerid][0]);
                
PlayerTextDrawHide(playeridPTDPainel[playerid][1]);
                
PlayerTextDrawHide(playeridPTDPainel[playerid][2]);

                
ShowPlayerDialog(playeridD_SELECAOSEXODIALOG_STYLE_MSGBOX" ""{FFFFFF}Selecione seu sexo:""Masculino""Feminino");
            }
        }
        else
        {

            
ShowPlayerDialog(playeridD_CONTAEXISTEDIALOG_STYLE_MSGBOX" ""{FF0000}Erro: Estб conta jб existe, clique em 'Entrar'.""Ok""");
        }
    }
    return 
1;
}

public 
OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(
playertextid == PTDPainel[playerid][0]) //senha
    
{

        
ShowPlayerDialog(playeridD_SENHADIALOG_STYLE_PASSWORD" ""{FFFFFF}Digite uma senha:\n\n{D0EA09}PS: Sua senha irб ser escondida com *""Confirmar""");
    }
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
strlen(inputtext) > 128)return SendClientMessage(playeridCOLOR_GREY" O link que vocк digitou estб muito grande !");
    if(
strfind(inputtext,"%"true) != -1)return SendClientMessage(playeridCOLOR_GREY"{FFFFFF}Vocк nгo pode usar esse tipo de caractere.");
    if(
dialogid == D_SENHA)
    {

        if(
response)
        {

            if(
strlen(inputtext) > 14)
            {

                
ShowPlayerDialog(playeridD_SENHADIALOG_STYLE_PASSWORD" ""\t\t\t\t{FFFFFF}Digite uma senha:\n\n{FF0000}Erro: Sua senha deve ter no minнmo 4 caracteres e no mбximo 14 caracteres.\n\n\t\t\t{D0EA09}PS: Sua senha irб ser escondida com *""Confirmar""");
            }
            else
            {

                if(
strlen(inputtext) > 0)
                {

                    
ResetStringPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
                    
format(Player[playerid][SenhaDigitada], 30"%s"inputtext);
                    
SetPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
                    
PlayerTextDrawSetString(playeridPTDPainel[playerid][0], Player[playerid][OutputSenha]);
                }
            }
        }
    }

    if(
dialogid == D_SELECAOSEXO)
    {

        if(
response)
        {

            
Player[playerid][Sexo] = 1;
            
Player[playerid][Skin] = 60;
            
CriarConta(playerid);
            
ResetStringPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
            
format(Player[playerid][SenhaDigitada], 30"");


        }
        else
        {

            
Player[playerid][Sexo] = 2;
            
Player[playerid][Skin] = 56;
            
CriarConta(playerid);
            
ResetStringPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
            
format(Player[playerid][SenhaDigitada], 30"");
        }
    } 
Reply
#6

Faзa a alteraзгo disso:
PHP код:
if(strcmp(Player[playerid][SenhaDigitada], DOF2_GetString(Player[playerid][PastaConta], "Senha"), false) == 0
Coloque isso:
PHP код:
if(strcmp(Player[playerid][SenhaDigitada], DOF2_GetString(Player[playerid][PastaConta], "Senha"), true) == 0
E veja se resolve o seu problema.
Reply
#7

Nгo resultou
Reply
#8

Quote:
Originally Posted by Raayzeck
Посмотреть сообщение
ao logar diz que a conta jб estб registrada e buga tudo
Vamos do comeзo...
Qual й a parte onde diz que jб estб registrada?
Reply
#9

Contйm um textdraw que diz que jб estб registrada...
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerVirtualWorld(playerid1000000);
    
TogglePlayerSpectating(playeridtrue);

    
PlayerTextDrawSetString(playeridPTDPainel[playerid][1], Player[playerid][Nome]);

    
InterpolateCameraPos(playerid, -2681.92551456.479583.0546, -2682.40602011.377089.273395000);
    
InterpolateCameraLookAt(playerid, -2681.92801457.484783.0845, -2682.40452012.382289.268195000);

    if(
DOF2_FileExists(Player[playerid][PastaConta]))
    {

        
PlayerTextDrawSetString(playeridPTDPainel[playerid][2], "Registrada");
    }
    else
    {

        
PlayerTextDrawSetString(playeridPTDPainel[playerid][2], "Nao registrada");
    }

    for(new 
tdtd <= 15td++)
    {

        
TextDrawShowForPlayer(playeridTDPainel[td]);
    }
    
SelectTextDraw(playerid0x000000FF);
    
PlayerTextDrawShow(playeridPTDPainel[playerid][0]);
    
PlayerTextDrawShow(playeridPTDPainel[playerid][1]);
    
PlayerTextDrawShow(playeridPTDPainel[playerid][2]);

    return 
1;

E se eu tento registrar diz que jб estб registrada...
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == TDPainel[7]) //entrar
    
{

        if(
DOF2_FileExists(Player[playerid][PastaConta]))
        {

            if(
strlen(Player[playerid][SenhaDigitada]) < 4)
            {

                
ShowPlayerDialog(playeridD_SENHACURTADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: A sua senha deve ter no minнmo 4 caracteres e no mбximo 14 caracteres.""Ok""");
            }
            else
            {

                if(
strcmp(Player[playerid][SenhaDigitada], DOF2_GetString(Player[playerid][PastaConta], "Senha"), true) == 0)
                {

                    
ResetStringPassword(Player[playerid][SenhaDigitada], Player[playerid][OutputSenha]);
                    
format(Player[playerid][SenhaDigitada], 30"");

                    for(new 
tdtd <= 15td++)
                    {

                        
TextDrawHideForPlayer(playeridTDPainel[td]);
                    }

                    
PlayerTextDrawHide(playeridPTDPainel[playerid][0]);
                    
PlayerTextDrawHide(playeridPTDPainel[playerid][1]);
                    
PlayerTextDrawHide(playeridPTDPainel[playerid][2]);

                    
CarregarConta(playerid);
                }
                else
                {

                    
ShowPlayerDialog(playeridD_SENHAERRADADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: A senha estб incorreta.""Ok""");
                }
            }
        }
        else
        {

            
ShowPlayerDialog(playeridD_CONTANAOREGISTRADADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: Sua conta nгo estб registrada.""Ok""");
        }
    }

    if(
clickedid == TDPainel[9])
    {

        if(!
DOF2_FileExists(Player[playerid][PastaConta])) //registrar
        
{

            if(
strlen(Player[playerid][SenhaDigitada]) < 4)
            {

                
ShowPlayerDialog(playeridD_SENHACURTADIALOG_STYLE_MSGBOX" ""{FF0000}Erro: A sua senha deve ter no minнmo 4 caracteres e no mбximo 14 caracteres.""Ok""");
            }
            else
            {

                for(new 
tdtd <= 15td++)
                {

                    
TextDrawHideForPlayer(playeridTDPainel[td]);
                }

                
PlayerTextDrawHide(playeridPTDPainel[playerid][0]);
                
PlayerTextDrawHide(playeridPTDPainel[playerid][1]);
                
PlayerTextDrawHide(playeridPTDPainel[playerid][2]);

                
ShowPlayerDialog(playeridD_SELECAOSEXODIALOG_STYLE_MSGBOX" ""{FFFFFF}Selecione seu sexo:""Masculino""Feminino");
            }
        }
        else
        {

            
ShowPlayerDialog(playeridD_CONTAEXISTEDIALOG_STYLE_MSGBOX" ""{FF0000}Erro: Estб conta jб existe, clique em 'Entrar'.""Ok""");
        }
    }
    return 
1;

Reply
#10

Te enviei uma mensagem privada.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)