SA-MP Forums Archive
[Ajuda] Mudanзa de Nick - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Mudanзa de Nick (/showthread.php?tid=423706)



Mudanзa de Nick - Delete_ - 18.03.2013

pawn Код:
public MudarNick(playerid)
{
    new NovoNome[30];
    GetPlayerName(playerid, NovoNome, sizeof(NovoNome));
    format(String, sizeof(String), "LLADMIN/Contas/%s.txt", NovoNome[playerid]);
    DOF2_RemoveFile(String);
    SetPlayerName(playerid, NovoNome);
    format(String, sizeof(String), "LLADMIN/Contas/%s.txt", NovoNome[playerid]);
    DOF2_CreateFile(String);
    SalvarDados(playerid);
    DOF2_SaveFile();
    return 1;
}
O code estб criando outra conta ao invйs de renomear a mesma.


Re: Mudanзa de Nick - Gii - 18.03.2013

pawn Код:
DOF2_RenameFile(oldfile[],newfile[]);



Re: Mudanзa de Nick - Delete_ - 19.03.2013

Fiz assim:

pawn Код:
new string2[60];
    format(string2,sizeof(string2),"LLADMIN/Contas/%s.txt", Name);
    DOF2_RenameFile(Name, NovoNick);
    DOF2_SaveFile();
Mais nгo funcionou.


Re: Mudanзa de Nick - Gii - 19.03.2013

Tenta ai, nunca usei esta funзгo.

pawn Код:
MudarNick(playerid, NomeNovo[] ) {

    new
        NomeAntigo[MAX_PLAYER_NAME],
        pStr[45]
    ;

    GetPlayerName(playerid, NomeAntigo, MAX_PLAYER_NAME);
    SetPlayerName(playerid, NomeNovo);
    format(String, sizeof(String), "LLADMIN/Contas/%s.txt", NomeAntigo);
    format(pStr, 45, "LLADMIN/Contas/%s.txt", NomeNovo);
    DOF2_RenameFile(String,pStr);

    return true;
}



Re: Mudanзa de Nick - gunit_j - 19.03.2013

Nгo sei se vai funcionar mais tenta ai..

pawn Код:
public MudarNick(playerid)
{
    new NewName[MAX_PLAYER_NAME], OldName[24], CH[40];
    GetPlayerName(playerid, NewName, MAX_PLAYER_NAME);
    GetPlayerName(playerid, OldName, MAX_PLAYER_NAME);
    format(CH, sizeof(CH), "LLADMIN/Contas/%s.txt", OldName);
    SetPlayerName(playerid, NewName);
    DOF2_RenameFile(OldName, NewName);
    SalvarDados(playerid);
    DOF2_SaveFile();
    return 1;
}



Re: Mudanзa de Nick - feliphemort - 19.03.2013

Hm... Eu tenho este mesmo CMD, sem bugs... Ele renomeia a conta perfeitamente sem precisar criar outra!

A diferenзa й que oque eu uso й usado para os admins: /mudarnick ID Nick