SA-MP Forums Archive
[Tutorial] How to make 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make Team Chat (/showthread.php?tid=494965)



How to make Team Chat - bustern - 15.02.2014

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.


Re: How to make Team Chat - amirab - 16.02.2014

Nice For Beginners


Re: How to make Team Chat - Avi Raj - 16.02.2014

is this a tutorial?
Are you sure?


Re: How to make Team Chat - bustern - 16.02.2014

Yes this is a tutorial


Re: How to make Team Chat - doreto - 16.02.2014

Quote:
Originally Posted by amirab
View Post
Nice For Beginners
How this can "nice for beginners" when it haven't explained anything or you just don't understand anything here?

OT: Nothing explained for beginner to learn something only copy this copy that and paste here. Explain what are you doing,why you are doing it. I won't botter expaint everything but you should read this How to write a tutorial

Not to mention missing parts like RPN(playerid),gTeam[playerid]!


Re: How to make Team Chat - Glossy42O - 29.11.2014

You didn't explain nothing at all. lol you call this a tutorial ?

EDIT: whops.. didn't saw the date lol gonna look before i post again


Re: How to make Team Chat - ivndosos - 29.11.2014

Didn't understand nothing at all do like doreto said, "how to write a tutorial" link


Re: How to make Team Chat - bustern - 09.12.2014

Well if you are not that dumb you will understand it,explaining every single line is for idiots


Re: How to make Team Chat - Glossy42O - 13.12.2014

So are you saying, not explaining is better? you explained only 1 line..


Re: How to make Team Chat - Arastair - 13.12.2014

Quote:
Originally Posted by Avi Raj
View Post
is this a tutorial?
Are you sure?
Lol, I'm sure it ain't