SA-MP Forums Archive
Help bug with OnPlayerText - 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: Help bug with OnPlayerText (/showthread.php?tid=476805)



Help bug with OnPlayerText - skydux123 - 20.11.2013

Hello everybody, I have one little bug and I don't know how to fix it. When player types the text it's
duplicate I don't want it... For more info i put foto:

Code for OnPlayerText is here:
Код HTML:
public OnPlayerText(playerid, text[])
{
	if(NeleistiniSimboliai(text))
	{
		InfoBoxForPlayer(playerid, "~r~Tekste yra neleistinu simboliu");
		return 1;
	}
	if(PlayerInfo[playerid][muted] == true)
	{
	    SendClientMessage(playerid, RAUDONA, "Jūs esate uћtildytas");
	    return 1;
	}
	new msg[128];
	if(!PlayerInfo[playerid][Atsiliepe]) format(msg,128,"{FFFF00}%s sako: {FFFFFF}%s",zVardas(playerid),text);
	else
	{
		format(msg,128,"[TELEFONAS]: {CCFF99}Paљnekovas sako: %s",text);
		SendClientMessage(PlayerInfo[playerid][Pasnekovas]-2,0x809FFFFF,msg);
        format(msg,128,"{FFFF00}%s sako: {D8D8D8}(telefonas) {FFFFFF}%s",zVardas(playerid),text);
	}
	SetPlayerChatBubble( playerid, text, 0xFF0000FF, 5.0, 10000 );
	new
		Float:dis		[ 3 ],
		string	 		[ 256 ];
	format				( string, sizeof( string ), "{B2B3A8}%s sako: {FFFFFF}%s", GetPlayerNameEx( playerid ), text );
	GetPlayerPos		( playerid, dis[ 0 ], dis[ 1 ], dis[ 2 ] );
	foreach(Player, player)
	{
		if(IsPlayerInRangeOfPoint( player, 8, dis[ 0 ], dis[ 1 ], dis[ 2 ] ) )
		{
			SendClientMessageEx( player, -1, string );
		}
	}
	A_OnPlayerText(playerid, text);
	return 1;
}
Thanks in advice


Re: Help bug with OnPlayerText - Konstantinos - 20.11.2013

Return 0 at the end to prevent the default chat.


Re: Help bug with OnPlayerText - skydux123 - 20.11.2013

Thanks for help