How to make a Group/Team Chat?
#1

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....
Reply
#2

You mean something like:

/d message = [DEFENDER]Player: Message

and

/a message = [ATTACKER]Player: Message
Reply
#3

yea soemthing like that

and if also

if the player is DEFENDER

they press

/a

it should say "Your Not in that Team"
Reply
#4

You should probably post in this topic:
http://forum.sa-mp.com/index.php?topic=94387.0
Reply
#5

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?
Reply
#6

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
Reply
#7

Maybe this https://sampforum.blast.hk/showthread.php?tid=274514
its not team messages , but group , could be usefull
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)