Team Announcement - 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 Announcement (
/showthread.php?tid=79111)
Team Announcement -
JoeDaDude - 25.05.2009
Hi,
I'm trying to make a team announcement for my roleplay,
And im not particulley sure how to do it,
Im using sendclientmessage atm,
And i dont know what card to use,
Im wondering if this will work
pawn Код:
if( !strcmp(cmdtext, "/team",true ))
{
SendClientMessage(TEAM_FBI, COLOR-WHITE, "Test Positive");
If not can anyone tell me what function to use, Thankz
Re: Team Announcement -
russiany - 25.05.2009
use loop for , not that "shit"
Re: Team Announcement -
Hot - 25.05.2009
It's ready Message?
or like this:
Код:
Police Team(JoeDaDude) says: ( Something )
if is like my example, i have a code for you
Re: Team Announcement -
Castle - 25.05.2009
Suggest you use:
pawn Код:
forward SendCopMessage(color, text[]);
public SendCopMessage(color, text[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
{
SendClientMessage(i, color, text);
}
}
}
return 1;
}
You can Mod it to work for other Factions and also as /r
Re: Team Announcement -
JoeDaDude - 25.05.2009
Quote:
Originally Posted by Hot
It's ready Message?
or like this:
Код:
Police Team(JoeDaDude) says: ( Something )
if is like my example, i have a code for you
|
Yes that is what i am indeed trying to achieve
Re: Team Announcement -
Hot - 25.05.2009
pawn Код:
if(strcmp(cmd, "/radio", true) == 0)
{
if(gTeam[playerid] == TEAM_FBI)
{
if ((strlen(cmdtext) > 7)&&(strlen(cmdtext) <= 50))
{
new name[MAX_PLAYERS];
new message[128];
strmid(message,cmdtext,7,strlen(cmdtext));
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"-> Police Radio(%s): %s", name, message);
SendCopMessage(0xFFFF00AA, string);
return 1;
}
else return SendClientMessage(playerid, 0xFFFF00AA, "-> You mean: /radio [Message]");
}
If you want to change the command (Maybe from /radio to /r, talk with me, cause then we will need to change some things.)
else return SendClientMessage(playerid, 0xFFFF00AA, "-> You are not a Cop!");
}
pawn Код:
forward SendCopMessage(color, text[]);
public SendCopMessage(color, text[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i, color, text);
}
}
return 1;
}
Re: Team Announcement -
Castle - 25.05.2009
Hot, I posted the function before you ... he can now make it by himself using the function i posted
Re: Team Announcement -
JoeDaDude - 25.05.2009
Ok, It works in a way, And in a way it dosent, If i say /radio Hello
It returns back as Unknown Command