OnPlayerText + GetPlayerColor
#2

Try this, also note that GetPlayerColor only works properly if SetPlayerColor has been used beforehand. (wiki)
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
}
source
Reply


Messages In This Thread
OnPlayerText + GetPlayerColor - by Kyance - 23.12.2013, 14:06
Re: OnPlayerText + GetPlayerColor - by xVIP3Rx - 23.12.2013, 14:17
Re: OnPlayerText + GetPlayerColor - by newbienoob - 23.12.2013, 14:19

Forum Jump:


Users browsing this thread: 2 Guest(s)