Help me about chat
#5

Anwix, your code is very bad and it won't work.

Use this:
pawn Код:
public OnPlayerText(playerid, text[])
{
  new string[128], name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  if(gTeam[playerid] == TEAM_ATTACK)
  {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
      if(gTeam[i] == gTeam[playerid])
      {
        format(string, sizeof(string), "%s [Attack]: %s", name, text);
        SendClientMessage(i, COLOR_WHITE, string);
      }
    }
  }
  else if(gTeam[playerid] == TEAM_DEFENCE)
  {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
      if(gTeam[i] == gTeam[playerid])
      {
        format(string, sizeof(string), "%s [Defence]: %s", name, text);
        SendClientMessage(i, COLOR_WHITE, string);
      }
    }
  }
  return 0;
}
Reply


Messages In This Thread
Help me about chat - by xCoder - 11.09.2009, 11:18
Re: Help me about chat - by Anwix - 11.09.2009, 11:28
Re: Help me about chat - by xCoder - 11.09.2009, 11:46
Re: Help me about chat - by Abernethy - 11.09.2009, 11:52
Re: Help me about chat - by Correlli - 11.09.2009, 12:05
Re: Help me about chat - by Zeex - 11.09.2009, 12:59
Re: Help me about chat - by saiberfun - 11.09.2009, 13:07
Re: Help me about chat - by Correlli - 11.09.2009, 13:18

Forum Jump:


Users browsing this thread: 1 Guest(s)