This is last thread about DM
#9

Try my TeamChat, use '!<Text>' ingame, no spaces.

pawn Код:
// Teamchat
public OnPlayerText( playerid, text[ ] )
{
    if ( text[ 0 ] = '!' && text[ 1 ] != ' ' )
    {
        foreach (Player, i) // Loop
        {
            if ( gTeam[ playerid ] == gTeam[ i ] ) // if the team is same
            {
                new
                    szString[ 128 ],
                    pName[ 24 ]
                ;
                 
                GetPlayerName( playerid, pName, 24 );

                if ( text[ 0 ] == '!' )
                    text[ 0 ] = ' ';

                format( szString, 128, "TEAMCHAT [ %s ] :%s", pName, text );

                SendClientMessage( i, -1, szString );
            }
        }
    }

    return 1;
}
Remember, change 'gTeam' variable to your code's 'gTeam' variable.

Also you need foreach for my code.
Reply


Messages In This Thread
This is last thread about DM - by lyrics - 17.08.2011, 09:57
Re: This is last thread about DM - by lyrics - 17.08.2011, 10:23
Re: This is last thread about DM - by [MG]Dimi - 17.08.2011, 10:45
Re: This is last thread about DM - by Riddick94 - 17.08.2011, 10:45
Re: This is last thread about DM - by Basicz - 17.08.2011, 10:46
Re: This is last thread about DM - by lyrics - 17.08.2011, 10:50
Re: This is last thread about DM - by Adil - 17.08.2011, 11:08
Re: This is last thread about DM - by lyrics - 17.08.2011, 11:22
Re: This is last thread about DM - by Basicz - 17.08.2011, 11:43
Re: This is last thread about DM - by lyrics - 17.08.2011, 12:00

Forum Jump:


Users browsing this thread: 1 Guest(s)