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(playerid, params[])
{
new string[128];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: (/t)team [text]");
format(string, sizeof(string), "[Team Chat]%s: %s", RPN(playerid), params);
SendPlayerTeamMessage(playerid, COLOR_TEAMCHAT, string);
SetPlayerChatBubble(playerid,params,COLOR_TEAMCHAT,20.0,5000);
return 1;
}
Now add this somewhere in your script
PHP Code:
stock SendPlayerTeamMessage(playerid,color, string[])
{
foreach(Player, i)
{
if(gTeam[i] == gTeam[playerid]) //Here i used gteam(You can use PlayerInfo[playerid][Faction/Gang/Fam]
{
SendClientMessage(i, color, string);
}
}
return 1;
}
Also add this somewhere
PHP Code:
stock RPN(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
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
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
is this a tutorial?
Are you sure?
|
Lol, I'm sure it ain't