25.12.2013, 05:14
hi guyz i used this code for team chat and now i can do team chat, but player of other team can see this chat
public OnPlayerText(playerid, text[])
{
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;
}
public OnPlayerText(playerid, text[])
{
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;
}