SA-MP Forums Archive
Chat Problem - 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)
+--- Thread: Chat Problem (/showthread.php?tid=582253)



Chat Problem - SpikY_ - 19.07.2015

Hellu,
I have one problem, When i type anything in chat, it comes up two times.
look at the picture down below.

here are the codes:
Код:
public OnPlayerText(playerid, text[])
{
//===============================================
	new string[500], playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, sizeof(playername));
	if (AccInfo[playerid][pVip] >= 1 || AccInfo[playerid][Level] > 1)
		format(string, sizeof(string), "%s {%06x}[%d]: {%06x}%s", playername, (AccInfo[playerid][IdColor] >>> 8), playerid, (AccInfo[playerid][ChatColor] >>> 8), text);
	else
		format(string, sizeof(string), "%s {FFFFFF}(%d){%06x}: {FFFFFF}%s", playername, playerid, (GetPlayerColor(playerid) >>> 8), text);
	SendClientMessageToAll(GetPlayerColor(playerid), string);
	return 1;
}



AW: Chat Problem - Mencent - 19.07.2015

Hello!

Maybe it will work if you write return 0; instead of return 1;

- Mencent


Re: Chat Problem - 1nspire - 19.07.2015

Код:
public OnPlayerText(playerid, text[])
{
//===============================================
	new string[500], playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, sizeof(playername));
	if (AccInfo[playerid][pVip] >= 1 || AccInfo[playerid][Level] > 1) format(string, sizeof(string), "%s {%06x}[%d]: {%06x}%s", playername, (AccInfo[playerid][IdColor] >>> 8), playerid, (AccInfo[playerid][ChatColor] >>> 8), text);
	else	format(string, sizeof(string), "%s {FFFFFF}(%d){%06x}: {FFFFFF}%s", playername, playerid, (GetPlayerColor(playerid) >>> 8), text);
	SendClientMessageToAll(GetPlayerColor(playerid), string);
	return 0;
}



Re: Chat Problem - jlalt - 19.07.2015

Код:
public OnPlayerText(playerid, text[])
{
//===============================================
	new string[500], playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, sizeof(playername));
	if (AccInfo[playerid][pVip] >= 1 || AccInfo[playerid][Level] > 1)
		format(string, sizeof(string), "%s {%06x}[%d]: {%06x}%s", playername, (AccInfo[playerid][IdColor] >>> 8), playerid, (AccInfo[playerid][ChatColor] >>> 8), text);
	else
		format(string, sizeof(string), "%s {FFFFFF}(%d){%06x}: {FFFFFF}%s", playername, playerid, (GetPlayerColor(playerid) >>> 8), text);
	SendClientMessageToAll(GetPlayerColor(playerid), string);
	return 0;
}



Re: Chat Problem - SpikY_ - 19.07.2015

Fixed. thanks mencent