Need team chat for my tdm!!!!!!!PLEASE
#1

I need team chat! like this:
i'm writin' "!" than message!

help plz

tnx
Reply
#2

Script Request Thread #4.
Reply
#3

Quote:
Originally Posted by Cry_Wolf
Script Request Thread #4.
tnx
Reply
#4

public OnPlayerText(playerid,text[])
{
if(text[0] == '!')
{
new string[128];
format(string, sizeof(string), "Team Chat: %s", text[1]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, COLOR, string);
}
return 0;
}
Reply
#5

Код:
//------------------------------------------------------------------------------------------------------

public OnPlayerText(playerid, text[])
{
  new string[256];
  new playername[MAX_PLAYER_NAME];
  if(text[0] == '!' && text[1] != 0) 
  {
    GetPlayerName( playerid, playername, MAX_PLAYER_NAME );
    format( string, 128, "[Team] %s: %s", playername, text[1] );
    for(new i = 0; i < MAX_PLAYERS; i++ )
    {
      if( IsPlayerConnected(i) && gTeam[playerid] == gTeam[i] )
        SendClientMessage( i, UrColor, string );
    }
    return 0;
  }

  return 1;
}
//------------------------------------------------------------------------------------------------------
u just need to replace "UrColor" to the color u wanna use like : COLOR_RED , COLOR_GREEN , but they need to be defined
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)