Messages for one team only - 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: Messages for one team only (
/showthread.php?tid=103346)
Messages for one team only -
cigo - 19.10.2009
just 1 simple question:
how to make message, what only shows, for example, to police team?
p.s. why i'm not allowed to use search button?
Re: Messages for one team only -
MenaceX^ - 19.10.2009
pawn Код:
stock SendTeamMessage(teamid,color,message[])
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)&&pTeam[i]!=teamid) continue;
SendClientMessage(i,color,message);
}
}
And the searching is disabled for everyone.
Re: Messages for one team only -
[ATC]eRaZoR - 19.10.2009
Код:
for(new i = 0; i < MAX_PALYERS; i++)
{
if(gTeam[i] == TEAM_POLICE)
{
SendClientMessageToAll(COLOR_BLUE, "If you need help, use \"/help\"");
}
return 1;
}
or do you think:
Код:
forward PoliceMessage(color,const string[]);
public PoliceMessage(color,const string[]) //
{
for(new i = 0; i< MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if (gTeam[i] == TEAM_POLICE) SendClientMessage(i, color, string);
}
return 1;
}