[SOLVED]Chat bug
#1

I've got a chat bug where it says everything twice. Here's my OnPlayerText:

Код:
public OnPlayerText(playerid, text[])
{
	new string[256];
	new tmp[256];
	new playername[MAX_PLAYER_NAME];

	if(PlayerInfo[playerid][pMuted] == 1)
	{
		SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak because you're muted.");
		return 0;
	}
	if (realchat)
	{
	  if(gPlayerLogged[playerid] == 0)
	  {
	    return 0;
   	}
  	GetPlayerName(playerid, playername, sizeof(playername));
		format(string, sizeof(string), "%s Says: %s", playername, text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		return 0;
	}
	return 1;
}
I've gone over it 100 times and still can't find what's wrong. An example of the problem is as follows.

Quote:

Some_Guy Says: Hello!
Some_Guy: Hello!

And I've still not yet found why it's doing that. Any real help is appreciated.
Reply
#2

It must be the ProxDetector function.
This problem has been solved before, search.
Reply
#3

I have, I'm not that moronic. I've replaced my function a good 15 times.
Reply
#4

I've fixed it. It was right under my nose the whole time.
Reply
#5

It would be nice, if you say what was wrong. For the next ppl with this problem..
Reply
#6

He had to return 0; instead of returning 1 at the end of public OnPlayerText
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)