Quote:
Originally Posted by ThePhenix
PHP код:
public OnPlayerText(playerid, text[])
{
/*=========================================================================================================
Team Chat
==========================================================================================================*/
if(text[0] == '#')
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"|Team Chat| %s: %s",string,text[1]);
MessageToTeam(0xDC686BAA,string);
}
return 0;
}
//=======================================================================================================//
stock MessageToTeam(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)//Loop through all the players.
{
if(IsPlayerConnected(i) == 1)//Just if the player is connected.
if(GetPlayerTeam(i))//Gets the player team
SendClientMessage(i, color, string);//Sends the message to the team.
}
return 1;
}
|
Hey thanks dude I'm gonna try this out now! Looks very neat & tidy =]