11.12.2009, 09:38
pawn Код:
//=========================[TeamChat]===========================================
public OnPlayerText(playerid,text[]){
if(PlayerData[playerid][Muted] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Unable to talk. (REASON: Muted)");
return 0;
}
if(text[0] == '!') {
new name[24], string[256];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "*Teamchat %s: %s", name, text[1]);
printf("%s", string);
TeamChatLog(string);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
}
}
return 1;
}
return 1;
}