[Ajuda] Vezes
#3

eis a questгo em quanto o player se registrar o level dele fica zero, ele sу seta as infos do player abaixo no dialog de login como pode vк:
pawn Код:
switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(!response) Kick(playerid);
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registro","Sua conta nгo esta registra\n digite uma senha para se registrar","Registrar","Sair");
            if(response)
            {
                new arquivo[64], str[128], year, month, day;
                getdate(year, month, day);
                GetPlayerName(playerid,arquivo,sizeof(arquivo));
                format(arquivo, 64,"Contas/%s.ini",arquivo);
                DOF2_CreateFile(arquivo, inputtext);
                format(str, sizeof(str), "%02d", day);
                DOF2_SetString(arquivo, "Dia", str);
                format(str, sizeof(str), "%02d", month);
                DOF2_SetString(arquivo, "Mes", str);
                format(str, sizeof(str), "%02d", year);
                DOF2_SetString(arquivo, "Ano", str);
                DOF2_SetInt(arquivo, "Dinheiro", 1998);
                DOF2_SetInt(arquivo, "Admin", 0);
                DOF2_SetInt(arquivo, "Level", 2);
                DOF2_SetInt(arquivo, "Banco", 500);
                DOF2_SetInt(arquivo, "Respeito", 0);
                new Respeitorr = PlayerInfo[playerid][Level]*4;
                DOF2_SetInt(arquivo, "RespeitoR", Respeitorr);
                DOF2_SetInt(arquivo, "Profissao", 0);
                DOF2_SetInt(arquivo, "Morreu", 0);
                DOF2_SetInt(arquivo, "Matou", 0);
                DOF2_SetInt(arquivo, "Drogas", 0);
                DOF2_SetInt(arquivo, "Skin", 29);
                format(str, sizeof(str)," Status: Registrado \n Dia do registro: %02d/%02d/%02d \n Level: %d \n Digite sua senha para logar.",DOF2_GetInt(arquivo,"Dia"),DOF2_GetInt(arquivo,"Mes"),DOF2_GetInt(arquivo,"Ano"), DOF2_GetInt(arquivo,"Level"));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Logar",str,"Logar","Sair");
             }
        }
        case DIALOG_LOGIN:
        {
            if(!response) Kick(playerid);
            if(response)
            {
                new arquivo[64];
                GetPlayerName(playerid,arquivo,sizeof(arquivo));
                format(arquivo, 64,"Contas/%s.ini",arquivo);
                if(DOF2_FileExists(arquivo))
                {
                    if(DOF2_CheckLogin(arquivo,inputtext))
                    {
                        PlayerInfo[playerid][Admin] = DOF2_GetInt(arquivo, "Admin");
                        PlayerInfo[playerid][Membro] = DOF2_GetInt(arquivo, "Membro");
                        PlayerInfo[playerid][Lider] = DOF2_GetInt(arquivo, "Lider");
                        PlayerInfo[playerid][Respeito] = DOF2_GetInt(arquivo, "Respeito");
                        PlayerInfo[playerid][RespeitoR] = DOF2_GetInt(arquivo, "RespeitoR");
                        PlayerInfo[playerid][Banco] = DOF2_GetInt(arquivo, "Banco");
                        PlayerInfo[playerid][Matou] = DOF2_GetInt(arquivo, "Matou");
                        PlayerInfo[playerid][Morreu] = DOF2_GetInt(arquivo, "Morreu");
                        PlayerInfo[playerid][Drogas] = DOF2_GetInt(arquivo, "Drogas");
                        PlayerInfo[playerid][Profissao] = DOF2_GetInt(arquivo, "Profissao");
                        PlayerInfo[playerid][Skin] = DOF2_GetInt(arquivo, "Skin");
                        PlayerInfo[playerid][Level] =  DOF2_GetInt(arquivo, "Level");
                        SetPlayerScore(playerid,  PlayerInfo[playerid][Level]);
                        PlayerInfo[playerid][Dinheiro] = DOF2_GetInt(arquivo, "Dinheiro");
                        SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
                        SpawnPlayer(playerid);
                        GivePlayerMoney(playerid,  PlayerInfo[playerid][Dinheiro]);
                        Logado[playerid] = 1;
                        return 1;
                    }
                    else
                    {
                        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Senha Errada!","Vocк escreveu uma senha invalida\nTente outra senha!","Logar","Sair");
                        return 1;
                    }
                }
            }
        }
     }
Reply


Messages In This Thread
Vezes - by MatheusAlcapone - 02.11.2012, 00:36
Re: Vezes - by Victor' - 02.11.2012, 00:40
Re: Vezes - by MatheusAlcapone - 02.11.2012, 00:43
Re: Vezes - by Victor' - 02.11.2012, 00:46
Re: Vezes - by MatheusAlcapone - 02.11.2012, 00:53
Re: Vezes - by zSuYaNw - 02.11.2012, 02:16
Re: Vezes - by MatheusAlcapone - 02.11.2012, 02:23

Forum Jump:


Users browsing this thread: 1 Guest(s)