SA-MP Forums Archive
OnPlayerText help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerText help (/showthread.php?tid=563863)



OnPlayerText help - OMonger - 17.02.2015

Hi,

I've attempted to create it so that before an administrator speaks it comes up with a tag: "[ADMIN]". However, the name of the player appears before it making it look strange. This is my script:

Код:
public OnPlayerText(playerid, text[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
	    new Text[144], pName[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	    format(Text, sizeof(Text), "{F81414}[{00CED1}ADMIN{F81414}]{FFFFFF} %s (%d): %s", pName, playerid, text);
	    SendPlayerMessageToAll(playerid, Text);
	}
	return 0;
}
Can anyone help?


Re: OnPlayerText help - arakuta - 17.02.2015

You are using SendPlayerMessageToAll. It always put the player name in front of it.

Use SendClientMessageToAll instead.


Re: OnPlayerText help - PaulDinam - 17.02.2015

First of all change SendPlayerMessageToAll to SendClientMessageToAll and change Text to textz or something, Text is used to define a textdraw.


Re: OnPlayerText help - OMonger - 17.02.2015

thanks guys, works now!