03.06.2010, 08:21
Firstly : Hi
Secondly: I searched on the forums for some working code and the codes didn't work for me.
Thirdly: My team chat code:
Problem: I tried reurning 0 everywhere but in vain. When try to team chat with @ text, the team get's the message in chat but the message is also announced in the normal chat. So, I need some help to get this code working.
Thanks for reading.
Secondly: I searched on the forums for some working code and the codes didn't work for me.
Thirdly: My team chat code:
Код:
public OnPlayerText(playerid, text[]) { new i; new pname[128]; GetPlayerName(playerid,pname,sizeof(pname)); new string2[256]; if(text[0]=='@') { switch(gTeam[playerid]) { case TEAM_HYDRA: { for(i=0;i<=MAX_PLAYERS;i++) { if(gTeam[i]==gTeam[playerid]) { format(string2,sizeof(string2),"[DEFENDERS] %s: %s",pname,text[1]); return SendClientMessage(i,0x0000ffaa,string2); } } } case TEAM_HYDRA2: { for(i=0;i<=MAX_PLAYERS;i++) { if(gTeam[i]==gTeam[playerid]) { format(string2,sizeof(string2),"[ATTACKERS] %s: %s",pname,text[1]); return SendClientMessage(i,0xff0000aa,string2); } } } } } return 1; }
Thanks for reading.