[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
#2

Nice For Beginners
Reply
#3

is this a tutorial?
Are you sure?
Reply
#4

Yes this is a tutorial
Reply
#5

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]!
Reply
#6

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)