SA-MP Forums Archive
team chat is not team chat lol - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: team chat is not team chat lol (/showthread.php?tid=483290)



team chat is not team chat lol - cvnr0 - 25.12.2013

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;
}


Re: team chat is not team chat lol - 0x41726d79 - 25.12.2013

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);