SA-MP Forums Archive
Team Radio? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team Radio? (/showthread.php?tid=122435)



Team Radio? - JoeDaDude - 21.01.2010

How do i make a radio so only a certain team can see what other people say,
I dont want the whole code, Just the main bit, Like what makes it so only a certain team can see that message


Re: Team Radio? - John Rockie - 21.01.2010

Try this
pawn Код:
public OnPlayerText(playerid,text[])
{
    if(text[0] == '!') //change ! to what variable u wanna use
    {
      new string[128];  GetPlayerName(playerid, string, sizeof(string));
      format(string, sizeof(string), "[*Team Chat] %s: %s", string, text[1]);
        printf("%s", string);

      for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }

    return 1;
}



Re: Team Radio? - sidhu123 - 21.01.2010

Cant you just use gTeam with SendClientMessage?

Haha! The guy above posted at the same time.