21.09.2012, 22:12
Everyone can see the team chat when I enter message... It displays like "@Test" it sends msg to all and to team too.
PHP код:
new ChatText[128], Nameasd[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nameasd, MAX_PLAYER_NAME);
format(ChatText, sizeof(ChatText),"%s %s: %s", Rank, Nameasd, text);
SendClientMessageToAll(-1, ChatText);
if(text[0] == '@')
{
new string[128];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[Team] %s: %s", string, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
return 1;
}