21.01.2010, 19:12
This is what I use on my server (team chat with ! )
pawn Код:
//Add OnPlayerText
//Team Chat
if(text[0] == '!')
{
text[0] = ' ';
for(new i = 0; i <= MAX_PLAYERS; i++ )
{
new str[512];
if(gTeam[playerid] == 255)
{
SendClientMessage(playerid,<COLOR>,"You just used \"!\" for team chat, but you are not in any team right now!");
return 0;
}
if(gTeam[playerid] == gTeam[i])
{
format(str,512,"[Team] %s:%s",PlayerName(playerid),text); /* note that there is no space after the first "%s:" to not make the message look weird for having to much space*/
SendClientMessage(i, <COLOR>, str);
}
}
return 0;
}