30.12.2012, 00:02
Exactly what Dwane said, but in code format:
pawn Code:
public OnPlayerText(playerid, text[]) //This is called every time a player tries to type something, other than a command, such as when talking to other players
{
if(IsPlayerAdmin(playerid)) //If they are an admin, you can replace this with your own admin variable
{
new string[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string,sizeof(string),"[ADMIN] %s: %s", name, text); //Editing the format and adding admin tag in front of name
SendClientMessageToAll(0xFFFF00FF, string); //Sends message to all
return 0; //Return false for sending custom chat, so it doesn't send your message twice
}
return 1; //Otherwise return 1 and send the message as normal
}