SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=142123)



Help - laser50 - 17.04.2010

Could someone give me the code so i can use SendTeamMessage please? it would help me a lot.


Re: Help - biltong - 17.04.2010

Use a loop.

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(GetPlayerTeam(playerid) == YOUR_TEAM_HERE) //or if(gTeam[playerid] == YOUR_TEAM_HERE)
    {
        SendClientMessage(i, YOUR_COLOUR_HERE, "YOUR MESSAGE HERE");
    }
}



Re: Help - Correlli - 17.04.2010

Quote:
Originally Posted by biltong
Use a loop.

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(GetPlayerTeam(playerid) == YOUR_TEAM_HERE) //or if(gTeam[playerid] == YOUR_TEAM_HERE)
    {
        SendClientMessage(i, YOUR_COLOUR_HERE, "YOUR MESSAGE HERE");
    }
}
Your code won't work - you're using 'playerid' in the GetPlayerTeam loop.

pawn Код:
for(new u = 0; u < GetMaxPlayers(); u++)
{
  if(GetPlayerTeam(u) == TEAM_DEFINE) SendClientMessage(u, COLOR_DEFINE, "Message text.");
}



Re: Help - biltong - 17.04.2010

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by biltong
Use a loop.

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(GetPlayerTeam(playerid) == YOUR_TEAM_HERE) //or if(gTeam[playerid] == YOUR_TEAM_HERE)
    {
        SendClientMessage(i, YOUR_COLOUR_HERE, "YOUR MESSAGE HERE");
    }
}
Your code won't work - you're using 'playerid' in the GetPlayerTeam loop.

pawn Код:
for(new u = 0; u < GetMaxPlayers(); u++)
{
  if(GetPlayerTeam(u) == TEAM_DEFINE) SendClientMessage(u, COLOR_DEFINE, "Message text.");
}
Right, I always seem to do that
Thanks for catching it.


Re: Help - laser50 - 17.04.2010

no i mean, on some places, i saw SendTeamMessage, i need the stock of it.


Re: Help - Correlli - 18.04.2010

pawn Код:
stock SendTeamMessage(teamid, message[])
{
  for(new u = 0; u < GetMaxPlayers(); u++)
  {
    if(GetPlayerTeam(u) == teamid) SendClientMessage(u, COLOR_DEFINE, message);
  }
  return true;
}