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



Ajuda comando pm - ThiagoMK - 29.05.2013

Eu queria que na frente de quem mandou o pm fica-se com o id tipo assim **Recebido de Thiago (ID:%i) e >>Recebida de Thiago (ID:%i) (no lugar do %i o id da pessoa)

Код HTML:
// This commands allows the player to send a private message to another player
COMMAND:pm(playerid, params[])//OK
{
	new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
	SendAdminText(playerid, "/pm", params);
	if (APlayerData[playerid][LoggedIn] == true)
	{
		if (sscanf(params, "us[128]", OtherPlayer, Message)) SendClientMessage(playerid, 0xFF0000AA, "{FF0000}Use: /pm [id] [menssagem]");
		else
		{
			if (IsPlayerConnected(OtherPlayer))
			{
			    if (APlayerData[playerid][Muted] == false)
			    {
					GetPlayerName(playerid, YourName, sizeof(YourName));
					GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
					format(Msg1, 128, "{FFFF00}>> Enviada Para %s: %s", OtherPlayerName, Message);
					format(Msg2, 128, "{FFFF00}** Recebida De %s: %s", YourName, Message);
			        GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Menssagem privada ~y~enviada~y~!", 3000, 3);
			        GameTextForPlayer(OtherPlayer, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~ Menssagem privada ~r~recebida~r~!", 3000, 3);
					SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
					SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
				}
				else
				    SendClientMessage(playerid, 0xFF0000FF, "{FF0000}Vocк ainda estб mudo!");
			}
			else
			    SendClientMessage(playerid, 0xFF0000FF, "{FF0000}O jogador nгo estб online.");
		}
	}
	else
	 return 0;
	return 1;
}



Re: Ajuda comando pm - ProKillerpa - 29.05.2013

Troque:

pawn Код:
format(Msg2, 128, "{FFFF00}** Recebida De %s: %s", YourName, Message);
Por:

pawn Код:
format(Msg2, 128, "{FFFF00}** Recebida De %s(ID %d): %s", YourName, playerid, Message);



Re : Ajuda comando pm - ThiagoMK - 29.05.2013

Testando aqui


Re : Ajuda comando pm - ThiagoMK - 29.05.2013

Vlw, lek.