SA-MP Forums Archive
[Pedido] Comando Mudar Nome - 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: [Pedido] Comando Mudar Nome (/showthread.php?tid=595087)



Comando Mudar Nome - jefrens - 28.11.2015

Alguйm tem algum tipo de comando de Mudar Nick em ZCMD e SSCANF que por exemplo, quando mudar o nick da pessoa, todas as informaзхes que tinha no nick antigo passe para o nick novo. Todos comandos que achei atй agora nгo setam a senha no .ini e ai quando muda o nick nгo tem como mais entrar na conta! :/



Re: Comando Mudar Nome - cicinho - 28.11.2015

Faz uso de qual include para gerenciamento de ficheiros?


Re: Comando Mudar Nome - jefrens - 28.11.2015

@cicinho zcmd e sscanf


Re: Comando Mudar Nome - cicinho - 28.11.2015

Quote:
Originally Posted by jefrens
Посмотреть сообщение
@cicinho zcmd e sscanf
Vocк entendeu errado, vocк usa DOF2, Dini, MySQL ou outra include para salvar as contas?


Re: Comando Mudar Nome - cicinho - 28.11.2015

@jefrens, fiz em DOF2, cуdigo:
Код:
//Definiзхes
#define DIALOG_MUDARNOME 200



//Comando 
CMD:mudarnome(playerid)
{
	ShowPlayerDialog(playerid, DIALOG_MUDARNOME, DIALOG_STYLE_INPUT, "Alterar nome", "\nDigite seu novo nome para continuar:", "Continuar", "Cancelar");
	return true;
}



//Callback OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    
	if(dialogid == DIALOG_MUDARNOME)
	{
    	new String[60],Str[60],Nome[MAX_PLAYER_NAME];
	    if(response)
	    {
	        if(strlen(inputtext) < 3 || strlen(inputtext) > 20)
	        {
	            SendClientMessage(playerid, 0xFF000000, "ERRO: Nome invбlido.");
	        }else{
	            GetPlayerName(playerid, Nome, sizeof Nome);
        		format(String, sizeof(String), "Contas/%s.ini", inputtext);
    			if(!DOF2_FileExists(String))
				{
    				format(Str, sizeof(Str), "Contas/%s.ini", Nome);
					DOF2_RenameFile(Str, String);
					DOF2_SaveFile();
					format(String, sizeof(String), "Parabйns! Seu novo nick й: %s! Entre novamente no servidor com seu novo nome.", inputtext);
     				SendClientMessage(playerid, -1, String);
     				Kick(playerid);
				}
				else
    				SendClientMessage(playerid, 0xFF000000, "ERRO: Ja existe uma conta com esse nick!");
    		}
	    }
	    else
     		SendClientMessage(playerid, -1, "INFO: Vocк cancelou a mudanзa de nick.");
	}
}



Re: Comando Mudar Nome - jefrens - 28.11.2015

Cicinho, й em dof2 mesmo, irei testar aqui e jб posto o edit.

EDIT: Funcionou direitinho meu brother, +rep pra vocк, mas me tira uma duvida? Quando muda o nick, fica 2 arquivos criados, o antigo e o novo, como posso fazer para excluir o novo e deixar sу o antigo?


Re: Comando Mudar Nome - cicinho - 29.11.2015

Quote:
Originally Posted by jefrens
Посмотреть сообщение
Cicinho, й em dof2 mesmo, irei testar aqui e jб posto o edit.

EDIT: Funcionou direitinho meu brother, +rep pra vocк, mas me tira uma duvida? Quando muda o nick, fica 2 arquivos criados, o antigo e o novo, como posso fazer para excluir o novo e deixar sу o antigo?
Ele nгo cria outro arquivo, apenas renomeia, verifique a pasta que vocк salva as contas dos players e mude no format em seu codigo.
Код:
format(String, sizeof(String), "Contas/%s.ini", inputtext);
format(Str, sizeof(Str), "Contas/%s.ini", Nome);



Re: Comando Mudar Nome - DjMix - 19.09.2018

valew brown nois agradece a ajuda de vocкs equipe BPT AGRADECE DE CORAЗГO


Re: Comando Mudar Nome - ipsLuan - 19.09.2018

Quote:
Originally Posted by jefrens
Посмотреть сообщение
Cicinho, й em dof2 mesmo, irei testar aqui e jб posto o edit.

EDIT: Funcionou direitinho meu brother, +rep pra vocк, mas me tira uma duvida? Quando muda o nick, fica 2 arquivos criados, o antigo e o novo, como posso fazer para excluir o novo e deixar sу o antigo?
DOF2_RemoveFile.


Re: Comando Mudar Nome - Poseidon4625 - 22.09.2018

Quote:
Originally Posted by DjMix
Посмотреть сообщение
valew brown nois agradece a ajuda de vocкs equipe BPT AGRADECE DE CORAЗГO
O Cara Reviveu um Tуpico de 2015 ksksksksks