Team chat problem
#3

Quote:
Originally Posted by MadeMan
You can't use this line

pawn Код:
SendClientMessage(team,color,string);
to send team message.

pawn Код:
dcmd_t(playerid, cmdtext[])
{
        new idx;
        while(cmdtext[idx] == 32) idx++;

        if(cmdtext[idx] == EOS)
        return SendClientMessage(playerid,COLOR_GOLD,"USAGE: /t [text]");

        new string[128];
        new team = GetPlayerTeam(playerid);
        new color = GetPlayerColor(playerid);
        GetPlayerName(playerid,string,MAX_PLAYER_NAME);
        format(string,128,"[Team]%s: %s",string,cmdtext[idx]);

        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && GetPlayerTeam(i) == team)
            {
                SendClientMessage(i,color,string);
            }
        }
        return 1;
}
It works now but it shows up for all players, not only for team members. And by the way im using gTeam.

How to make it that message will only show up for team members and not for all players.
Reply


Messages In This Thread
Team chat problem - by kamilbam - 29.12.2009, 19:46
Re: Team chat problem - by MadeMan - 29.12.2009, 19:54
Re: Team chat problem - by kamilbam - 29.12.2009, 20:08
Re: Team chat problem - by MadeMan - 29.12.2009, 20:13
Re: Team chat problem - by kamilbam - 29.12.2009, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)