[AJUDA] Bug
#1

Porque nгo troca o nick quando muda??

pawn Код:
if(dialogid == mudarnick)
{
    if(response == 1) {
        if(strlen(inputtext) < 3 || strlen(inputtext) > 20) {
            SendClientMessage(playerid,Vermelho,"| ERRO | Nick invбlido!");
            ShowPlayerDialog(playerid,mudarnick , DIALOG_STYLE_INPUT, "Mudar nick", "Vocк estб prestes б mudar de nick\nInsira seu novo nick abaixo:", "Alterar", "Cancelar");
            return 1;
        }
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aname, sizeof(aname));
        format(file, sizeof(file), P_CONTAS, aname);
//Carrega nova conta
        format(file, sizeof(file), P_CONTAS, inputtext);
        if(dini_Exists(file)) {
            SendClientMessage(playerid,Vermelho,"| ERRO | O nick que vocк escolheu jб estб sendo usado!");
            ShowPlayerDialog(playerid,mudarnick,DIALOG_STYLE_INPUT, "Mudar nick", "Vocк estб prestes б mudar de nick\nInsira seu novo nick abaixo:", "Alterar", "Cancelar");
        }
        else {
            for(new c = 0; c < MAX_CASAS; c++) {
                format(string, sizeof(string), "/Casas/casa%d.ini", c);
                if(strcmp(dini_Get(string, "Dono"), aname, false) == 0) {
                    dini_Set(string, "Dono", inputtext);
                }
            }
            for(new p = 0; p < MAX_PROPS; p++) {
                format(string, sizeof(string), "/Props/prop%d.ini", p);
                if(strcmp(dini_Get(string, "Dono"), aname, false) == 0) {
                    dini_Set(string, "Dono", inputtext);
                }
            }
            for(new c = 0; c < MAX_CARROS; c++) {
                format(string, sizeof(string), "carro%d.ini", c);
                if(strcmp(dini_Get(string, "Dono"), aname, false) == 0) {
                    dini_Set(string, "Dono", inputtext);
                }
            }
            new mnskin;
            new mnprocurado;
            new mnvip;
            new mnmoderador;
            new mnlutas;
            new mnPreso;
            new mnentrevista;
            new mnsaldobancario;
            new mnprof;
            new mnbloco;
            new mncombustivel;
            new mnlevel;
            new mntempo;
            new mnexp;
            new mnipod;
            new mndinamite;
            new mntouca;
            new mnjetpack;
            new mnpegoujetpack;
            new mnporte;
            new mncarteira;
            new mnhabt;
            new mnhabn;
            new mnhaba;
            new mncontabancaria;
            new mndm;
            new mncasax;
            new mncasay;
            new mncasaz;
            new mnlembrete;
            new mnroubobanco;
            new mnluta;
            new mnmultas;
//Pega Dados
            mnskin = dini_Int(file, "Skin");
            mnprocurado = dini_Int(file, "Procurado");
            mnvip = dini_Int(file, "VIP");
            mnmoderador = dini_Int(file, "moderador");
            mnlutas = dini_Int(file, "Lutas");
            mnPreso = dini_Int(file, "Preso");
            mnentrevista = dini_Int(file,"Entrevista");
            mnsaldobancario = dini_Int(file, "SaldoBancario");
            mnprof = dini_Int(file, "Profissao");
            mnbloco = dini_Int(file, "Bloco");
            mncombustivel = dini_Int(file, "Combustivel");
            mnlevel = dini_Int(file, "Level");
            mntempo = dini_Int(file, "Tempo");
            mnexp = dini_Int(file, "EXP");
            mnipod = dini_Int(file, "ipod");
            mntouca = dini_Int(file, "touca");
            mnjetpack = dini_Int(file, "Jetpack");
            mndinamite = dini_Int(file, "dinamite");
            mnpegoujetpack = dini_Int(file, "PegouJetpack");
            mnporte = dini_Int(file, "Porte");
            mnporte = dini_Int(file, "Carteira");
            mnhabt = dini_Int(file, "HabTerrestre");
            mnhabn = dini_Int(file, "HabNautica");
            mnhaba = dini_Int(file, "HabAerea");
            mncontabancaria = dini_Int(file, "ContaBancaria");
            mndm = dini_Int(file, "DM");
            mncasax = dini_Int(file, "CasaX");
            mncasay = dini_Int(file, "CasaY");
            mncasaz = dini_Int(file, "CasaZ");
            mnlembrete = dini_Int(file, "Lembrete");
            mnroubobanco = dini_Int(file,"rouboubanco");
            mnluta = dini_Int(file, "Luta");
            mnmultas = dini_Int(file, "Multas");
//Salvar dados na nova conta
            dini_IntSet(file, "Skin", mnskin);
            dini_IntSet(file, "Procurado", mnprocurado);
            dini_IntSet(file, "VIP", mnvip);
            dini_IntSet(file, "moderador", mnmoderador);
            dini_IntSet(file, "Lutas", mnlutas);
            dini_IntSet(file, "Preso", mnPreso);
            dini_IntSet(file, "Entrevista", mnentrevista);
            dini_IntSet(file, "SaldoBancario", mnsaldobancario);
            dini_IntSet(file, "Profissao", mnprof);
            dini_IntSet(file, "Bloco", mnbloco);
            dini_IntSet(file, "Combustivel", mncombustivel);
            dini_IntSet(file, "Level", mnlevel);
            dini_IntSet(file, "Tempo", mntempo);
            dini_IntSet(file, "EXP", mnexp);
            dini_IntSet(file, "ipod", mnipod);
            dini_IntSet(file, "Jetpack", mnjetpack);
            dini_IntSet(file, "dinamite", mndinamite);
            dini_IntSet(file, "PegouJetpack", mnpegoujetpack);
            dini_IntSet(file, "touca", mntouca);
            dini_IntSet(file, "Porte", mnporte);
            dini_IntSet(file, "Carteira", mncarteira);
            dini_IntSet(file, "HabTerrestre", mnhabt);
            dini_IntSet(file, "HabNautica", mnhabn);
            dini_IntSet(file, "HabAerea", mnhaba);
            dini_IntSet(file, "ContaBancaria", mncontabancaria);
            dini_IntSet(file, "DM", mndm);
            dini_IntSet(file, "CasaX", mncasax);
            dini_IntSet(file, "CasaY", mncasay);
            dini_IntSet(file, "CasaZ", mncasaz);
            dini_IntSet(file, "Velocimetro", 0);
            dini_IntSet(file, "Lembrete", mnlembrete);
            dini_IntSet(file, "rouboubanco", mnroubobanco);
            dini_IntSet(file, "Luta", mnluta);
            dini_IntSet(file, "MN", 0);          // Entгo concerteza vai resetar nгo?explica '-' vo explicar no msn.. ._.
            dini_IntSet(file, "MSenha", 0);
            dini_IntSet(file, "Multas", mnmultas);
            format(string, sizeof(string), "| INFO | %s alterou seu nick para %s", aname,inputtext);
            SendClientMessageToAll(0xE6E600AA,string);
            ShowPlayerDialog(playerid, mudarnick2, DIALOG_STYLE_PASSWORD, "Mudar senha", "Vocк estб prestes б mudar senha\nInsira sua nova senha abaixo:", "Alterar", "");
        }
    }
}
Reply
#2

acho q ta faltando SetPlayerName '-'
Reply
#3

Ta tudo errado isso ae! Comeзando pela var file...
Reply
#4

Quote:
Originally Posted by paulor
Посмотреть сообщение
Ta tudo errado isso ae! Comeзando pela var file...
Entгo faz um pra mim cara, pois ta difнcil rsrs.
Reply
#5

Fiz rapidгo! Veja se ta funfando certinho...
pawn Код:
if(dialogid == mudarnick) {
    if(response) {
        if(!(strlen(inputtext) > 2 && strlen(inputtext) < 21)) {
            SendClientMessage(playerid, Vermelho,"| ERRO | Nick invбlido!");
            ShowPlayerDialog(playerid, mudarnick , DIALOG_STYLE_INPUT, "Mudar nick", "Vocк estб prestes б mudar de nick\nInsira seu novo nick abaixo:", "Alterar", "Cancelar");
            return 1;
        }
        new aname[MAX_PLAYER_NAME], oldfile[64], newfile[64];
        GetPlayerName(playerid, aname, sizeof(aname));
        format(oldfile, sizeof(oldfile), P_CONTAS, aname);
        format(newfile, sizeof(newfile), P_CONTAS, inputtext);
        if(dini_Exists(newfile)) {
            SendClientMessage(playerid,Vermelho,"| ERRO | O nick que vocк escolheu jб estб sendo usado!");
            ShowPlayerDialog(playerid,mudarnick,DIALOG_STYLE_INPUT, "Mudar nick", "Vocк estб prestes б mudar de nick\nInsira seu novo nick abaixo:", "Alterar", "Cancelar");
        } else {
            for(new c; c != MAX_CASAS; c++) {
                format(string, sizeof(string), "/Casas/casa%d.ini", c);
                if(!strcmp(dini_Get(string, "Dono"), aname, true)) dini_Set(string, "Dono", inputtext);
            }
            for(new p; p != MAX_PROPS; p++) {
                format(string, sizeof(string), "/Props/prop%d.ini", p);
                if(!strcmp(dini_Get(string, "Dono"), aname, true)) dini_Set(string, "Dono", inputtext);
            }
            for(new c; c != MAX_CARROS; c++) {
                format(string, sizeof(string), "carro%d.ini", c);
                if(!strcmp(dini_Get(string, "Dono"), aname, true)) dini_Set(string, "Dono", inputtext);
            }
            dini_Create(newfile);
            dini_IntSet(newfile, "Skin", dini_Int(oldfile, "Skin"));
            dini_IntSet(newfile, "Procurado", dini_Int(oldfile, "Procurado"));
            dini_IntSet(newfile, "VIP", dini_Int(oldfile, "VIP"));
            dini_IntSet(newfile, "moderador", dini_Int(oldfile, "moderador"));
            dini_IntSet(newfile, "Lutas", dini_Int(oldfile, "Lutas"));
            dini_IntSet(newfile, "Preso", dini_Int(oldfile, "Preso"));
            dini_IntSet(newfile, "Entrevista", dini_Int(oldfile, "Entrevista"));
            dini_IntSet(newfile, "SaldoBancario", dini_Int(oldfile, "SaldoBancario"));
            dini_IntSet(newfile, "Profissao", dini_Int(oldfile, "Profissao"));
            dini_IntSet(newfile, "Bloco", dini_Int(oldfile, "Bloco"));
            dini_IntSet(newfile, "Combustivel", dini_Int(oldfile, "Combustivel"));
            dini_IntSet(newfile, "Level", dini_Int(oldfile, "Level"));
            dini_IntSet(newfile, "Tempo", dini_Int(oldfile, "Tempo"));
            dini_IntSet(newfile, "EXP", dini_Int(oldfile, "EXP"));
            dini_IntSet(newfile, "ipod", dini_Int(oldfile, "ipod"));
            dini_IntSet(newfile, "Jetpack", dini_Int(oldfile, "Jetpack"));
            dini_IntSet(newfile, "dinamite", dini_Int(oldfile, "dinamite"));
            dini_IntSet(newfile, "PegouJetpack", dini_Int(oldfile, "PegouJetpack"));
            dini_IntSet(newfile, "touca", dini_Int(oldfile, "touca"));
            dini_IntSet(newfile, "Porte", dini_Int(oldfile, "Porte"));
            dini_IntSet(newfile, "Carteira", dini_Int(oldfile, "Carteira"));
            dini_IntSet(newfile, "HabTerrestre", dini_Int(oldfile, "HabTerrestre"));
            dini_IntSet(newfile, "HabNautica",dini_Int(oldfile, "HabNautica"));
            dini_IntSet(newfile, "HabAerea", dini_Int(oldfile, "HabAerea"));
            dini_IntSet(newfile, "ContaBancaria", dini_Int(oldfile, "ContaBancaria"));
            dini_IntSet(newfile, "DM", dini_Int(oldfile, "DM"));
            dini_IntSet(newfile, "CasaX", dini_Int(oldfile, "CasaX"));
            dini_IntSet(newfile, "CasaY", dini_Int(oldfile, "CasaY"));
            dini_IntSet(newfile, "CasaZ", dini_Int(oldfile, "CasaZ"));
            dini_IntSet(newfile, "Velocimetro", 0);
            dini_IntSet(newfile, "Lembrete", dini_Int(oldfile, "Lembrete"));
            dini_IntSet(newfile, "rouboubanco", dini_Int(oldfile, "rouboubanco"));
            dini_IntSet(newfile, "Luta", dini_Int(oldfile, "Luta"));
            dini_IntSet(newfile, "MN", 0);
            dini_IntSet(newfile, "MSenha", 0);
            dini_IntSet(newfile, "Multas", dini_Int(oldfile, "Multas"));
            dini_Remove(oldfile);
            SetPlayerName(playerid, inputtext);
            format(string, sizeof(string), "| INFO | %s alterou seu nick para %s", aname, inputtext);
            SendClientMessageToAll(0xE6E600AA, string);
            ShowPlayerDialog(playerid, mudarnick2, DIALOG_STYLE_PASSWORD, "Mudar senha", "Vocк estб prestes б mudar senha\nInsira sua nova senha abaixo:", "Alterar", "");
        }
    }
}
Reply
#6

pois й, axo q oq ta faltando mesmo й o SetPlayerName
Reply
#7

Quote:
Originally Posted by paulor
Посмотреть сообщение
Fiz rapidгo! Veja se ta funfando certinho...
pawn Код:
if(dialogid == mudarnick) {
    if(response) {
        if(!(strlen(inputtext) > 2 && strlen(inputtext) < 21)) {
            SendClientMessage(playerid, Vermelho,"| ERRO | Nick invбlido!");
            ShowPlayerDialog(playerid, mudarnick , DIALOG_STYLE_INPUT, "Mudar nick", "Vocк estб prestes б mudar de nick\nInsira seu novo nick abaixo:", "Alterar", "Cancelar");
            return 1;
        }
        new aname[MAX_PLAYER_NAME], oldfile[64], newfile[64];
        GetPlayerName(playerid, aname, sizeof(aname));
        format(oldfile, sizeof(oldfile), P_CONTAS, aname);
        format(newfile, sizeof(newfile), P_CONTAS, inputtext);
        if(dini_Exists(newfile)) {
            SendClientMessage(playerid,Vermelho,"| ERRO | O nick que vocк escolheu jб estб sendo usado!");
            ShowPlayerDialog(playerid,mudarnick,DIALOG_STYLE_INPUT, "Mudar nick", "Vocк estб prestes б mudar de nick\nInsira seu novo nick abaixo:", "Alterar", "Cancelar");
        } else {
            for(new c; c != MAX_CASAS; c++) {
                format(string, sizeof(string), "/Casas/casa%d.ini", c);
                if(!strcmp(dini_Get(string, "Dono"), aname, true)) dini_Set(string, "Dono", inputtext);
            }
            for(new p; p != MAX_PROPS; p++) {
                format(string, sizeof(string), "/Props/prop%d.ini", p);
                if(!strcmp(dini_Get(string, "Dono"), aname, true)) dini_Set(string, "Dono", inputtext);
            }
            for(new c; c != MAX_CARROS; c++) {
                format(string, sizeof(string), "carro%d.ini", c);
                if(!strcmp(dini_Get(string, "Dono"), aname, true)) dini_Set(string, "Dono", inputtext);
            }
            dini_Create(newfile);
            dini_IntSet(newfile, "Skin", dini_Int(oldfile, "Skin"));
            dini_IntSet(newfile, "Procurado", dini_Int(oldfile, "Procurado"));
            dini_IntSet(newfile, "VIP", dini_Int(oldfile, "VIP"));
            dini_IntSet(newfile, "moderador", dini_Int(oldfile, "moderador"));
            dini_IntSet(newfile, "Lutas", dini_Int(oldfile, "Lutas"));
            dini_IntSet(newfile, "Preso", dini_Int(oldfile, "Preso"));
            dini_IntSet(newfile, "Entrevista", dini_Int(oldfile, "Entrevista"));
            dini_IntSet(newfile, "SaldoBancario", dini_Int(oldfile, "SaldoBancario"));
            dini_IntSet(newfile, "Profissao", dini_Int(oldfile, "Profissao"));
            dini_IntSet(newfile, "Bloco", dini_Int(oldfile, "Bloco"));
            dini_IntSet(newfile, "Combustivel", dini_Int(oldfile, "Combustivel"));
            dini_IntSet(newfile, "Level", dini_Int(oldfile, "Level"));
            dini_IntSet(newfile, "Tempo", dini_Int(oldfile, "Tempo"));
            dini_IntSet(newfile, "EXP", dini_Int(oldfile, "EXP"));
            dini_IntSet(newfile, "ipod", dini_Int(oldfile, "ipod"));
            dini_IntSet(newfile, "Jetpack", dini_Int(oldfile, "Jetpack"));
            dini_IntSet(newfile, "dinamite", dini_Int(oldfile, "dinamite"));
            dini_IntSet(newfile, "PegouJetpack", dini_Int(oldfile, "PegouJetpack"));
            dini_IntSet(newfile, "touca", dini_Int(oldfile, "touca"));
            dini_IntSet(newfile, "Porte", dini_Int(oldfile, "Porte"));
            dini_IntSet(newfile, "Carteira", dini_Int(oldfile, "Carteira"));
            dini_IntSet(newfile, "HabTerrestre", dini_Int(oldfile, "HabTerrestre"));
            dini_IntSet(newfile, "HabNautica",dini_Int(oldfile, "HabNautica"));
            dini_IntSet(newfile, "HabAerea", dini_Int(oldfile, "HabAerea"));
            dini_IntSet(newfile, "ContaBancaria", dini_Int(oldfile, "ContaBancaria"));
            dini_IntSet(newfile, "DM", dini_Int(oldfile, "DM"));
            dini_IntSet(newfile, "CasaX", dini_Int(oldfile, "CasaX"));
            dini_IntSet(newfile, "CasaY", dini_Int(oldfile, "CasaY"));
            dini_IntSet(newfile, "CasaZ", dini_Int(oldfile, "CasaZ"));
            dini_IntSet(newfile, "Velocimetro", 0);
            dini_IntSet(newfile, "Lembrete", dini_Int(oldfile, "Lembrete"));
            dini_IntSet(newfile, "rouboubanco", dini_Int(oldfile, "rouboubanco"));
            dini_IntSet(newfile, "Luta", dini_Int(oldfile, "Luta"));
            dini_IntSet(newfile, "MN", 0);
            dini_IntSet(newfile, "MSenha", 0);
            dini_IntSet(newfile, "Multas", dini_Int(oldfile, "Multas"));
            dini_Remove(oldfile);
            SetPlayerName(playerid, inputtext);
            format(string, sizeof(string), "| INFO | %s alterou seu nick para %s", aname, inputtext);
            SendClientMessageToAll(0xE6E600AA, string);
            ShowPlayerDialog(playerid, mudarnick2, DIALOG_STYLE_PASSWORD, "Mudar senha", "Vocк estб prestes б mudar senha\nInsira sua nova senha abaixo:", "Alterar", "");
        }
    }
}
Vlw emo , funfo certin +rep!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)