Team Chat
#3

pawn Код:
CMD:t(playerid, params[])
{
   if(isnull(params)) return SP COLOR_RED,"USAGE: /t < Text >");
   new str[128], pName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, pName, sizeof(pName));
   for(new i = 0; i < MAX_PLAYERS; i++) //This so it loops thru all the players
   { //notice the bracket here..
      if(gTeam[i] == gTeam[playerid])//so the message playerid sends will be sent to only team members..
      {
         format(str,sizeof(str),"[TEAM]: %s[%i]: %s",pName,playerid,params);
         SendClientMessage(i,-1,str);
      }
   }
   return 1;
}
Reply


Messages In This Thread
Team Chat - by megamind2067 - 03.03.2013, 18:28
Re: Team Chat - by Ryan_Bowe - 03.03.2013, 18:35
Respuesta: Team Chat - by Strier - 03.03.2013, 18:38
Re: Respuesta: Team Chat - by megamind2067 - 03.03.2013, 18:39

Forum Jump:


Users browsing this thread: 1 Guest(s)