team chat help [+rep]
#1

Well I am trying to make a team chat and I have some code tho, but how I actually make the command out of it...

Код:
stock SendTeamMessage( playerid, t_MSG[ ] )
{
    for( new i = 0; i < MAX_PLAYERS; i ++ )
    {
        if( GetPlayerTeam( i ) == GetPlayerTeam( playerid ) )
        {
            new c_msg[ 128 ], c_name[ MAX_PLAYER_NAME ];
            GetPlayerName( playerid, c_name, sizeof c_name );
            format( c_msg, ( 128 ), "[Team Chat] %s: {FFFFFF}%s", c_name, t_MSG );
            SendClientMessage( i, GetPlayerColor( playerid ), c_msg );
        }
        else continue;
    }
    return ( 1 );
}
I want to make like

[Team Chat] Name: Text

Edit: I don't want to loose global chat.

And I tried with

Код:
	if (strcmp("/teamchat", cmdtext, true) == 0 || (strcmp("/tc", cmdtext, true) == 0))
	{
	    SendTeamMessage( playerid, t_MSG[ ] );
		return 1;
	}
But I think I did that wrong?
Reply


Messages In This Thread
team chat help [+rep] - by Twinki1993 - 11.01.2012, 23:17
Re: team chat help [+rep] - by Twinki1993 - 11.01.2012, 23:23
Re: team chat help [+rep] - by Richie - 11.01.2012, 23:25
Re: team chat help [+rep] - by Twinki1993 - 11.01.2012, 23:27
Re: team chat help [+rep] - by Richie - 11.01.2012, 23:31
Re: team chat help [+rep] - by Twinki1993 - 11.01.2012, 23:33
Re: team chat help [+rep] - by Richie - 11.01.2012, 23:39
Re: team chat help [+rep] - by Twinki1993 - 11.01.2012, 23:45
Re: team chat help [+rep] - by Richie - 11.01.2012, 23:53
Re: team chat help [+rep] [String bug] - by Twinki1993 - 11.01.2012, 23:53

Forum Jump:


Users browsing this thread: 2 Guest(s)