OnPlayerText help
#1

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?
Reply
#2

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

Use SendClientMessageToAll instead.
Reply
#3

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

thanks guys, works now!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)