SA-MP Forums Archive
How to make a Group/Team Chat? - 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)
+--- Thread: How to make a Group/Team Chat? (/showthread.php?tid=72982)



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(playeridtext[])
{
    if(
text[0] == "!" || text[0] == "@")
    {
        new 
name[MAX_PLAYER_NAME], msg[128];
        
GetPlayerName(playeridnamesizeof(name));
       
        
format(msgsizeof(msg), "[Team Chat] %s[%d]: %s"nameplayeridtext[1]);
       
        for(new 
ii<=MAX_PLAYERSi++)
        {
            if(
GetPlayerTeam(playerid) == GetPlayerTeam(i))
            {
                
SendClientMessage(iTEAMCOLORmsg);
            }
        }
        return 
0;
    }

This works perfectly fine with me. Just change "@" to your desired letter for example #. This way it will say

PHP Code:
[Team-ChatMyNameText 
Of course. If you wish to change your team message you should change

PHP Code:
format(msgsizeof(msg), "[Team Chat] %s[%d]: %s"nameplayeridtext[1]); 
to desired text.
For example:
PHP Code:
format(msgsizeof(msg), "[My Team] %s[%s]: %s"nameplayeridtext[1]); 
I hope it will help you

+rep