[Tutorial] How to make Team Chat
#1

The colors needed for your script:
PHP Code:
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_TEAMCHAT 0x8D8DFFFF 
The command we will use is this:
PHP Code:
CMD:t(playeridparams[])
{
    new 
string[128];
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: (/t)team [text]");
    
format(stringsizeof(string), "[Team Chat]%s: %s"RPN(playerid), params);
    
SendPlayerTeamMessage(playeridCOLOR_TEAMCHATstring);
    
SetPlayerChatBubble(playerid,params,COLOR_TEAMCHAT,20.0,5000);
    return 
1;

Now add this somewhere in your script
PHP Code:
stock SendPlayerTeamMessage(playerid,colorstring[])
{
    foreach(
Playeri)
    {
        if(
gTeam[i] == gTeam[playerid]) //Here i used gteam(You can use PlayerInfo[playerid][Faction/Gang/Fam]
        
{
            
SendClientMessage(icolorstring);
        }
    }
    return 
1;

Also add this somewhere
PHP Code:
stock RPN(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    for(new 
0MAX_PLAYER_NAMEi++)
    {
        if(
name[i] == '_'name[i] = ' ';
    }
    return 
name;

I hope this will be helpful
If you have questions or problems, just write here.
Reply


Messages In This Thread
How to make Team Chat - by bustern - 15.02.2014, 13:40
Re: How to make Team Chat - by amirab - 16.02.2014, 08:30
Re: How to make Team Chat - by Avi Raj - 16.02.2014, 08:37
Re: How to make Team Chat - by bustern - 16.02.2014, 15:06
Re: How to make Team Chat - by doreto - 16.02.2014, 15:13
Re: How to make Team Chat - by Glossy42O - 29.11.2014, 07:46
Re: How to make Team Chat - by ivndosos - 29.11.2014, 09:18
Re: How to make Team Chat - by bustern - 09.12.2014, 21:35
Re: How to make Team Chat - by Glossy42O - 13.12.2014, 13:53
Re: How to make Team Chat - by Arastair - 13.12.2014, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)