HELP Gang chat
#1

Код:
static gTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];
Код:
public OnPlayerText(playerid, text[])
{
  if(text[0] == '!')
  	{
  		new string[256];
	  	new pName[24];
    GetPlayerName(playerid,pName,sizeof(pName));
	  format(string, sizeof(string), "Gang Chat: %s: %s", pName, text[1]);
	  SendClientMessage(gTeam[playerid],COLOR_YELLOW, string);
	 }
	 return 1;
}
It doesnt work!!
Reply
#2

pawn Код:
static gTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
  if(text[0] == '!')
    {
        new string[256];
        new pName[24];
    GetPlayerName(playerid,pName,sizeof(pName));
      format(string, sizeof(string), "Gang Chat: %s: %s", pName, text[1]);
      for(new i; i<MAX_PLAYERS; i++)
      {
        if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid] )
        {
          SendClientMessage(i,COLOR_YELLOW, string);
        }
      }
     }
     return 1;
}
Reply
#3

Thank you. But it also shows for all. I want it to show only for the members in certain team
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)