[HELP]Text twice?
#1

hey guys again, i've come across this its probably nothing but could you take a look thanks.

pawn Код:
//---------------[Coloured Chat, Normal]------------------//
    if (IsPlayerConnected(playerid))
    {
        if(gTeam[playerid] == TEAM_CT)
        {
          new CTString[128];
            format(CTString, 128, "Counter Terrorist %s: %s",GetPlayerNameEx(playerid), text);
            SendClientMessageToAll(COLOR_MARINE, CTString);
            print(CTString);
            WriteLog("chat",CTString);
            return 1;
        }
        else if(gTeam[playerid] == TEAM_TT)
        {
          new TString[128];
            format(TString, 128, "Terrorist %s: %s",GetPlayerNameEx(playerid), text);
            SendClientMessageToAll(COLOR_ORANGE, TString);
            print(TString);
            WriteLog("chat",TString);
            return 0;
        }
    }
all that happens is it says Counter (Terrorist): %s: Message but then after it it says %s message, any ideas? thanks.

-©un3o.
Reply
#2

Код:
	//---------------[Coloured Chat, Normal]------------------//
	if (IsPlayerConnected(playerid))
	{
		if(gTeam[playerid] == TEAM_CT)
		{
		    new CTString[128];
			format(CTString, 128, "Counter Terrorist %s: %s", playerid, CTString);
			SendClientMessageToAll(COLOR_MARINE, CTString);
			print(CTString);
			WriteLog("chat",CTString);
			return 1;
		}
		else if(gTeam[playerid] == TEAM_TT)
		{
		    new TString[128];
		  	format(TString, 128, "Terrorist %s: %s", playerid, TString);
		  	SendClientMessageToAll(COLOR_ORANGE, TString);
			print(TString);
			WriteLog("chat",TString);
			return 1;
		}
	}
    return 0;
UNTESTED

Try it? not sure if it works
Reply
#3

You return true in the callback, which means it'll show the chat message.

Just return false after sending those your custom chat messages and it'll be fine.

pawn Код:
if(gTeam[playerid] == TEAM_CT)
{
  new CTString[128];
  format(CTString, 128, "Counter Terrorist %s: %s", playerid, CTString);
  SendClientMessageToAll(COLOR_MARINE, CTString);
  print(CTString);
  WriteLog("chat",CTString);
  return 0; // Return false.
}
else if(gTeam[playerid] == TEAM_TT)
{
  new TString[128];
  format(TString, 128, "Terrorist %s: %s", playerid, TString);
  SendClientMessageToAll(COLOR_ORANGE, TString);
  print(TString);
  WriteLog("chat",TString);
  return 0; // Return false.
}
Reply
#4

Cheers mate, also

@ Niixie i cant test, not on my lappy sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)