Couple Questions.
#5

first make sure the 'teamid[MAX_PLAYERS]' is at the top of your GM/FS... then at the OnPlayerConnect define players teamid...( teamid[playerid]={the teams id} // if he has no team define it -1
then..
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '$' && teamid[playerid]!=-1)
    {
         new string[128]; GetPlayerName(playerid,string,sizeof(string));
         format(string,sizeof(string),"Team Chat: %s: %s",string,text[1]);
         return SendMessageToTeam(COLOR_GREEN,string,teamid[playerid]);
    }
      return 0;
}

stock SendMessageToRAdmins(color,const msg[],tid)
{
   for (new i=0; i<MAX_PLAYERS; i++) // i recommend to use foreach(Player,i)
      if (IsPlayerConnected(i) && teamid[i]==tid) SendClientMessage(i,color,msg);
}
Reply


Messages In This Thread
Couple Questions. - by [Comrade] - 06.12.2010, 22:54
Re: Couple Questions. - by [Comrade] - 07.12.2010, 00:29
Re: Couple Questions. - by XePloiT - 07.12.2010, 00:32
Re: Couple Questions. - by fangoth1 - 07.12.2010, 00:35
Re: Couple Questions. - by XePloiT - 07.12.2010, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)