[Pedido] Comando Mudar Nome
#5

@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.");
	}
}
Reply


Messages In This Thread
Comando Mudar Nome - by jefrens - 28.11.2015, 05:56
Re: Comando Mudar Nome - by cicinho - 28.11.2015, 09:01
Re: Comando Mudar Nome - by jefrens - 28.11.2015, 19:14
Re: Comando Mudar Nome - by cicinho - 28.11.2015, 19:39
Re: Comando Mudar Nome - by cicinho - 28.11.2015, 20:31
Re: Comando Mudar Nome - by jefrens - 28.11.2015, 20:47
Re: Comando Mudar Nome - by cicinho - 29.11.2015, 08:51
Re: Comando Mudar Nome - by DjMix - 19.09.2018, 20:51
Re: Comando Mudar Nome - by ipsLuan - 19.09.2018, 21:07
Re: Comando Mudar Nome - by Poseidon4625 - 22.09.2018, 00:52

Forum Jump:


Users browsing this thread: 1 Guest(s)