23.12.2013, 14:17
Try this, also note that GetPlayerColor only works properly if SetPlayerColor has been used beforehand. (wiki)
source
pawn Код:
public OnPlayerText(playerid, text[])
{
new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
new string[128];
//other scripts here
if(!PlayerInfo[playerid][pMuted])
{
format(string, sizeof(string), "[%d]{%h}%s: {FFFFFF}%s", playerid, GetPlayerColor(playerid) >>> 8, name, text);
SendClientMessageToAll(-1,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "[MUTE] - You can't talk while you're muted!");
return 0;
}
return 0; // Return 0 at the end as well to prevent the default chat from being sent
}