OnPlayerText
#1

What's wrong with this code?
pawn Код:
public OnPlayerText(playerid, text[])
{
    new pname[24];
    GetPlayerName(playerid, pname, sizeof(pname));

    new str[128];
    format(str, sizeof(str), "%s[%i]: %s", pname, playerid, text);

    if(TextColor[playerid] == None)
    {
        SendClientMessageToAll(0xFFFFFFAA, str);
    }
    if(TextColor[playerid] == Red)
    {
        SendClientMessageToAll(0xFF0000AA, str);
    }
    if(TextColor[playerid] == Orange)
    {
        SendClientMessageToAll(0xFFA500AA, str);
    }
    if(TextColor[playerid] == Yellow)
    {
        SendClientMessageToAll(0xFFFF00AA, str);
    }
    if(TextColor[playerid] == Green)
    {
        SendClientMessageToAll(0x00FF00AA, str);
    }
    if(TextColor[playerid] == Blue)
    {
        SendClientMessageToAll(0x0000FFAA, str);
    }
    if(TextColor[playerid] == Purple)
    {
        SendClientMessageToAll(0x800080AA, str);
    }
    if(TextColor[playerid] == Grey)
    {
        SendClientMessageToAll(0x808080AA, str);
    }
    if(TextColor[playerid] == Cyan)
    {
        SendClientMessageToAll(0x00FFFFAA, str);
    }
    if(TextColor[playerid] == Pink)
    {
        SendClientMessageToAll(0xFF00FFAA, str);
    }
    return 0;
}
It sends the message in every color.

pawn Код:
public OnPlayerConnect(playerid)
{
    TextColor[playerid] = None;
        return 1;
}
Reply


Messages In This Thread
OnPlayerText - by austin070 - 01.09.2012, 22:26
Re: OnPlayerText - by Kirollos - 01.09.2012, 22:36
Re: OnPlayerText - by AndreT - 01.09.2012, 22:49
Re: OnPlayerText - by austin070 - 01.09.2012, 22:55

Forum Jump:


Users browsing this thread: 1 Guest(s)