Gangchat Problem
#1

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;
}
When I submit a message it is visible in public chat too.
Reply
#2

search:
Public TeamChatLog

tell me what you got under there
Reply
#3

pawn Код:
//=========================[TeamChatLog]========================================
stock TeamChatLog(string[]){
    new entry[256];
    format(entry, sizeof(entry), "%s\n",string);
    new File:hFile;
    hFile = fopen("teamchat.txt", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}
There.
Reply
#4

Still need help please.
Reply
#5

Have you set gTeam to anything?
Reply
#6

Then you should return 0 instead of 1 when you send message to his team:

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 0;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)