Team Chat Problem!!!
#2

Hope it will Help You !
Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == ',') // : can be changed to whatever symbol u wanna use for player to enable the teamchat.
    {
        new string[128];  GetPlayerName(playerid, string, sizeof(string)); // Making the new's
        format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]); // Formatted the message
        printf("%s", string); // Printed it BOTH ingame + the server log

        for(new i = 0; i < MAX_PLAYERS; i++) // Getting the player team and color, required for formatting the msg.
        {
            if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }
Reply


Messages In This Thread
Team Chat Problem!!! - by iOmar - 18.06.2012, 02:55
Re: Team Chat Problem!!! - by Avi57 - 18.06.2012, 03:00

Forum Jump:


Users browsing this thread: 1 Guest(s)