team chat is not team chat lol
#1

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;
}
Reply
#2

You tried to do a debug ?

pawn Код:
printf ( "ID : %d, Team: %d || My ID: %d, Team: %d:", i, gTeam[i], playerid, gTeam[playerid] );
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)