Mod This Team Chat :S
#1

Please someone show me what i got to do to make this team chat work for all my Teams not just TEAM_USA..But ovc only the teams can see there chat..

Код:
        if(!strcmp(cmdtext, "/tc", true))
        {
        new string[128], Player[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Player, MAX_PLAYER_NAME);
        format(string, 128, "(Team Chat): %s: %s", Player, cmdtext[2]);
        for(new i=0; i<MAX_PLAYERS; i++) if(gTeam[i]==TEAM_USA) SendClientMessage(i, RED, string);
        return 1;
        }
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/tc", true))
{
        new string[128], Player[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Player, MAX_PLAYER_NAME);
        format(string, 128, "(Team Chat): %s: %s", Player, cmdtext[2]);
        for(new i=0; i<MAX_PLAYERS; i++) if(gTeam[i]==gTeam[playerid]) SendClientMessage(i, RED, string);
        return 1;
}
I changed:
pawn Код:
if(gTeam[i] == TEAM_USA)
By:
pawn Код:
if(gTeam[i] == gTeam[playerid]) // if the player has the same team as the player being loopd.
Reply
#3

is that all i had to do? Use gTeam and it automatically checks there team? If so nice now i know why its Global Team xDDD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)