How to make a Group/Team Chat? -
HydraX - 12.04.2009
I was looking into some admin scripts but seems like it doesnt work, anyway
i want to know How to make a Group/Team Chat?
Like Defenders is green
they have to press say "#" to chat with there team
so it will be like
[DEFENDER] Hunter: My Message Here...
And Attacker
[ATTACKER] Bob: My Message Here....
Re: How to make a Group/Team Chat? -
RobertGraham - 12.04.2009
You mean something like:
/d message = [DEFENDER]Player: Message
and
/a message = [ATTACKER]Player: Message
Re: How to make a Group/Team Chat? -
HydraX - 12.04.2009
yea soemthing like that
and if also
if the player is DEFENDER
they press
/a
it should say "Your Not in that Team"
Re: How to make a Group/Team Chat? -
RobertGraham - 12.04.2009
You should probably post in this topic:
http://forum.sa-mp.com/index.php?topic=94387.0
Re: How to make a Group/Team Chat? -
Dylan_Madigan69 - 30.01.2012
ive been wondering for a long time, could you please PM me or atleast post here if you find out how to make this chat please?
Re: How to make a Group/Team Chat? -
jamesbond007 - 30.01.2012
look in other simple gamemodes for examples or ******...
its easy just do something like..
pawn Code:
static gTeam[MAX_PLAYERS];
#define attacker 1
#define defender 2
// when player types command:
if(gTeam[playerid]==attacker)
{
//loop the message thought all players in attacker's team
}
else return 0;//or sendmessage Your Not in that Team
Re: How to make a Group/Team Chat? -
DonWade - 31.01.2012
Maybe this
https://sampforum.blast.hk/showthread.php?tid=274514
its not team messages , but group , could be usefull
Re: How to make a Group/Team Chat? -
Twinki1993 - 01.02.2012
Ay mate. Well here is what I use
PHP Code:
public OnPlayerText(playerid, text[])
{
if(text[0] == "!" || text[0] == "@")
{
new name[MAX_PLAYER_NAME], msg[128];
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "[Team Chat] %s[%d]: %s", name, playerid, text[1]);
for(new i; i<=MAX_PLAYERS; i++)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
{
SendClientMessage(i, TEAMCOLOR, msg);
}
}
return 0;
}
}
This works perfectly fine with me. Just change "@" to your desired letter for example #. This way it will say
PHP Code:
[Team-Chat] MyName: Text
Of course. If you wish to change your team message you should change
PHP Code:
format(msg, sizeof(msg), "[Team Chat] %s[%d]: %s", name, playerid, text[1]);
to desired text.
For example:
PHP Code:
format(msg, sizeof(msg), "[My Team] %s[%s]: %s", name, playerid, text[1]);
I hope it will help you
+rep