[Ajuda] Mudar Nick
#1

Criei um comando aqui: /mudarnick [nick], o comando funciona de boa, o nick do player muda mais o nick nas contas dos player nгo muda, ao invйs de mudar o nick nas contas, ele cria outra conta com o nick mudado, code:

PHP код:
CMD:mudarnick(playerid, params[])
{
    new 
novonick[24];
    if(
sscanf(params, "s", novonick)) return SendClientMessage(playerid, -1, "{FFFF00}INFO {FF0000}USO: /mudarnick [nick]");
    new 
File:PFile, LineForFile[100];                    
    new 
oldname[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, oldname, MAX_PLAYER_NAME);    
    
SetPlayerName(playerid, novonick);
    if(
fexist(oldname))
    {
        
PFile = fopen(oldname, io_append);
        
format(LineForFile, 100, "Jogadores/%s.ini", novonick);
        
fwrite(PFile, LineForFile);      
        
fclose(PFile);           
    
    }           
    
Salvar(playerid);         
    return 
1;
} 
Reply
#2

eu colocaria pra deletar a conta antiga. Mas pelo jeito nгo isso que vocк quer.
Reply
#3

voce usa DOF2? se usar basta usar um simples DOF2_RenameFile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)