[AJUDA]Alterar Registro de "arquivo" para "ini"
#1

Olб galera gostaria de saber como faзo para trocar o meu registro do formato arquivo para ini

Porfavor peзo muito a ajuda de vocкs sу falta resolver esse problema para mim poder botar o sistema de salvamento.

No aguardo, e agredeзo quem puder ajudar, para que nгo puder ajudar agradeзo tambйm!

Code:
// === [Register] ===
new PlayerName[24];
    GetPlayerName(playerid, PlayerName, 30);
        if(strcmp(cmd, "/registrar", true) == 0)
        {
            tmp = strtok(cmdtext, idx);
                GetPlayerName(playerid, playername, sizeof(playername));
        if(20 < strlen(tmp) || strlen(tmp) < 4)
                {
                        SendClientMessage(playerid, COLOR_CYAN, "[RTX] INFORMA: Sua senha tem que ter mais de 4 e menos de 20 letras/nъmeros!");
                        return 1;
                }
            if(!strlen(tmp))
            {
                        SendClientMessage(playerid, COLOR_CYAN, "Uso correto: /registrar [senha] ~ Vai fazer com que vocк fique registrado com o server e seus stats sejam salvos!");
                }
                else
                {
                        if (!dini_Exists(udb_encode(playername)))
                        {
                                dini_Create(udb_encode(playername));
                                dini_IntSet(udb_encode(playername), "pass", udb_hash(tmp));
                                dini_Set(udb_encode(playername),"senha",tmp);
                        PlayerInfo[playerid][pAdmin] = 0;
                        PlayerInfo[playerid][pVIP] = 0;
                        PlayerInfo[playerid][pADA] = 0;
                        PlayerInfo[playerid][pTCP] = 0;
                        PlayerInfo[playerid][pPCC] = 0;
                        PlayerInfo[playerid][pRRB] = 0;
                        PlayerInfo[playerid][pEX] = 0;
                        PlayerInfo[playerid][pBOPE] = 0;
                        PlayerInfo[playerid][pGOE] = 0;
                        PlayerInfo[playerid][pCV] = 0;
                        dini_IntSet(udb_encode(playername), "level", PlayerInfo[playerid][pAdmin]);
                        dini_IntSet(udb_encode(playername), "levelvip", PlayerInfo[playerid][pVIP]);
                        dini_IntSet(udb_encode(playername), "levelada", PlayerInfo[playerid][pADA]);
                        dini_IntSet(udb_encode(playername), "leveltcp", PlayerInfo[playerid][pTCP]);
                        dini_IntSet(udb_encode(playername), "levelbope", PlayerInfo[playerid][pBOPE]);
                        dini_IntSet(udb_encode(playername), "levelex", PlayerInfo[playerid][pEX]);
                        dini_IntSet(udb_encode(playername), "levelpcc", PlayerInfo[playerid][pPCC]);
                        dini_IntSet(udb_encode(playername), "levelrrb", PlayerInfo[playerid][pRRB]);
                        dini_IntSet(udb_encode(playername), "levelgoe", PlayerInfo[playerid][pGOE]);
                        dini_IntSet(udb_encode(playername), "levelcv", PlayerInfo[playerid][pCV]);
                        format(string, sizeof(string), "%s(%i) registrado com a senha \"%s\"", playername, playerid, tmp);
                                printf(string);
                                format(string, sizeof(string), "Vocк criou a conta %s com a senha \"%s\". Nгo se esqueзa da sua senha!", playername, tmp);
                                SendClientMessage(playerid, COLOR_CYAN, string);
                                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                                ShowPlayerDialog(playerid, 60, DIALOG_STYLE_LIST, "Bem vindo(a), escolha uma facзгo", "Comando Vermelho - [CV]\nAmigos dos Amigos - [ADA]\nTerceiro Comando Puro - [TCP]\nPrimeiro Comando da Capital - [PCC]", "Selecionar", "");
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_YELLOW, "[RTX] INFORMA: Um erro aconteceu enquanto tentava se registrar ao server, vaza fakes!");
                                format(string, sizeof(string), "[RTX] INFORMA: O nick %s jб й registrado nesse server!", playername,tmp);
                                SendClientMessage(playerid, COLOR_YELLOW, string);
                        }
                }

                return 1;
        }
// === [Login] ===
        if(strcmp(cmd, "/login", true) == 0)
        {
  if(logged[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_CYAN, "Vocк jб estб logado!");
                    return 1;
                }
  tmp = strtok(cmdtext, idx);
                         GetPlayerName(playerid, playername, sizeof(playername));
            if(!strlen(tmp))
            {
                        SendClientMessage(playerid, COLOR_GREEN, "Uso correto: [senha]");
                }
                else
                {
                        if(dini_Exists(udb_encode(playername)))
                        {
                            if(logged[playerid] == 0)
                            {
                                        tmp2 = dini_Get(udb_encode(playername), "pass");
                                        if(udb_hash(tmp) != strval(tmp2))
                                        {
                                            new PlayerName[24];
                                            GetPlayerName(playerid, PlayerName, 30);
                                            format(string, sizeof(string), "Erro! Vocк digitou a senha errada para %s!", PlayerName);
                                            SendClientMessage(playerid, COLOR_RED, string);
                                        }
                                        else
                                        {
                                            new pname[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
                                                logged[playerid] = 1;
                                                logado[playerid] = 1;
                                                dini_Set(udb_encode(playername),"senha",tmp);
                                PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(playername), "level");
                                PlayerInfo[playerid][pPMs] = dini_Int(udb_encode(playername), "SeePMs");
                                PlayerInfo[playerid][pVIP] = dini_Int(udb_encode(playername), "levelvip");
                                PlayerInfo[playerid][pADA] = dini_Int(udb_encode(playername), "levelada");
                                PlayerInfo[playerid][pTCP] = dini_Int(udb_encode(playername), "leveltcp");
                                PlayerInfo[playerid][pBOPE] = dini_Int(udb_encode(playername), "levelbope");
                                PlayerInfo[playerid][pEX] = dini_Int(udb_encode(playername), "levelex");
                                PlayerInfo[playerid][pPCC] = dini_Int(udb_encode(playername), "levelpcc");
                                PlayerInfo[playerid][pRRB] = dini_Int(udb_encode(playername), "levelrrb");
                                PlayerInfo[playerid][pGOE] = dini_Int(udb_encode(playername), "levelgoe");
                                PlayerInfo[playerid][pCV] = dini_Int(udb_encode(playername), "levelcv");

                                GameTextForPlayer(playerid, "~G~ LOGADO COM SUCESSO!",2000,1);
                                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);

                       if(PlayerInfo[playerid][pAdmin] == 0)
                                {
                                    new PlayerName[24];
                                                GetPlayerName(playerid, PlayerName, 30);
                                                format(string, sizeof(string), "Logado como: %s", PlayerName);
                                                format(string, sizeof(string), "--------------------------");
                                                format(string, sizeof(string), "Membro Normal");
                                                SendClientMessage(playerid, COLOR_BLUE, string);

                                                }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)