SA-MP Forums Archive
[HELP]Text twice? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Text twice? (/showthread.php?tid=113392)



[HELP]Text twice? - [NYRP]Mike. - 13.12.2009

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.


Re: [HELP]Text twice? - Niixie - 13.12.2009

Код:
	//---------------[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


Re: [HELP]Text twice? - Finn - 13.12.2009

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.
}



Re: [HELP]Text twice? - [NYRP]Mike. - 13.12.2009

Cheers mate, also

@ Niixie i cant test, not on my lappy sorry