SA-MP Forums Archive
[Ajuda] Comando /MudarNick - 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] Comando /MudarNick (/showthread.php?tid=364088)



Comando /MudarNick - Gabriel Santana - 29.07.2012

Vejam galera, procurei esse comando mais nгo achei, tem como alguйm mim passar eses comando de /mudarnick para players normais mesmo, obrigado.



Re: Comando /MudarNick - humildadeforever - 29.07.2012

Quote:
Originally Posted by Gabriel Santana
Посмотреть сообщение
Vejam galera, procurei esse comando mais nгo achei, tem como alguйm mim passar eses comando de /mudarnick para players normais mesmo, obrigado.
strcmp + strtok ou zcmd + sscanf e SetPlayerName


Re: Comando /MudarNick - Lуs - 29.07.2012

pawn Код:
CMD:mudarnome(playerid, params[])
{
    new L_NOVO_NOME[MAX_PLAYER_NAME];
    if(sscanf(params, "s[MAX_PLAYER_NAME]", L_NOVO_NOME)) return SendClientMessage(playerid, -1, "Uso: /mudarnome [Novo nome]");
    new L_NOME_ANTIGO[MAX_PLAYER_NAME];
    GetPlayerName(playerid, L_NOME_ANTIGO, MAX_PLAYER_NAME);
    SetPlayerName(playerid, L_NOVO_NOME);
    new L_STRING[128];
    format(L_STRING, 128, "%s alterou seu nome para %s!", L_NOME_ANTIGO, L_NOVO_NOME);
    SendClientMessageToAll(-1, L_STRING);
    return 1;
}



Re: Comando /MudarNick - Gabriel Santana - 29.07.2012

Nгo consigo, tem como alguem ajudar aк.

Quero que o adiministrador mude o nick do player normal.



Re: Comando /MudarNick - Gabriel Santana - 29.07.2012

Los, manda em strcmd, nгo uso em zcmd.



Re: Comando /MudarNick - DanDRT - 29.07.2012

Код:
	if(strcmp(cmd, "/mudarnick", true) == 0)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "leveladm");
		new tmpp[256];
		tmpp = strtok(cmdtext, idx);
		if(!strlen(tmpp))
		{
			SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /mudarnick [id do player] [novo nick]");
			return 1;
		}
		giveplayerid = strval(tmpp);
		tmp = strtok(cmdtext, idx);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logado[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 3)
		    {
		        if(IsPlayerConnected(giveplayerid))
		        {
					format(string, sizeof(string), "* ADMIN: Vocк mudou o nick de %s(%i) para %s", giveplayerid, tmp);
					SendClientMessage(playerid, COLOR_ADM, string);
					SetPlayerName(giveplayerid, tmp);
				}
				else
				{
				    format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
					SendClientMessage(playerid, COLOR_CYAN, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo tem permissгo para usar este comando!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!");
		}
	  	return 1;
  	}